external toolchain --sysroot
Hi Thomas,
Firstly:
The external toolchain --sysroot change in CFLAGS has broken my builds. (I only just merged into into my tree and tried it, so sorry for the delayed feedback).
configure scripts are failing to compile any test program, with the error:
configure:2909: checking for C compiler default output file name
configure:2936: /home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/bin/armeb-linux-uclibcgnu-gcc -Os -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/include -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/include -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/armeb-linux-uclibcgnu/include --sysroot /home/hamish/work/xyz/buildroot/build_armeb/staging_dir/ -Os -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/include -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/include -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/armeb-linux-uclibcgnu/include --sysroot /home/hamish/work/xyz/buildroot/build_armeb/staging_dir/ -L/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib -L/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/lib conftest.c >&5 /home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/bin/armeb-linux-uclibcgnu-ld: cannot find /home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libc.so.0 inside /home/hamish/work/xyz/buildroot/build_armeb/staging_dir/
collect2: ld returned 1 exit status
configure:2939: $? = 1
The library does exist at that location, I guess it doesn't like the combination of the sysroot and the full path in -L.../lib.
[ 2:49PM] hamish at bach:work/xyz/buildroot $ ls -l /home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libc.so.0 lrwxrwxrwx 1 hamish hamish 19 2008-11-10 17:15 /home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libc.so.0 -> libuClibc-0.9.29.so
[ 2:54PM] hamish at bach:work/xyz/buildroot $ ls -l /home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libuClibc-0.9.29.so -rw-r--r-- 1 hamish hamish 293315 2008-11-10 17:15 /home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libuClibc-0.9.29.so
My gcc is 4.1.2. This might work with newer versions.
I removed the --sysroot in package/Makefile.in and it works again.
What is the purpose of using the --sysroot flag? It's used even if gcc is configured without it.
Secondly:
The change to toolchain/external-toolchain/ext-tool.mk seems to copy the sysroot into $(STAGING_DIR) as a side-effect of copying the libs to the $(TARGET_DIR), not as an explicit dependency.
And in my case, the sysroot IS the $(STAGING_DIR)... but my gcc is not configured with sysroot so it doesn't do any copying anyway.
I did a fresh checkout of my tree and built the toolchain and then my board, and it failed as above. gcc has a hardcoded path to libc in it, so it doesn't expect to get --sysroot as well.
Hamish
Signature · 1 line
Hamish Moffatt VK3SB <[email protected]> <[email protected]>
I had to change it to be --sysroot= and then sysroot support works.
Eric
Quoted 69 lines · Hamish Moffatt
Hi Thomas,
Firstly:
The external toolchain --sysroot change in CFLAGS has broken my builds. (I only just merged into into my tree and tried it, so sorry for the delayed feedback).
configure scripts are failing to compile any test program, with the error:
configure:2909: checking for C compiler default output file name configure:2936:
/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/bin/armeb-linux-uclibcgnu-gcc(quoted diff) +0
-8-Os -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/include -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/include -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/armeb-linux-uclibcgnu/include --sysroot /home/hamish/work/xyz/buildroot/build_armeb/staging_dir/ -Os -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/include -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/include -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/armeb-linux-uclibcgnu/include --sysroot /home/hamish/work/xyz/buildroot/build_armeb/staging_dir/ -L/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib -L/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/lib conftest.c >&5
/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/bin/armeb-linux-uclibcgnu-ld:
cannot find/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libc.so.0inside/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/
collect2: ld returned 1 exit status
configure:2939: $? = 1The library does exist at that location, I guess it doesn't like the combination of the sysroot and the full path in -L.../lib.
[ 2:49PM] hamish at bach:work/xyz/buildroot $ ls -l
/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libc.so.0lrwxrwxrwx 1 hamish hamish 19 2008-11-10 17:15/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libc.so.0-> libuClibc-0.9.29.so <http://libuclibc-0.9.29.so/>[ 2:54PM] hamish at bach:work/xyz/buildroot $ ls -l
/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libuClibc-0.9.29.so <http://libuclibc-0.9.29.so/>
-rw-r--r-- 1 hamish hamish 293315 2008-11-10 17:15/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libuClibc-0.9.29.so <http://libuclibc-0.9.29.so/>My gcc is 4.1.2. This might work with newer versions.
I removed the --sysroot in package/Makefile.in and it works again.
What is the purpose of using the --sysroot flag? It's used even if gcc is configured without it.
Secondly:
The change to
toolchain/external-toolchain/ext-tool.mkseems to copy the sysroot into $(STAGING_DIR) as a side-effect of copying the libs to the $(TARGET_DIR), not as an explicit dependency.And in my case, the sysroot IS the $(STAGING_DIR)... but my gcc is not configured with sysroot so it doesn't do any copying anyway.
I did a fresh checkout of my tree and built the toolchain and then my board, and it failed as above. gcc has a hardcoded path to libc in it, so it doesn't expect to get --sysroot as well.
Quoted 8 lines
Hamish
--
Hamish Moffatt VK3SB <[email protected]> <[email protected]>
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/buildroot/attachments/20090112/266c5cd2/attachment.htm
I have had to patch a few other .mk files to work properly .. I can submit those as I get a chance .. util-linux is one that needed work.
Eric
Quoted 75 lines · Eric
I had to change it to be --sysroot= and then sysroot support works.
Eric
Quoted 69 lines · Hamish Moffatt
Hi Thomas,
Firstly:
The external toolchain --sysroot change in CFLAGS has broken my builds. (I only just merged into into my tree and tried it, so sorry for the delayed feedback).
configure scripts are failing to compile any test program, with the error:
configure:2909: checking for C compiler default output file name configure:2936:
/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/bin/armeb-linux-uclibcgnu-gcc(quoted diff) +0
-8-Os -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/include -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/include -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/armeb-linux-uclibcgnu/include --sysroot /home/hamish/work/xyz/buildroot/build_armeb/staging_dir/ -Os -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/include -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/include -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/armeb-linux-uclibcgnu/include --sysroot /home/hamish/work/xyz/buildroot/build_armeb/staging_dir/ -L/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib -L/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/lib conftest.c >&5
/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/bin/armeb-linux-uclibcgnu-ld:
cannot find/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libc.so.0inside/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/
collect2: ld returned 1 exit status
configure:2939: $? = 1The library does exist at that location, I guess it doesn't like the combination of the sysroot and the full path in -L.../lib.
[ 2:49PM] hamish at bach:work/xyz/buildroot $ ls -l
/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libc.so.0lrwxrwxrwx 1 hamish hamish 19 2008-11-10 17:15/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libc.so.0-> libuClibc-0.9.29.so <http://libuclibc-0.9.29.so/>[ 2:54PM] hamish at bach:work/xyz/buildroot $ ls -l
/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libuClibc-0.9.29.so <http://libuclibc-0.9.29.so/>
-rw-r--r-- 1 hamish hamish 293315 2008-11-10 17:15/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libuClibc-0.9.29.so <http://libuclibc-0.9.29.so/>My gcc is 4.1.2. This might work with newer versions.
I removed the --sysroot in package/Makefile.in and it works again.
What is the purpose of using the --sysroot flag? It's used even if gcc is configured without it.
Secondly:
The change to
toolchain/external-toolchain/ext-tool.mkseems to copy the sysroot into $(STAGING_DIR) as a side-effect of copying the libs to the $(TARGET_DIR), not as an explicit dependency.And in my case, the sysroot IS the $(STAGING_DIR)... but my gcc is not configured with sysroot so it doesn't do any copying anyway.
I did a fresh checkout of my tree and built the toolchain and then my board, and it failed as above. gcc has a hardcoded path to libc in it, so it doesn't expect to get --sysroot as well.
Quoted 10 lines
Quoted 8 lines
Hamish
--
Hamish Moffatt VK3SB <[email protected]> <[email protected]>
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/buildroot/attachments/20090112/c5fe5f46/attachment-0001.htm
Also I did build my tool chain with sysroot support ... so you would have to do the same to get that to work.
Eric
Quoted 93 lines · Eric
I have had to patch a few other .mk files to work properly .. I can submit those as I get a chance .. util-linux is one that needed work.
Eric
Quoted 85 lines · Eric
I had to change it to be --sysroot= and then sysroot support works.
Eric
Quoted 77 lines · Hamish Moffatt
Hi Thomas,
Firstly:
The external toolchain --sysroot change in CFLAGS has broken my builds. (I only just merged into into my tree and tried it, so sorry for the delayed feedback).
configure scripts are failing to compile any test program, with the error:
configure:2909: checking for C compiler default output file name configure:2936:
/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/bin/armeb-linux-uclibcgnu-gcc(quoted diff) +0
-8-Os -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/include -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/include -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/armeb-linux-uclibcgnu/include --sysroot /home/hamish/work/xyz/buildroot/build_armeb/staging_dir/ -Os -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/include -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/include -I/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/armeb-linux-uclibcgnu/include --sysroot /home/hamish/work/xyz/buildroot/build_armeb/staging_dir/ -L/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib -L/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/lib conftest.c >&5
/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/usr/bin/armeb-linux-uclibcgnu-ld:
cannot find/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libc.so.0inside/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/
collect2: ld returned 1 exit status
configure:2939: $? = 1The library does exist at that location, I guess it doesn't like the combination of the sysroot and the full path in -L.../lib.
[ 2:49PM] hamish at bach:work/xyz/buildroot $ ls -l
/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libc.so.0lrwxrwxrwx 1 hamish hamish 19 2008-11-10 17:15/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libc.so.0-> libuClibc-0.9.29.so <http://libuclibc-0.9.29.so/>[ 2:54PM] hamish at bach:work/xyz/buildroot $ ls -l
/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libuClibc-0.9.29.so <http://libuclibc-0.9.29.so/>
-rw-r--r-- 1 hamish hamish 293315 2008-11-10 17:15/home/hamish/work/xyz/buildroot/build_armeb/staging_dir/lib/libuClibc-0.9.29.so <http://libuclibc-0.9.29.so/>My gcc is 4.1.2. This might work with newer versions.
I removed the --sysroot in package/Makefile.in and it works again.
What is the purpose of using the --sysroot flag? It's used even if gcc is configured without it.
Secondly:
The change to
toolchain/external-toolchain/ext-tool.mkseems to copy the sysroot into $(STAGING_DIR) as a side-effect of copying the libs to the $(TARGET_DIR), not as an explicit dependency.And in my case, the sysroot IS the $(STAGING_DIR)... but my gcc is not configured with sysroot so it doesn't do any copying anyway.
I did a fresh checkout of my tree and built the toolchain and then my board, and it failed as above. gcc has a hardcoded path to libc in it, so it doesn't expect to get --sysroot as well.
Hamish
--
Hamish Moffatt VK3SB <[email protected]> <[email protected]>
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/buildroot/attachments/20090112/71673478/attachment.htm
Quoted 2 lines · Eric
Also I did build my tool chain with sysroot support ... so you would have to do the same to get that to work.
Right. I notice that --sysroot is being used even if gcc is compiled without it. And it appears that sysroot is buggy in gcc 4.1.2, which is what I'm using currently.
Hamish
Signature · 1 line
Hamish Moffatt VK3SB <[email protected]> <[email protected]>
I submitted a change to ext-tool.mk that should now check if your toolchain is built with sysroot support and if it is do the copying and if it is not then don't. I have tested by building my buildroot with ELDK4.0 (no sysroot support) and my own toolchain (With Sysroot) and they both work.
However do you mean we pass --sysroot= in both cases as well?
In which case a similar fix to the one I made to ext-tool.mk should be used to decide whether to add --sysroot=....
What do you think?
Cheers
Dan laird
-----Original Message-----
From: [email protected] [mailto:buildroot-bounces at busybox.net] On Behalf Of Hamish Moffatt
Sent: 2009 Jan 13 23:12
To: buildroot at busybox.net; buildroot at uclibc.org
Subject: Re: [Buildroot] external toolchain --sysroot
Quoted 2 lines · Eric
Also I did build my tool chain with sysroot support ... so you would have to do the same to get that to work.
Right. I notice that --sysroot is being used even if gcc is compiled without it. And it appears that sysroot is buggy in gcc 4.1.2, which is what I'm using currently.
Hamish
Signature · 5 lines
Hamish Moffatt VK3SB <[email protected]> <[email protected]> _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Quoted 3 lines · Hamish Moffatt
Right. I notice that --sysroot is being used even if gcc is compiled without it. And it appears that sysroot is buggy in gcc 4.1.2, which is what I'm using currently.
The whole gcc-4.1.x series is discontinued and not maintained anymore. You would be better off to use a somewhat current toolchain or at least avoid versions that are known to be broken (like sysroot and 4.1.x). Sysroot support is deliberately marked as unavailable for anything older than the 4.2.x series for good reasons -- see toolchain/gcc/Config.in
Quoted 11 lines · Bernhard Reutner-Fischer
Quoted 3 lines · Hamish Moffatt
Right. I notice that --sysroot is being used even if gcc is compiled without it. And it appears that sysroot is buggy in gcc 4.1.2, which is what I'm using currently.
The whole gcc-4.1.x series is discontinued and not maintained anymore. You would be better off to use a somewhat current toolchain or at least avoid versions that are known to be broken (like sysroot and 4.1.x). Sysroot support is deliberately marked as unavailable for anything older than the 4.2.x series for good reasons -- see toolchain/gcc/Config.in
Yes it is, but package/Makefile.in doesn't use that setting, but uses --sysroot regardless for the external toolchain.
Anyway, gcc 4.3.2 / armeb / EABI seems to build. When I first started with buildroot I couldn't get anything better than 4.1.2 / OABI to build, so I stuck with it. Mind you, I couldn't build anything else after the toolchain - still need to debug that.
Hamish
Signature · 1 line
Hamish Moffatt VK3SB <[email protected]> <[email protected]>