* Building clang with Yocto
@ 2014-12-08 17:48 Jim Rafert
2014-12-09 1:19 ` Yu, Chan KitX
2014-12-09 2:36 ` Yu, Chan KitX
0 siblings, 2 replies; 14+ messages in thread
From: Jim Rafert @ 2014-12-08 17:48 UTC (permalink / raw)
To: yocto@yoctoproject.org, chan.kitx.yu@intel.com
[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]
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-bounces@yoctoproject.org [yocto-bounces@yoctoproject.org] on behalf of yocto-request@yoctoproject.org [yocto-request@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-request@yoctoproject.org
You can reach the person managing the list at
yocto-owner@yoctoproject.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of yocto digest..."
[-- Attachment #2: Type: message/rfc822, Size: 1121 bytes --]
From: Poky Build User <pokybuild@ubuntu1204.osl.yoctoproject.org>
To: <yocto@yoctoproject.org>
Cc: <otavio@ossystems.com.br>
Subject: [yocto] Release Candidate Build for yocto-1.8_M1.rc1 now available.
Date: Mon, 8 Dec 2014 09:02:30 +0000
Message-ID: <20141208090230.6C0242C0657@ubuntu1204.osl.yoctoproject.org>
-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.flanagan@intel.com
[-- Attachment #3: Type: message/rfc822, Size: 5928 bytes --]
[-- Attachment #3.1.1: Type: text/plain, Size: 1159 bytes --]
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
[-- Attachment #3.1.2: Type: text/html, Size: 3696 bytes --]
[-- Attachment #4: Type: message/rfc822, Size: 2900 bytes --]
From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: Ulf Winberg <ulfwin@gmail.com>
Cc: <yocto@yoctoproject.org>
Subject: Re: [yocto] Using anonymous python function to define variables
Date: Mon, 8 Dec 2014 09:41:14 +0000
Message-ID: <1426837.Z6YLN2FboT@peggleto-mobl5.ger.corp.intel.com>
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:
raise bb.parse.SkipPackage("Target architecture '%s' is not supported
by the meta-oracle-java layer" % TA)
return javaPkg
JAVA_PKG = "${@get_java_package(d)}"
require ${JAVA_PKG}.inc
---------------- snip ----------------
The question is though, do you really need a separate inc file for each
architecture? You can use overrides for this sort of thing e.g.:
---------------- snip ----------------
SOMEVAR = "default value"
SOMEVAR_arm = "value if arm"
SOMEVAR_x86-64 = "value if x86-64"
---------------- snip ----------------
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
[-- Attachment #5: Type: message/rfc822, Size: 15755 bytes --]
[-- Attachment #5.1.1: Type: text/plain, Size: 5415 bytes --]
I recommend you to file a bug here https://bugzilla.yoctoproject.org/ if
not done already. You may get a proper answer on armhf support there. From
what I see, (someone please correct me if I am wrong), there is no prelink
dynamic link armhf patch. You can also create and submit the patch for
review. AFAIK, you are gonna need to something like below,
.dynamic_linker = "/lib/ld-linux-armhf.so.3" in arch-arm.c.
This is not tested though. Please do a test yourselves.
-JC
On Mon, Dec 8, 2014 at 1:52 PM, Qiang Yu <yuq825@gmail.com> wrote:
> Thanks for your reply. I almost give up.
>
> You mean that current yocto build doesn't support hard float ABI prelink,
> and the prelink source code needs to
> be modified to use ld-linux-armhf.so.3?
>
> So this problem affect all armhf build of yocto, in other words prelink
> doesn't work for yocto armhf at all now?
>
> Regards,
> Qiang
>
> On Mon, Dec 8, 2014 at 3:28 PM, Jegan Chandru <pcjegan@gmail.com> wrote:
>
>> Hi,
>>
>> I think it has to do with the ld-linux-armhf.so.3. May be you should
>> tell prelink that you have hard float ARM ABI to prelink for, than
>> ld-linux.so.3 . It means you need to add ld-linux-armhf.so.3 as a dynamic
>> linker.
>> You should patch the prelink source to get this done.
>>
>> HTH.
>>
>> -JC
>>
>>
>>
>> On Fri, Dec 5, 2014 at 7:41 AM, Qiang Yu <yuq825@gmail.com> wrote:
>>
>>> Hi all,
>>>
>>> I'm building a image with local.conf:
>>> USER_CLASSES ?= "buildstats image-mklibs image-prelink"
>>>
>>> but I think prelink does nothing on my image, because the MD5SUM is the
>>> same before and after
>>> the prelink stage. The mklibs stage is also strange not print anything.
>>> How to make prelink and
>>> mklibs really work?
>>>
>>> Here is the log of log.do_rootfs:
>>>
>>> NOTE: ###### Generate images #######
>>> NOTE: Executing mklibs_optimize_image ...
>>> DEBUG: Executing shell function mklibs_optimize_image
>>> DEBUG: Shell function mklibs_optimize_image finished
>>> NOTE: Executing prelink_image ...
>>> DEBUG: Executing shell function prelink_image
>>> Size before prelinking 49304.
>>> /opt/yocto/rootfs/tmp/sysroots/x86_64-linux/usr/sbin/prelink:
>>> /sbin/fstab-decode: Using /lib/ld-linux-armhf.so.3, not /lib/ld-linux.so.3
>>> as dynamic linker
>>> /opt/yocto/rootfs/tmp/sysroots/x86_64-linux/usr/sbin/prelink:
>>> /sbin/bootlogd: Using /lib/ld-linux-armhf.so.3, not /lib/ld-linux.so.3 as
>>> dynamic linker
>>> /opt/yocto/rootfs/tmp/sysroots/x86_64-linux/usr/sbin/prelink:
>>> /sbin/killall5: Using /lib/ld-linux-armhf.so.3, not /lib/ld-linux.so.3 as
>>> dynamic linker
>>> /opt/yocto/rootfs/tmp/sysroots/x86_64-linux/usr/sbin/prelink:
>>> /sbin/init.sysvinit: Using /lib/ld-linux-armhf.so.3, not /lib/ld-linux.so.3
>>> as dynamic linker
>>> /opt/yocto/rootfs/tmp/sysroots/x86_64-linux/usr/sbin/prelink:
>>> /sbin/halt.sysvinit: Using /lib/ld-linux-armhf.so.3, not /lib/ld-linux.so.3
>>> as dynamic linker
>>> /opt/yocto/rootfs/tmp/sysroots/x86_64-linux/usr/sbin/prelink:
>>> /sbin/shutdown.sysvinit: Using /lib/ld-linux-armhf.so.3, not
>>> /lib/ld-linux.so.3 as dynamic linker
>>> /opt/yocto/rootfs/tmp/sysroots/x86_64-linux/usr/sbin/prelink:
>>> /sbin/runlevel.sysvinit: Using /lib/ld-linux-armhf.so.3, not
>>> /lib/ld-linux.so.3 as dynamic linker
>>> /opt/yocto/rootfs/tmp/sysroots/x86_64-linux/usr/sbin/prelink:
>>> /usr/sbin/dropbearmulti: Using /lib/ld-linux-armhf.so.3, not
>>> /lib/ld-linux.so.3 as dynamic linker
>>> /opt/yocto/rootfs/tmp/sysroots/x86_64-linux/usr/sbin/prelink:
>>> /bin/mountpoint.sysvinit: Using /lib/ld-linux-armhf.so.3, not
>>> /lib/ld-linux.so.3 as dynamic linker
>>> /opt/yocto/rootfs/tmp/sysroots/x86_64-linux/usr/sbin/prelink:
>>> /bin/busybox.suid: Using /lib/ld-linux-armhf.so.3, not /lib/ld-linux.so.3
>>> as dynamic linker
>>> /opt/yocto/rootfs/tmp/sysroots/x86_64-linux/usr/sbin/prelink:
>>> /bin/busybox.nosuid: Using /lib/ld-linux-armhf.so.3, not /lib/ld-linux.so.3
>>> as dynamic linker
>>> /opt/yocto/rootfs/tmp/sysroots/x86_64-linux/usr/sbin/prelink:
>>> /usr/bin/utmpdump.sysvinit: Using /lib/ld-linux-armhf.so.3, not
>>> /lib/ld-linux.so.3 as dynamic linker
>>> /opt/yocto/rootfs/tmp/sysroots/x86_64-linux/usr/sbin/prelink:
>>> /usr/bin/mesg.sysvinit: Using /lib/ld-linux-armhf.so.3, not
>>> /lib/ld-linux.so.3 as dynamic linker
>>> /opt/yocto/rootfs/tmp/sysroots/x86_64-linux/usr/sbin/prelink:
>>> /usr/bin/last.sysvinit: Using /lib/ld-linux-armhf.so.3, not
>>> /lib/ld-linux.so.3 as dynamic linker
>>> /opt/yocto/rootfs/tmp/sysroots/x86_64-linux/usr/sbin/prelink:
>>> /usr/bin/opkg-cl: Using /lib/ld-linux-armhf.so.3, not /lib/ld-linux.so.3 as
>>> dynamic linker
>>> /opt/yocto/rootfs/tmp/sysroots/x86_64-linux/usr/sbin/prelink:
>>> /usr/bin/bmw: Using /lib/ld-linux-armhf.so.3, not /lib/ld-linux.so.3 as
>>> dynamic linker
>>> /opt/yocto/rootfs/tmp/sysroots/x86_64-linux/usr/sbin/prelink:
>>> /usr/bin/wall.sysvinit: Using /lib/ld-linux-armhf.so.3, not
>>> /lib/ld-linux.so.3 as dynamic linker
>>> Size after prelinking 49304.
>>> DEBUG: Shell function prelink_image finished
>>>
>>> Regards,
>>> Qiang
>>>
>>>
>>> --
>>> _______________________________________________
>>> yocto mailing list
>>> yocto@yoctoproject.org
>>> https://lists.yoctoproject.org/listinfo/yocto
>>>
>>>
>>
>>
>> --
>> JCP
>>
>
>
--
JCP
[-- Attachment #5.1.2: Type: text/html, Size: 8847 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building clang with Yocto
2014-12-08 17:48 Building clang with Yocto Jim Rafert
@ 2014-12-09 1:19 ` Yu, Chan KitX
2014-12-09 16:06 ` Jim Rafert
2014-12-09 2:36 ` Yu, Chan KitX
1 sibling, 1 reply; 14+ messages in thread
From: Yu, Chan KitX @ 2014-12-09 1:19 UTC (permalink / raw)
To: Jim Rafert, yocto@yoctoproject.org
Hi Jim,
How did you jam the clang compiler into the SDK tarball?
Chan Kit
-----Original Message-----
From: Jim Rafert [mailto:jimr@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-bounces@yoctoproject.org [yocto-bounces@yoctoproject.org] on behalf of yocto-request@yoctoproject.org [yocto-request@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-request@yoctoproject.org
You can reach the person managing the list at
yocto-owner@yoctoproject.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of yocto digest..."
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building clang with Yocto
2014-12-08 17:48 Building clang with Yocto Jim Rafert
2014-12-09 1:19 ` Yu, Chan KitX
@ 2014-12-09 2:36 ` Yu, Chan KitX
2014-12-09 16:27 ` Liviu Gheorghisan
1 sibling, 1 reply; 14+ messages in thread
From: Yu, Chan KitX @ 2014-12-09 2:36 UTC (permalink / raw)
To: Jim Rafert, yocto@yoctoproject.org
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:jimr@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-bounces@yoctoproject.org [yocto-bounces@yoctoproject.org] on behalf of yocto-request@yoctoproject.org [yocto-request@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-request@yoctoproject.org
You can reach the person managing the list at
yocto-owner@yoctoproject.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of yocto digest..."
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building clang with Yocto
2014-12-09 1:19 ` Yu, Chan KitX
@ 2014-12-09 16:06 ` Jim Rafert
0 siblings, 0 replies; 14+ messages in thread
From: Jim Rafert @ 2014-12-09 16:06 UTC (permalink / raw)
To: Yu, Chan KitX, yocto@yoctoproject.org
[-- Attachment #1: Type: text/plain, Size: 2675 bytes --]
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.yu@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:jimr@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-bounces@yoctoproject.org [yocto-bounces@yoctoproject.org] on behalf of yocto-request@yoctoproject.org [yocto-request@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-request@yoctoproject.org
You can reach the person managing the list at
yocto-owner@yoctoproject.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of yocto digest..."
[-- Attachment #2: MakeSDK.sh --]
[-- Type: application/x-shellscript, Size: 1946 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building clang with Yocto
2014-12-09 2:36 ` Yu, Chan KitX
@ 2014-12-09 16:27 ` Liviu Gheorghisan
2014-12-09 16:47 ` Jim Rafert
2014-12-10 3:24 ` Yu, Chan KitX
0 siblings, 2 replies; 14+ messages in thread
From: Liviu Gheorghisan @ 2014-12-09 16:27 UTC (permalink / raw)
To: Yu, Chan KitX, Jim Rafert, yocto@yoctoproject.org
[-- Attachment #1: Type: text/plain, Size: 3264 bytes --]
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:jimr@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-bounces@yoctoproject.org [yocto-bounces@yoctoproject.org] on behalf of yocto-request@yoctoproject.org [yocto-request@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-request@yoctoproject.org
>
> You can reach the person managing the list at
> yocto-owner@yoctoproject.org
>
> When replying, please edit your Subject line so it is more specific than "Re: Contents of yocto digest..."
[-- Attachment #2: Type: text/html, Size: 4898 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building clang with Yocto
2014-12-09 16:27 ` Liviu Gheorghisan
@ 2014-12-09 16:47 ` Jim Rafert
2014-12-09 16:54 ` Liviu Gheorghisan
2014-12-10 3:24 ` Yu, Chan KitX
1 sibling, 1 reply; 14+ messages in thread
From: Jim Rafert @ 2014-12-09 16:47 UTC (permalink / raw)
To: Liviu Gheorghisan, Yu, Chan KitX, yocto@yoctoproject.org
[-- Attachment #1: Type: text/plain, Size: 4069 bytes --]
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.gheorghisan@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<mailto: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:jimr@spectralogic.com]
Sent: Tuesday, December 09, 2014 1:48 AM
To: yocto@yoctoproject.org<mailto: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-bounces@yoctoproject.org<mailto:yocto-bounces@yoctoproject.org> [yocto-bounces@yoctoproject.org<mailto:yocto-bounces@yoctoproject.org>] on behalf of yocto-request@yoctoproject.org<mailto:yocto-request@yoctoproject.org> [yocto-request@yoctoproject.org<mailto:yocto-request@yoctoproject.org>]
Sent: Monday, December 08, 2014 2:56 AM
To: yocto@yoctoproject.org<mailto:yocto@yoctoproject.org>
Subject: yocto Digest, Vol 51, Issue 26
Send yocto mailing list submissions to
yocto@yoctoproject.org<mailto: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-request@yoctoproject.org<mailto:yocto-request@yoctoproject.org>
You can reach the person managing the list at
yocto-owner@yoctoproject.org<mailto:yocto-owner@yoctoproject.org>
When replying, please edit your Subject line so it is more specific than "Re: Contents of yocto digest..."
[-- Attachment #2: Type: text/html, Size: 5988 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building clang with Yocto
2014-12-09 16:47 ` Jim Rafert
@ 2014-12-09 16:54 ` Liviu Gheorghisan
0 siblings, 0 replies; 14+ messages in thread
From: Liviu Gheorghisan @ 2014-12-09 16:54 UTC (permalink / raw)
To: Jim Rafert, Yu, Chan KitX, yocto@yoctoproject.org
[-- Attachment #1: Type: text/plain, Size: 4575 bytes --]
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.gheorghisan@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:jimr@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-bounces@yoctoproject.org [yocto-bounces@yoctoproject.org] on behalf ofyocto-request@yoctoproject.org [yocto-request@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-request@yoctoproject.org
>>
>> You can reach the person managing the list at
>> yocto-owner@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
[-- Attachment #2: Type: text/html, Size: 8173 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building clang with Yocto
2014-12-09 16:27 ` Liviu Gheorghisan
2014-12-09 16:47 ` Jim Rafert
@ 2014-12-10 3:24 ` Yu, Chan KitX
2014-12-22 3:33 ` Yu, Chan KitX
2014-12-22 17:02 ` Jim Rafert
1 sibling, 2 replies; 14+ messages in thread
From: Yu, Chan KitX @ 2014-12-10 3:24 UTC (permalink / raw)
To: Liviu Gheorghisan, Jim Rafert, yocto@yoctoproject.org
[-- Attachment #1: Type: text/plain, Size: 4396 bytes --]
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.gheorghisan@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.org<mailto: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:jimr@spectralogic.com]
Sent: Tuesday, December 09, 2014 1:48 AM
To: yocto@yoctoproject.org<mailto: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-bounces@yoctoproject.org<mailto:yocto-bounces@yoctoproject.org> [yocto-bounces@yoctoproject.org<mailto:yocto-bounces@yoctoproject.org>] on behalf of yocto-request@yoctoproject.org<mailto:yocto-request@yoctoproject.org> [yocto-request@yoctoproject.org<mailto:yocto-request@yoctoproject.org>]
Sent: Monday, December 08, 2014 2:56 AM
To: yocto@yoctoproject.org<mailto:yocto@yoctoproject.org>
Subject: yocto Digest, Vol 51, Issue 26
Send yocto mailing list submissions to
yocto@yoctoproject.org<mailto: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-request@yoctoproject.org<mailto:yocto-request@yoctoproject.org>
You can reach the person managing the list at
yocto-owner@yoctoproject.org<mailto:yocto-owner@yoctoproject.org>
When replying, please edit your Subject line so it is more specific than "Re: Contents of yocto digest..."
[-- Attachment #2: Type: text/html, Size: 10618 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building clang with Yocto
2014-12-10 3:24 ` Yu, Chan KitX
@ 2014-12-22 3:33 ` Yu, Chan KitX
2014-12-22 11:21 ` Paul Eggleton
2014-12-22 17:02 ` Jim Rafert
1 sibling, 1 reply; 14+ messages in thread
From: Yu, Chan KitX @ 2014-12-22 3:33 UTC (permalink / raw)
To: 'Liviu Gheorghisan', 'Jim Rafert',
'yocto@yoctoproject.org'
[-- Attachment #1: Type: text/plain, Size: 5399 bytes --]
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.gheorghisan@enea.com]
Sent: Wednesday, December 10, 2014 12:27 AM
To: Yu, Chan KitX; Jim Rafert; yocto@yoctoproject.org<mailto: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<mailto: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:jimr@spectralogic.com]
Sent: Tuesday, December 09, 2014 1:48 AM
To: yocto@yoctoproject.org<mailto: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-bounces@yoctoproject.org<mailto:yocto-bounces@yoctoproject.org> [yocto-bounces@yoctoproject.org<mailto:yocto-bounces@yoctoproject.org>] on behalf of yocto-request@yoctoproject.org<mailto:yocto-request@yoctoproject.org> [yocto-request@yoctoproject.org<mailto:yocto-request@yoctoproject.org>]
Sent: Monday, December 08, 2014 2:56 AM
To: yocto@yoctoproject.org<mailto:yocto@yoctoproject.org>
Subject: yocto Digest, Vol 51, Issue 26
Send yocto mailing list submissions to
yocto@yoctoproject.org<mailto: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-request@yoctoproject.org<mailto:yocto-request@yoctoproject.org>
You can reach the person managing the list at
yocto-owner@yoctoproject.org<mailto:yocto-owner@yoctoproject.org>
When replying, please edit your Subject line so it is more specific than "Re: Contents of yocto digest..."
[-- Attachment #2: Type: text/html, Size: 14197 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building clang with Yocto
2014-12-22 3:33 ` Yu, Chan KitX
@ 2014-12-22 11:21 ` Paul Eggleton
2014-12-23 8:21 ` Yu, Chan KitX
0 siblings, 1 reply; 14+ messages in thread
From: Paul Eggleton @ 2014-12-22 11:21 UTC (permalink / raw)
To: Yu, Chan KitX; +Cc: 'Jim Rafert', 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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building clang with Yocto
2014-12-10 3:24 ` Yu, Chan KitX
2014-12-22 3:33 ` Yu, Chan KitX
@ 2014-12-22 17:02 ` Jim Rafert
1 sibling, 0 replies; 14+ messages in thread
From: Jim Rafert @ 2014-12-22 17:02 UTC (permalink / raw)
To: Yu, Chan KitX, Liviu Gheorghisan, yocto@yoctoproject.org
[-- Attachment #1: Type: text/plain, Size: 4902 bytes --]
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.yu@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.gheorghisan@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.org<mailto: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:jimr@spectralogic.com]
Sent: Tuesday, December 09, 2014 1:48 AM
To: yocto@yoctoproject.org<mailto: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-bounces@yoctoproject.org<mailto:yocto-bounces@yoctoproject.org> [yocto-bounces@yoctoproject.org<mailto:yocto-bounces@yoctoproject.org>] on behalf of yocto-request@yoctoproject.org<mailto:yocto-request@yoctoproject.org> [yocto-request@yoctoproject.org<mailto:yocto-request@yoctoproject.org>]
Sent: Monday, December 08, 2014 2:56 AM
To: yocto@yoctoproject.org<mailto:yocto@yoctoproject.org>
Subject: yocto Digest, Vol 51, Issue 26
Send yocto mailing list submissions to
yocto@yoctoproject.org<mailto: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-request@yoctoproject.org<mailto:yocto-request@yoctoproject.org>
You can reach the person managing the list at
yocto-owner@yoctoproject.org<mailto:yocto-owner@yoctoproject.org>
When replying, please edit your Subject line so it is more specific than "Re: Contents of yocto digest..."
[-- Attachment #2: Type: text/html, Size: 9994 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building clang with Yocto
2014-12-22 11:21 ` Paul Eggleton
@ 2014-12-23 8:21 ` Yu, Chan KitX
2014-12-23 16:57 ` Jim Rafert
0 siblings, 1 reply; 14+ messages in thread
From: Yu, Chan KitX @ 2014-12-23 8:21 UTC (permalink / raw)
To: Paul Eggleton; +Cc: 'Jim Rafert', yocto@yoctoproject.org
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.eggleton@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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building clang with Yocto
2014-12-23 8:21 ` Yu, Chan KitX
@ 2014-12-23 16:57 ` Jim Rafert
2014-12-24 5:54 ` Yu, Chan KitX
0 siblings, 1 reply; 14+ messages in thread
From: Jim Rafert @ 2014-12-23 16:57 UTC (permalink / raw)
To: Yu, Chan KitX, Paul Eggleton; +Cc: yocto@yoctoproject.org
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 <arch><sub>-<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.yu@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.eggleton@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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Building clang with Yocto
2014-12-23 16:57 ` Jim Rafert
@ 2014-12-24 5:54 ` Yu, Chan KitX
0 siblings, 0 replies; 14+ messages in thread
From: Yu, Chan KitX @ 2014-12-24 5:54 UTC (permalink / raw)
To: Jim Rafert, Paul Eggleton; +Cc: yocto@yoctoproject.org
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:jimr@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 <arch><sub>-<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.yu@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.eggleton@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
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2014-12-24 5:54 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-08 17:48 Building clang with Yocto Jim Rafert
2014-12-09 1:19 ` Yu, Chan KitX
2014-12-09 16:06 ` Jim Rafert
2014-12-09 2:36 ` Yu, Chan KitX
2014-12-09 16:27 ` Liviu Gheorghisan
2014-12-09 16:47 ` Jim Rafert
2014-12-09 16:54 ` Liviu Gheorghisan
2014-12-10 3:24 ` Yu, Chan KitX
2014-12-22 3:33 ` Yu, Chan KitX
2014-12-22 11:21 ` Paul Eggleton
2014-12-23 8:21 ` Yu, Chan KitX
2014-12-23 16:57 ` Jim Rafert
2014-12-24 5:54 ` Yu, Chan KitX
2014-12-22 17:02 ` Jim Rafert
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.