Re: [yocto] Building clang with Yocto
I tried ldd-ing my binary on my build machine since it doesn't work on my image and it was built on glibc indeed. Since yocto is based on ulibc so it won't work even my target platform is roughly the same as my build platform. I wonder what options should I specify to get llvm to build against the Yocto's libraries rather than my build machine's. As I said in IRC yesterday I found https://lists.yoctoproject.org/pipermail/yocto/2014-June/020358.html which should suit my needs but I get stupid errors on uint32_t: /work/corei7-64-poky-linux/llvm/3.3-r0/llvm -3.3.src/include/llvm/Support/BranchProbability.h:27:3: error: 'uint32_t' does not name a type uint32_t N; I tried adding #include cstdint to that header but no luck. -Original Message- From: Paul Eggleton [mailto:paul.eggle...@linux.intel.com] Sent: Monday, December 22, 2014 7:22 PM To: Yu, Chan KitX Cc: 'Liviu Gheorghisan'; 'Jim Rafert'; yocto@yoctoproject.org Subject: Re: [yocto] Building clang with Yocto Hi Chan Kit, On Monday 22 December 2014 03:33:17 Yu, Chan KitX wrote: Here's an update FYI. I have managed to get clang sort of working. It compiles my sample code but I can't get the binary to execute. ./a.out simply returns: ./a.out: No such file or directory. I'm sure that a.out exists and weirdly I could get the same binary file to run on my build machine. So I guess it could be because of some architecture difference but both target and build platform are quite the same (Intel x64 in build machine and BayleyBay for target platform) I used valleyisland-64 for the target platform so both should be able to execute 64 bit binaries. I suppose I can specify some other configuration options there but I have no idea what to specify the configure parameter --target=TARGET . x64 did not do any good. So any idea? That sounds a bit like the binary has been linked to libraries in the host libdir rather than the correct one for the target. You may be able to verify that using ldd. Cheers, Paul -- Paul Eggleton Intel Open Source Technology Centre -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] Building clang with Yocto
Hi Chan, The errors that you are experiencing point to a mismatch between the target architecture of the compiler, and the headers and libraries that the compiler finds. There are several steps that are necessary to get right before you can produce correct code with the compiler. 1. Configure the clang compiler build such that the compiler will be built to execute on the architecture of the workstation you that you intend to use to compile code for your target with clang. 2. Configure the clang compiler build such that the clang compiler will support code generation for the architecture of the target machine. 3. Modify a copy of the environment-setup file in /opt/poky/... to Here's a page which explains cross compilation using clang. http://clang.llvm.org/docs/CrossCompilation.html Here's an excerpt that talks about specifying the target triple which defines the target architecture that the clang compiler will produce code for: *** Target Triple The basic option is to define the target architecture. For that, use -target triple. If you don’t specify the target, CPU names won’t match (since Clang assumes the host triple), and the compilation will go ahead, creating code for the host platform, which will break later on when assembling or linking. The triple has the general format archsub-vendor-sys-abi, where: arch = x86, arm, thumb, mips, etc. sub = for ex. on ARM: v5, v6m, v7a, v7m, etc. vendor = pc, apple, nvidia, ibm, etc. sys = none, linux, win32, darwin, cuda, etc. abi = eabi, gnu, android, macho, elf, etc. The sub-architecture options are available for their own architectures, of course, so “x86v7a” doesn’t make sense. The vendor needs to be specified only if there’s a relevant change, for instance between PC and Apple. Most of the time it can be omitted (and Unknown) will be assumed, which sets the defaults for the specified architecture. The system name is generally the OS (linux, darwin), but could be special like the bare-metal “none”. When a parameter is not important, they can be omitted, or you can choose unknown and the defaults will be used. If you choose a parameter that Clang doesn’t know, like blerg, it’ll ignore and assume unknown, which is not always desired, so be careful. Finally, the ABI option is something that will pick default CPU/FPU, define the specific behaviour of your code (PCS, extensions), and also choose the correct library calls, etc. I hope that you find this helpful. -Jim- From: Yu, Chan KitX [chan.kitx...@intel.com] Sent: Tuesday, December 23, 2014 1:21 AM To: Paul Eggleton Cc: Jim Rafert; yocto@yoctoproject.org Subject: Re: [yocto] Building clang with Yocto I tried ldd-ing my binary on my build machine since it doesn't work on my image and it was built on glibc indeed. Since yocto is based on ulibc so it won't work even my target platform is roughly the same as my build platform. I wonder what options should I specify to get llvm to build against the Yocto's libraries rather than my build machine's. As I said in IRC yesterday I found https://lists.yoctoproject.org/pipermail/yocto/2014-June/020358.html which should suit my needs but I get stupid errors on uint32_t: /work/corei7-64-poky-linux/llvm/3.3-r0/llvm -3.3.src/include/llvm/Support/BranchProbability.h:27:3: error: 'uint32_t' does not name a type uint32_t N; I tried adding #include cstdint to that header but no luck. -Original Message- From: Paul Eggleton [mailto:paul.eggle...@linux.intel.com] Sent: Monday, December 22, 2014 7:22 PM To: Yu, Chan KitX Cc: 'Liviu Gheorghisan'; 'Jim Rafert'; yocto@yoctoproject.org Subject: Re: [yocto] Building clang with Yocto Hi Chan Kit, On Monday 22 December 2014 03:33:17 Yu, Chan KitX wrote: Here's an update FYI. I have managed to get clang sort of working. It compiles my sample code but I can't get the binary to execute. ./a.out simply returns: ./a.out: No such file or directory. I'm sure that a.out exists and weirdly I could get the same binary file to run on my build machine. So I guess it could be because of some architecture difference but both target and build platform are quite the same (Intel x64 in build machine and BayleyBay for target platform) I used valleyisland-64 for the target platform so both should be able to execute 64 bit binaries. I suppose I can specify some other configuration options there but I have no idea what to specify the configure parameter --target=TARGET . x64 did not do any good. So any idea? That sounds a bit like the binary has been linked to libraries in the host libdir rather than the correct one for the target. You may be able to verify that using ldd. Cheers, Paul -- Paul Eggleton Intel Open Source Technology Centre -- ___ yocto mailing list yocto
Re: [yocto] Building clang with Yocto
Question: Does the fact that Yocto is based on elibc rather than libc be the cause of the incompatibility here? -Original Message- From: Jim Rafert [mailto:j...@spectralogic.com] Sent: Wednesday, December 24, 2014 12:58 AM To: Yu, Chan KitX; Paul Eggleton Cc: yocto@yoctoproject.org Subject: RE: [yocto] Building clang with Yocto Hi Chan, The errors that you are experiencing point to a mismatch between the target architecture of the compiler, and the headers and libraries that the compiler finds. There are several steps that are necessary to get right before you can produce correct code with the compiler. 1. Configure the clang compiler build such that the compiler will be built to execute on the architecture of the workstation you that you intend to use to compile code for your target with clang. 2. Configure the clang compiler build such that the clang compiler will support code generation for the architecture of the target machine. 3. Modify a copy of the environment-setup file in /opt/poky/... to Here's a page which explains cross compilation using clang. http://clang.llvm.org/docs/CrossCompilation.html Here's an excerpt that talks about specifying the target triple which defines the target architecture that the clang compiler will produce code for: *** Target Triple The basic option is to define the target architecture. For that, use -target triple. If you don't specify the target, CPU names won't match (since Clang assumes the host triple), and the compilation will go ahead, creating code for the host platform, which will break later on when assembling or linking. The triple has the general format archsub-vendor-sys-abi, where: arch = x86, arm, thumb, mips, etc. sub = for ex. on ARM: v5, v6m, v7a, v7m, etc. vendor = pc, apple, nvidia, ibm, etc. sys = none, linux, win32, darwin, cuda, etc. abi = eabi, gnu, android, macho, elf, etc. The sub-architecture options are available for their own architectures, of course, so x86v7a doesn't make sense. The vendor needs to be specified only if there's a relevant change, for instance between PC and Apple. Most of the time it can be omitted (and Unknown) will be assumed, which sets the defaults for the specified architecture. The system name is generally the OS (linux, darwin), but could be special like the bare-metal none. When a parameter is not important, they can be omitted, or you can choose unknown and the defaults will be used. If you choose a parameter that Clang doesn't know, like blerg, it'll ignore and assume unknown, which is not always desired, so be careful. Finally, the ABI option is something that will pick default CPU/FPU, define the specific behaviour of your code (PCS, extensions), and also choose the correct library calls, etc. I hope that you find this helpful. -Jim- From: Yu, Chan KitX [chan.kitx...@intel.com] Sent: Tuesday, December 23, 2014 1:21 AM To: Paul Eggleton Cc: Jim Rafert; yocto@yoctoproject.org Subject: Re: [yocto] Building clang with Yocto I tried ldd-ing my binary on my build machine since it doesn't work on my image and it was built on glibc indeed. Since yocto is based on ulibc so it won't work even my target platform is roughly the same as my build platform. I wonder what options should I specify to get llvm to build against the Yocto's libraries rather than my build machine's. As I said in IRC yesterday I found https://lists.yoctoproject.org/pipermail/yocto/2014-June/020358.html which should suit my needs but I get stupid errors on uint32_t: /work/corei7-64-poky-linux/llvm/3.3-r0/llvm -3.3.src/include/llvm/Support/BranchProbability.h:27:3: error: 'uint32_t' does not name a type uint32_t N; I tried adding #include cstdint to that header but no luck. -Original Message- From: Paul Eggleton [mailto:paul.eggle...@linux.intel.com] Sent: Monday, December 22, 2014 7:22 PM To: Yu, Chan KitX Cc: 'Liviu Gheorghisan'; 'Jim Rafert'; yocto@yoctoproject.org Subject: Re: [yocto] Building clang with Yocto Hi Chan Kit, On Monday 22 December 2014 03:33:17 Yu, Chan KitX wrote: Here's an update FYI. I have managed to get clang sort of working. It compiles my sample code but I can't get the binary to execute. ./a.out simply returns: ./a.out: No such file or directory. I'm sure that a.out exists and weirdly I could get the same binary file to run on my build machine. So I guess it could be because of some architecture difference but both target and build platform are quite the same (Intel x64 in build machine and BayleyBay for target platform) I used valleyisland-64 for the target platform so both should be able to execute 64 bit binaries. I suppose I can specify some other configuration options there but I have no idea what to specify the configure parameter --target=TARGET . x64 did
Re: [yocto] Building clang with Yocto
Hi Chan Kit, On Monday 22 December 2014 03:33:17 Yu, Chan KitX wrote: Here's an update FYI. I have managed to get clang sort of working. It compiles my sample code but I can't get the binary to execute. ./a.out simply returns: ./a.out: No such file or directory. I'm sure that a.out exists and weirdly I could get the same binary file to run on my build machine. So I guess it could be because of some architecture difference but both target and build platform are quite the same (Intel x64 in build machine and BayleyBay for target platform) I used valleyisland-64 for the target platform so both should be able to execute 64 bit binaries. I suppose I can specify some other configuration options there but I have no idea what to specify the configure parameter --target=TARGET . x64 did not do any good. So any idea? That sounds a bit like the binary has been linked to libraries in the host libdir rather than the correct one for the target. You may be able to verify that using ldd. Cheers, Paul -- Paul Eggleton Intel Open Source Technology Centre -- ___ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto
Re: [yocto] Building clang with Yocto
Hi Chan, I'm sorry that I have seemed to ignore you for a time, but I have been at home recovering from some surgery. You are correnct. My script does assume rpm package management, but could be easily modified to use use whatever package manager you are using. From: Yu, Chan KitX [chan.kitx...@intel.com] Sent: Tuesday, December 09, 2014 8:24 PM To: Liviu Gheorghisan; Jim Rafert; yocto@yoctoproject.org Subject: Re: [yocto] Building clang with Yocto Liviu and Jim, The thing is I’m trying to integrate LLVM+Clang together in the LLVM recipe. The modifications that I made are just adding Clang, compiler-rt and Clang tools within the LLVM work directory. Using this way, I can mimic the original way (the one in LLVM website) of installing Clang+LLVM. So there are just two recipes; llvm3.3 and llvm-common just like the ones in the OpenEmbedded website. I do not know if I can build Clang separately. Jim, judging from your postbuild script, it would need a RPM based linux system to build isn’t it? Chan Kit From: Liviu Gheorghisan [mailto:liviu.gheorghi...@enea.com] Sent: Wednesday, December 10, 2014 12: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.orgmailto: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.orgmailto: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.orgmailto:yocto-boun...@yoctoproject.org [yocto-boun...@yoctoproject.orgmailto:yocto-boun...@yoctoproject.org] on behalf of yocto-requ...@yoctoproject.orgmailto:yocto-requ...@yoctoproject.org [yocto-requ...@yoctoproject.orgmailto:yocto-requ...@yoctoproject.org] Sent: Monday, December 08, 2014 2:56 AM To: yocto@yoctoproject.orgmailto:yocto@yoctoproject.org Subject: yocto Digest, Vol 51, Issue 26 Send yocto mailing list submissions to yocto@yoctoproject.orgmailto: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.orgmailto:yocto-requ...@yoctoproject.org You can reach the person managing the list at yocto-ow...@yoctoproject.orgmailto: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
Hi guys, Here's an update FYI. I have managed to get clang sort of working. It compiles my sample code but I can't get the binary to execute. ./a.out simply returns: ./a.out: No such file or directory. I'm sure that a.out exists and weirdly I could get the same binary file to run on my build machine. So I guess it could be because of some architecture difference but both target and build platform are quite the same (Intel x64 in build machine and BayleyBay for target platform) I used valleyisland-64 for the target platform so both should be able to execute 64 bit binaries. I suppose I can specify some other configuration options there but I have no idea what to specify the configure parameter --target=TARGET . x64 did not do any good. So any idea? Thanks, Chan Kit From: Yu, Chan KitX Sent: Wednesday, December 10, 2014 11:25 AM To: Liviu Gheorghisan; Jim Rafert; yocto@yoctoproject.org Subject: RE: [yocto] Building clang with Yocto Liviu and Jim, The thing is I'm trying to integrate LLVM+Clang together in the LLVM recipe. The modifications that I made are just adding Clang, compiler-rt and Clang tools within the LLVM work directory. Using this way, I can mimic the original way (the one in LLVM website) of installing Clang+LLVM. So there are just two recipes; llvm3.3 and llvm-common just like the ones in the OpenEmbedded website. I do not know if I can build Clang separately. Jim, judging from your postbuild script, it would need a RPM based linux system to build isn't it? Chan Kit From: Liviu Gheorghisan [mailto:liviu.gheorghi...@enea.com] Sent: Wednesday, December 10, 2014 12:27 AM To: Yu, Chan KitX; Jim Rafert; yocto@yoctoproject.orgmailto: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.orgmailto: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.orgmailto: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.orgmailto:yocto-boun...@yoctoproject.org [yocto-boun...@yoctoproject.orgmailto:yocto-boun...@yoctoproject.org] on behalf of yocto-requ...@yoctoproject.orgmailto:yocto-requ...@yoctoproject.org [yocto-requ...@yoctoproject.orgmailto:yocto-requ...@yoctoproject.org] Sent: Monday, December 08, 2014 2:56 AM To: yocto@yoctoproject.orgmailto:yocto@yoctoproject.org Subject: yocto Digest, Vol 51, Issue 26 Send yocto mailing list submissions to yocto@yoctoproject.orgmailto: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.orgmailto:yocto-requ
Re: [yocto] Building clang with Yocto
I have attached the script. Basically, all that it does is extract the tarball from the install script, untar it into a temp directory, install the rpm created by the llvm build, then tar the temp directory back onto the tail of the script. The script lives in a subdirectory of the main poky directory, and assumes that that is your current working directory when you execute it. Of course, it will need modification on your part because it assumes filenames based upon my own llvm recipes. I would appreciate if you figure out how to get them installed correctly from entirely within the Yocto framework, you will share the information. -Jim- From: Yu, Chan KitX [chan.kitx...@intel.com] Sent: Monday, December 08, 2014 6:19 PM 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... MakeSDK.sh Description: MakeSDK.sh -- ___ 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
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.orgmailto: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.orgmailto: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.orgmailto:yocto-boun...@yoctoproject.org [yocto-boun...@yoctoproject.orgmailto:yocto-boun...@yoctoproject.org] on behalf of yocto-requ...@yoctoproject.orgmailto:yocto-requ...@yoctoproject.org [yocto-requ...@yoctoproject.orgmailto:yocto-requ...@yoctoproject.org] Sent: Monday, December 08, 2014 2:56 AM To: yocto@yoctoproject.orgmailto:yocto@yoctoproject.org Subject: yocto Digest, Vol 51, Issue 26 Send yocto mailing list submissions to yocto@yoctoproject.orgmailto: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.orgmailto:yocto-requ...@yoctoproject.org You can reach the person managing the list at yocto-ow...@yoctoproject.orgmailto: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
Re: [yocto] Building clang with Yocto
Liviu and Jim, The thing is I'm trying to integrate LLVM+Clang together in the LLVM recipe. The modifications that I made are just adding Clang, compiler-rt and Clang tools within the LLVM work directory. Using this way, I can mimic the original way (the one in LLVM website) of installing Clang+LLVM. So there are just two recipes; llvm3.3 and llvm-common just like the ones in the OpenEmbedded website. I do not know if I can build Clang separately. Jim, judging from your postbuild script, it would need a RPM based linux system to build isn't it? Chan Kit From: Liviu Gheorghisan [mailto:liviu.gheorghi...@enea.com] Sent: Wednesday, December 10, 2014 12: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.orgmailto: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.orgmailto: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.orgmailto:yocto-boun...@yoctoproject.org [yocto-boun...@yoctoproject.orgmailto:yocto-boun...@yoctoproject.org] on behalf of yocto-requ...@yoctoproject.orgmailto:yocto-requ...@yoctoproject.org [yocto-requ...@yoctoproject.orgmailto:yocto-requ...@yoctoproject.org] Sent: Monday, December 08, 2014 2:56 AM To: yocto@yoctoproject.orgmailto:yocto@yoctoproject.org Subject: yocto Digest, Vol 51, Issue 26 Send yocto mailing list submissions to yocto@yoctoproject.orgmailto: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.orgmailto:yocto-requ...@yoctoproject.org You can reach the person managing the list at yocto-ow...@yoctoproject.orgmailto: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
[yocto] 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... ---BeginMessage--- -e A release candidate build for yocto-1.8_M1.rc1 is now available at: http://autobuilder.yoctoproject.org/pub/releases/yocto-1.8_M1.rc1 Please begin QA on this build as soon as possible. Build hash information: meta-intel : a72da6350e7a77256ad597e8e8c40909590a2a40 meta-fsl-arm : a593ac48d1a13067d3e4000be616e34699ea4732 meta-minnow : 13a5f2ab84c7284647a3e067a33109c11dae0568 meta-qt3 : 3016129d90b7ac8517a5227d819f10ad417b5b45 meta-fsl-ppc : 486a72425f2f6e25efd9bfdbb9638fb58e90a85f poky : b813bdebb36501500e86fea5f7e15b4b15ea0902 This is an automated message from The Yocto Project Autobuilder Git: git://git.yoctoproject.org/yocto-autobuilder Email: elizabeth.flana...@intel.com ---End Message--- ---BeginMessage--- Hi guys, Before I go to my errors let me outline the steps I took. I started off with the LLVM recipe that I got from http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-core/llvm . Then I added the following to llvm.inc's do_configure_prepend() because I wanted to compile Clang, rt-compiler and Clang tools together with LLVM. I also added the SRC_URI and Licensing for all of them but I don't think that's the main issue here: mv ${WORKDIR}/cfe-${PV}.src ${S}/tools/clang mv ${WORKDIR}/compiler-rt-${PV}.src ${S}/projects/compiler-rt mv ${WORKDIR}/clang-tools-extra-${PV}.src ${S}/tools/clang/extra The three lines copies the extracted files to the source directory because that's the way the LLVM does it according to http://clang.llvm.org/get_started.html . The compilation went well but I got Files/directories were installed but not shipped error. The log is at http://pastebin.com/e831Ex9E . I then tried to add the install -d ${D}${libdir}/clang to do_install() function but no good..hence my reason of posting here to have more eyes looking at this. Let me know if you need more info. Thanks, Chan Kit ---End Message--- ---BeginMessage--- Hi Ulf, On Sunday 07 December 2014 12:22:06 Ulf Winberg wrote: I'm struggling with trying to dynamically set a file name, to be used with require. See code below: python () { TA = d.getVar('TARGET_ARCH', True) if TA == arm: javaPkg = oracle-jse-ejre-arm-vfp-hflt-client-headless elif TA == i586: javaPkg = oracle-jse-jre-i586 elif TA == x86_64: javaPkg = oracle-jse-jre-x86-64 else: raise Exception(Target architecture '%s' is not supported by the meta-oracle-java layer %TA) d.setVar('JAVA_PKG', javaPkg) } require ${JAVA_PKG}.inc The python function executes properly (if I print javaPkg, it shows up correctly) but the JAVA_PKG variable does not become available for require. From what I can read in section 3.4.4 in this link http://www.yoctoproject.org/docs/1.6/bitbake-user-manual/bitbake-user-manua l.html, it seems to me it should work. Could someone please explain to me why it doesn't? I'm pretty sure this is because anonymous functions don't get executed until finalize() is called, which is towards the end of parsing; the require statement must be handled immediately. Try this instead: snip def get_java_package(d): TA = d.getVar('TARGET_ARCH', True) if TA == arm: javaPkg = oracle-jse-ejre-arm-vfp-hflt-client-headless elif TA == i586: javaPkg = oracle-jse-jre-i586 elif TA == x86_64: javaPkg = oracle-jse-jre-x86-64 else:
Re: [yocto] 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
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