Using SDK generated by Yocto


SDK Can be generated by running "bitbake -c populate_sdk <image_name>" command.

E.g. bitbake -c populate_sdk core-image-sato

Once the command is successfully generated, the SDK (poky-glibc-…-toolchain.sh) is present in build/tmp/deploy/sdk folder

To use the SDK, you should run the environment script.

 $ . /opt/poky/2.5/environment-setup-corei7-32-pokymllib32-linux

 $ . /opt/poky/2.5/environment-setup-corei7-64-poky-linux

E.g. $ source /opt/poky/2.5/environment-setup-corei7-32-pokymllib32-linux

This will set the Compiler,  and all the flags

$ echo $CC
i686-pokymllib32-linux-gcc -m32 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2 --sysroot=/opt/poky/2.5/sysroots/corei7-64-poky-linux

$ echo $CFLAGS
-O2 -pipe -g -feliminate-unused-debug-types

$ echo $LDFLAGS
-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed

To compile a program, run the following command

$CC hello_world.c -o hello_world

Comments

Popular posts from this blog

bb.utils.contains yocto

make config vs oldconfig vs defconfig vs menuconfig vs savedefconfig

PR, PN and PV Variable in Yocto