* binutils build failed when CT_STATIC_TOOLCHAIN is enabled
@ 2014-06-18 7:48 brock.zheng
0 siblings, 0 replies; 2+ messages in thread
From: brock.zheng @ 2014-06-18 7:48 UTC (permalink / raw)
To: crossgcc maillist
[-- Attachment #1: Type: text/plain, Size: 1781 bytes --]
Hi, all
I want a static toolchain (to copy and use it anywhere).
But failed when build the binutils:
ct-ng binutils_for_host:
It need flex static libs. On my machine, flex only has shared libs, so I
tried to build a static lib manually (Why not include the flex in the "Companion tools"?)
After that step, binutils keeps failed to built:
It has something to do with libtool. I spend some time to find the root cause, and here is
my discovering:
The cmdline to build the ranlib is:
/bin/sh ./libtool --tag=CC --mode=link ../../../buildtools/bin/x86_64-build_unknown-linux-gnu-gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -O2 -g -pipe -static-libstdc++ -static-libgcc -static -all-static -o ranlib ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o ../bfd/libbfd.la ../libiberty/libiberty.a -lfl -lz
The -lfl is expanded to /usr/lib/libfl.so, so the linker complain that.
I have checked the libtool script, and found that the following option
-all-static
-static
-static-libtool-libs
is processed in a strange way. If any one of those three option appears firstly in the cmdline, all others
will be neglected. Our LDFLAGS is ".... -static -all-static -o", so the -static option takes the real effect,
and the -all-static has no useage actually! that is the cause of the failure.
I have changed the /usr/lib/ct-ng.hg+default-99029fac116b/scripts/build/binutils/binutils.sh
line 223:
extra_make_flags+=("LDFLAGS=-static -all-static")
to
extra_make_flags+=("LDFLAGS=-all-static -static")
And the binutils built OK.
The patch is attached for the maintainer for reference.
Thanks for all the maintainers and hackers!
[-- Attachment #2: binutils.sh.patch --]
[-- Type: text/x-diff, Size: 558 bytes --]
diff -r 99029fac116b scripts/build/binutils/binutils.sh
--- a/scripts/build/binutils/binutils.sh Mon May 12 00:09:31 2014 +0200
+++ b/scripts/build/binutils/binutils.sh Wed Jun 18 15:47:16 2014 +0800
@@ -220,7 +220,7 @@
"${CT_BINUTILS_EXTRA_CONFIG_ARRAY[@]}"
if [ "${static_build}" = "y" ]; then
- extra_make_flags+=("LDFLAGS=-static -all-static")
+ extra_make_flags+=("LDFLAGS=-all-static -static")
CT_DoLog EXTRA "Prepare binutils for static build"
CT_DoExecLog ALL make ${JOBSFLAGS} configure-host
fi
[-- Attachment #3: Type: text/plain, Size: 71 bytes --]
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 2+ messages in thread
* binutils build failed when CT_STATIC_TOOLCHAIN is enabled
@ 2014-06-18 7:48 goodmenlinux
0 siblings, 0 replies; 2+ messages in thread
From: goodmenlinux @ 2014-06-18 7:48 UTC (permalink / raw)
To: crossgcc maillist
[-- Attachment #1: Type: text/plain, Size: 1781 bytes --]
Hi, all
I want a static toolchain (to copy and use it anywhere).
But failed when build the binutils:
ct-ng binutils_for_host:
It need flex static libs. On my machine, flex only has shared libs, so I
tried to build a static lib manually (Why not include the flex in the "Companion tools"?)
After that step, binutils keeps failed to built:
It has something to do with libtool. I spend some time to find the root cause, and here is
my discovering:
The cmdline to build the ranlib is:
/bin/sh ./libtool --tag=CC --mode=link ../../../buildtools/bin/x86_64-build_unknown-linux-gnu-gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -O2 -g -pipe -static-libstdc++ -static-libgcc -static -all-static -o ranlib ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o ../bfd/libbfd.la ../libiberty/libiberty.a -lfl -lz
The -lfl is expanded to /usr/lib/libfl.so, so the linker complain that.
I have checked the libtool script, and found that the following option
-all-static
-static
-static-libtool-libs
is processed in a strange way. If any one of those three option appears firstly in the cmdline, all others
will be neglected. Our LDFLAGS is ".... -static -all-static -o", so the -static option takes the real effect,
and the -all-static has no useage actually! that is the cause of the failure.
I have changed the /usr/lib/ct-ng.hg+default-99029fac116b/scripts/build/binutils/binutils.sh
line 223:
extra_make_flags+=("LDFLAGS=-static -all-static")
to
extra_make_flags+=("LDFLAGS=-all-static -static")
And the binutils built OK.
The patch is attached for the maintainer for reference.
Thanks for all the maintainers and hackers!
[-- Attachment #2: binutils.sh.patch --]
[-- Type: text/x-diff, Size: 558 bytes --]
diff -r 99029fac116b scripts/build/binutils/binutils.sh
--- a/scripts/build/binutils/binutils.sh Mon May 12 00:09:31 2014 +0200
+++ b/scripts/build/binutils/binutils.sh Wed Jun 18 15:47:16 2014 +0800
@@ -220,7 +220,7 @@
"${CT_BINUTILS_EXTRA_CONFIG_ARRAY[@]}"
if [ "${static_build}" = "y" ]; then
- extra_make_flags+=("LDFLAGS=-static -all-static")
+ extra_make_flags+=("LDFLAGS=-all-static -static")
CT_DoLog EXTRA "Prepare binutils for static build"
CT_DoExecLog ALL make ${JOBSFLAGS} configure-host
fi
[-- Attachment #3: Type: text/plain, Size: 71 bytes --]
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-06-18 7:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-18 7:48 binutils build failed when CT_STATIC_TOOLCHAIN is enabled brock.zheng
2014-06-18 7:48 goodmenlinux
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).