Changes between Version 17 and Version 18 of venice/bsp

Timestamp:
04/13/2022 08:20:29 PM (3 years ago)
Author:
Tim Harvey
Comment:

updated cross-compile example to use static and explain how to use shared

Legend:

Unmodified
Added
Removed
Modified
  • venice/bsp

    v17 v18  
    226226=== Cross compile examples
    227227
    228 Examples of cross-compiling:
     228Examples of cross-compiling using the buildroot toolchain
    229229 * ANSI-C hello world:
    230230{{{#!bash
     
    241241EOF
    242242. ./setup-environment # setup environment for buildroot toolchain
    243 ${CROSS_COMPILE}gcc helloworld.c -o helloworld
    244 }}}
     243${CROSS_COMPILE}gcc helloworld.c --static -o helloworld
     244}}}
     245  - Note that if you want to use shared libraries you would either need to copy the toolchains libc (buildroot/output/target/lib/) to the target so that the interpreter and shared libs are present or you can use Ubuntu's cross-toolchain instead (see [wiki:/ubuntu#hello-world.c ubuntu/cross-compile])
    245246 * C++ hello world:
    246247{{{#!bash
     
    256257EOF
    257258. ./setup-environment # setup environment for buildroot toolchain
    258 ${CROSS_COMPILE}gcc helloworld.cpp -lstdc++ -o helloworld
    259 }}}
     259${CROSS_COMPILE}gcc helloworld.cpp --static -lstdc++ -o helloworld
     260}}}
     261  - Note that if you want to use shared libraries you would either need to copy the toolchains libc (buildroot/output/target/lib/) to the target so that the interpreter and shared libs are present or you can use Ubuntu's cross-toolchain instead (see [wiki:/ubuntu#hello-world.c ubuntu/cross-compile])
    260262 * kernel module:
    261263{{{#!bash