Re: [yocto] problem of toolchain install directrory
Hello Neil, Your problem is that the toolchain is installed with the location of the sysroot hardcoded as the default installation path for the tool-chain. You can see this location with: $ arm-poky-linux-gnueabi-gcc --print-sysroot // or whatever cross-compiler you built However, after you source the environment script for the toolchain: $ source environment-setup-armv7a-vfp-neon-poky-linux-gnueabi the environment variables related to the toolchain will be updated accordingly, taking care of this problem. So, use $CC instead of directly calling the gcc cross compiler arm-poky-linux-gnueabi-gcc (or whatever the platform you're building for). Check the difference with this: $ echo $CC arm-poky-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=softfp -mfpu=neon --sysroot=/home/livghe/work/ab/sdk/sysroots/armv7a-vfp-neon-poky-linux-gnueabi $ $CC --print-sysroot // uses the correct sysroot /home/livghe/work/ab/sdk/sysroots/armv7a-vfp-neon-poky-linux-gnueabi $ $ arm-poky-linux-gnueabi-gcc --print-sysroot // uses the sysroot from the default instalation path, where it's not present. /opt/poky/4.0/sysroots/armv7a-vfp-neon-poky-linux-gnueabi So, you should always use the env variables ($CC, $AR, $LDFLAGS, etc) after sourcing the environment script from the toolchain instalation path, and not the toolchain executables directly, because the environment variables add some useful flags, not only related to the sysroot, but also to the type of CPU, etc. - Liviu On 12/17/2014 11:30 AM, neil...@emerson.com wrote: *Hello ,all* I build the toolchain via bitbake core-image-minimal –c populate_sdk. Then I install the toolchain. If I install the toolchain in default directory(/default: /opt/poky/1.7.1/), everything is ok. But, if I not install in the default directory, it will appears the problem that can’t find the system header files. Example: stdio.h Why is this ? Whether I need to do some other operation. If you know please help me ! Thank you very much. Best wishes Neil -- Liviu Gheorghisan Software Engineer http://www.enea.com -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] Building clang with Yocto
Hello Yu, Jim I think you can get the clang executable into the SDK installer script with something like this: 1. Add this dependency in nativesdk-packagegroup-sdk-host.bb: *RDEPENDS_${PN} += nativesdk-name-of-clang-recipe* 2. In the clang recipe add this install() overwrite for the nativesdk class - this will install it into the SDK sysroot: *do_install_class-nativesdk() { install -d ${D}${bindir} install -m 0755 clang ${D}${bindir} }* 3. The clang recipe (I don't know if it has a recipe of its own, or it's part of the LLVM recipe) should also inherit from nativesdk: *BBCLASSEXTEND = nativesdk* Basically this should get your clang executable inside the SDK installer. Sure you can add more executables related to clang (like the llvm-related ones) in the install_class-nativesdk() function. - Liviu Gheorghisan On 12/09/2014 04:36 AM, Yu, Chan KitX wrote: I **think** I'm just inches away from success. I think I just need to invoke a correct install command somewhere in the do_install function but so far I have not managed to do so. But right now the alternative way of jamming the compiler into the SDK sounds tempting to me. -Original Message- From: Yu, Chan KitX Sent: Tuesday, December 09, 2014 9:19 AM To: 'Jim Rafert'; yocto@yoctoproject.org Subject: RE: Building clang with Yocto Hi Jim, How did you jam the clang compiler into the SDK tarball? Chan Kit -Original Message- From: Jim Rafert [mailto:j...@spectralogic.com] Sent: Tuesday, December 09, 2014 1:48 AM To: yocto@yoctoproject.org; Yu, Chan KitX Subject: Building clang with Yocto Hello Chan, I have been working to a similar goal, to include clang in the toolchain to be used for compiling applications to run on the target. Using clang to compile the OS and kernel are not required or desired by me. You may get some insight from the thread I started in November on the subject. I'm not sure that this contains all of the posts on the subject. You may want to search the archive for November. I have not been successful yet in getting clang actually packaged in the toolchain, in the Yocto build, but at least it builds. I have a postbuild script that takes the built clang compiler from the work directory and jams it into the SDK tarball that is embedded in the sdk install script. -Jim- From: yocto-boun...@yoctoproject.org [yocto-boun...@yoctoproject.org] on behalf of yocto-requ...@yoctoproject.org [yocto-requ...@yoctoproject.org] Sent: Monday, December 08, 2014 2:56 AM To: yocto@yoctoproject.org Subject: yocto Digest, Vol 51, Issue 26 Send yocto mailing list submissions to yocto@yoctoproject.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.yoctoproject.org/listinfo/yocto or, via email, send a message with subject or body 'help' to yocto-requ...@yoctoproject.org You can reach the person managing the list at yocto-ow...@yoctoproject.org When replying, please edit your Subject line so it is more specific than Re: Contents of yocto digest... -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] Building clang with Yocto
Hello Jim, You must add your override of do_install_class-nativesdk() in the recipe that builds clang/llvm that will not affect how gcc gets installed in the SDK. You can have as many do_install_class-nativesdk() overrides across various recipes as you like, without them conflicting. Basically this is how every tool from the SDK gets installed there. - Liviu On 12/09/2014 06:47 PM, Jim Rafert wrote: Hi Liviu, Thanks for the tip. I had everything but the override for do_install_class-nativesdk(). One question please. Will that override prevent the gcc compilers from being installed in nativesdk? Or should I duplicate the existing do_install_class-nativesdk(), and add the clang stuff? -Jim- *From:* Liviu Gheorghisan [liviu.gheorghi...@enea.com] *Sent:* Tuesday, December 09, 2014 9:27 AM *To:* Yu, Chan KitX; Jim Rafert; yocto@yoctoproject.org *Subject:* Re: [yocto] Building clang with Yocto Hello Yu, Jim I think you can get the clang executable into the SDK installer script with something like this: 1. Add this dependency in nativesdk-packagegroup-sdk-host.bb: *RDEPENDS_${PN} += nativesdk-name-of-clang-recipe* 2. In the clang recipe add this install() overwrite for the nativesdk class - this will install it into the SDK sysroot: *do_install_class-nativesdk() { install -d ${D}${bindir} install -m 0755 clang ${D}${bindir} }* 3. The clang recipe (I don't know if it has a recipe of its own, or it's part of the LLVM recipe) should also inherit from nativesdk: *BBCLASSEXTEND = nativesdk* Basically this should get your clang executable inside the SDK installer. Sure you can add more executables related to clang (like the llvm-related ones) in the install_class-nativesdk() function. - Liviu Gheorghisan On 12/09/2014 04:36 AM, Yu, Chan KitX wrote: I **think** I'm just inches away from success. I think I just need to invoke a correct install command somewhere in the do_install function but so far I have not managed to do so. But right now the alternative way of jamming the compiler into the SDK sounds tempting to me. -Original Message- From: Yu, Chan KitX Sent: Tuesday, December 09, 2014 9:19 AM To: 'Jim Rafert';yocto@yoctoproject.org Subject: RE: Building clang with Yocto Hi Jim, How did you jam the clang compiler into the SDK tarball? Chan Kit -Original Message- From: Jim Rafert [mailto:j...@spectralogic.com] Sent: Tuesday, December 09, 2014 1:48 AM To:yocto@yoctoproject.org; Yu, Chan KitX Subject: Building clang with Yocto Hello Chan, I have been working to a similar goal, to include clang in the toolchain to be used for compiling applications to run on the target. Using clang to compile the OS and kernel are not required or desired by me. You may get some insight from the thread I started in November on the subject. I'm not sure that this contains all of the posts on the subject. You may want to search the archive for November. I have not been successful yet in getting clang actually packaged in the toolchain, in the Yocto build, but at least it builds. I have a postbuild script that takes the built clang compiler from the work directory and jams it into the SDK tarball that is embedded in the sdk install script. -Jim- From:yocto-boun...@yoctoproject.org [yocto-boun...@yoctoproject.org] on behalf ofyocto-requ...@yoctoproject.org [yocto-requ...@yoctoproject.org] Sent: Monday, December 08, 2014 2:56 AM To:yocto@yoctoproject.org Subject: yocto Digest, Vol 51, Issue 26 Send yocto mailing list submissions to yocto@yoctoproject.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.yoctoproject.org/listinfo/yocto or, via email, send a message with subject or body 'help' to yocto-requ...@yoctoproject.org You can reach the person managing the list at yocto-ow...@yoctoproject.org When replying, please edit your Subject line so it is more specific than Re: Contents of yocto digest... -- Liviu Gheorghisan Software Engineer Enea Romania Splaiul Independentei 319, OB403A, District 6, Bucharest, Romania, 060044 http://www.enea.com -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto