* gold vs. CT_STATIC_TOOLCHAIN
@ 2011-12-02 13:25 Johannes Stezenbach
2011-12-13 17:23 ` Johannes Stezenbach
2011-12-14 0:09 ` Yann E. MORIN
0 siblings, 2 replies; 8+ messages in thread
From: Johannes Stezenbach @ 2011-12-02 13:25 UTC (permalink / raw)
To: crossgcc
Hi,
with CT_STATIC_TOOLCHAIN ./scripts/build/binutils/binutils.sh
adds -all-static to LDFLAGS. However, -all-static is a libtool
option and gold is not libtoolized. Maybe cg-ng should just
disable gold when CT_STATIC_TOOLCHAIN is selected?
Untested: (the 2nd and 3rd hunk are actually a seperate bugfix)
diff -r cf509170838f config/binutils/binutils.in
--- a/config/binutils/binutils.in Wed Nov 30 12:07:59 2011 +0100
+++ b/config/binutils/binutils.in Fri Dec 02 14:21:20 2011 +0100
@@ -101,6 +101,9 @@
config BINUTILS_FORCE_LD_BFD
bool
+config STATIC_TOOLCHAIN
+ select BINUTILS_FORCE_LD_BFD
+
choice
bool
prompt "Linkers to enable"
@@ -130,6 +133,7 @@
prompt "ld, gold"
depends on BINUTILS_HAS_GOLD
depends on BINUTILS_GOLD_SUPPORTS_ARCH
+ depends on ! BINUTILS_FORCE_LD_BFD
depends on EXPERIMENTAL
select BINUTILS_GOLD_INSTALLED
select BINUTILS_LINKER_BOTH
@@ -144,6 +148,7 @@
prompt "gold, ld"
depends on BINUTILS_HAS_GOLD
depends on BINUTILS_GOLD_SUPPORTS_ARCH
+ depends on ! BINUTILS_FORCE_LD_BFD
depends on EXPERIMENTAL
select BINUTILS_GOLD_INSTALLED
select BINUTILS_LINKER_BOTH
Johannes
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: gold vs. CT_STATIC_TOOLCHAIN
2011-12-02 13:25 gold vs. CT_STATIC_TOOLCHAIN Johannes Stezenbach
@ 2011-12-13 17:23 ` Johannes Stezenbach
2011-12-13 22:32 ` Yann E. MORIN
2011-12-14 0:09 ` Yann E. MORIN
1 sibling, 1 reply; 8+ messages in thread
From: Johannes Stezenbach @ 2011-12-13 17:23 UTC (permalink / raw)
To: crossgcc; +Cc: Yann E. MORIN
Hi,
On Fri, Dec 02, 2011 at 02:24:50PM +0100, Johannes Stezenbach wrote:
> with CT_STATIC_TOOLCHAIN ./scripts/build/binutils/binutils.sh
> adds -all-static to LDFLAGS. However, -all-static is a libtool
> option and gold is not libtoolized. Maybe cg-ng should just
> disable gold when CT_STATIC_TOOLCHAIN is selected?
>
> Untested: (the 2nd and 3rd hunk are actually a seperate bugfix)
any comments on this? I could send clean, tested patches but I won't
spend my time if no one is interested.
Johannes
> diff -r cf509170838f config/binutils/binutils.in
> --- a/config/binutils/binutils.in Wed Nov 30 12:07:59 2011 +0100
> +++ b/config/binutils/binutils.in Fri Dec 02 14:21:20 2011 +0100
> @@ -101,6 +101,9 @@
> config BINUTILS_FORCE_LD_BFD
> bool
>
> +config STATIC_TOOLCHAIN
> + select BINUTILS_FORCE_LD_BFD
> +
> choice
> bool
> prompt "Linkers to enable"
> @@ -130,6 +133,7 @@
> prompt "ld, gold"
> depends on BINUTILS_HAS_GOLD
> depends on BINUTILS_GOLD_SUPPORTS_ARCH
> + depends on ! BINUTILS_FORCE_LD_BFD
> depends on EXPERIMENTAL
> select BINUTILS_GOLD_INSTALLED
> select BINUTILS_LINKER_BOTH
> @@ -144,6 +148,7 @@
> prompt "gold, ld"
> depends on BINUTILS_HAS_GOLD
> depends on BINUTILS_GOLD_SUPPORTS_ARCH
> + depends on ! BINUTILS_FORCE_LD_BFD
> depends on EXPERIMENTAL
> select BINUTILS_GOLD_INSTALLED
> select BINUTILS_LINKER_BOTH
>
>
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: gold vs. CT_STATIC_TOOLCHAIN
2011-12-13 17:23 ` Johannes Stezenbach
@ 2011-12-13 22:32 ` Yann E. MORIN
0 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2011-12-13 22:32 UTC (permalink / raw)
To: crossgcc; +Cc: Johannes Stezenbach
Johannes, All,
On Tuesday 13 December 2011 18:23:35 Johannes Stezenbach wrote:
> On Fri, Dec 02, 2011 at 02:24:50PM +0100, Johannes Stezenbach wrote:
> > with CT_STATIC_TOOLCHAIN ./scripts/build/binutils/binutils.sh
> > adds -all-static to LDFLAGS. However, -all-static is a libtool
> > option and gold is not libtoolized. Maybe cg-ng should just
> > disable gold when CT_STATIC_TOOLCHAIN is selected?
> >
> > Untested: (the 2nd and 3rd hunk are actually a seperate bugfix)
>
> any comments on this? I could send clean, tested patches but I won't
> spend my time if no one is interested.
I'm looking at it. Sorry for the delay...
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: gold vs. CT_STATIC_TOOLCHAIN
2011-12-02 13:25 gold vs. CT_STATIC_TOOLCHAIN Johannes Stezenbach
2011-12-13 17:23 ` Johannes Stezenbach
@ 2011-12-14 0:09 ` Yann E. MORIN
2011-12-14 11:15 ` Johannes Stezenbach
1 sibling, 1 reply; 8+ messages in thread
From: Yann E. MORIN @ 2011-12-14 0:09 UTC (permalink / raw)
To: crossgcc; +Cc: Johannes Stezenbach
Johannes, All,
On Friday 02 December 2011 14:24:50 Johannes Stezenbach wrote:
> with CT_STATIC_TOOLCHAIN ./scripts/build/binutils/binutils.sh
> adds -all-static to LDFLAGS. However, -all-static is a libtool
> option and gold is not libtoolized. Maybe cg-ng should just
> disable gold when CT_STATIC_TOOLCHAIN is selected?
It works here for me:
$ file bin/armeb-unknown-linux-uclibcgnueabi-ld.gold
bin/armeb-unknown-linux-uclibcgnueabi-ld.gold: ELF 64-bit LSB executable,
x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.18,
not stripped
So, it is a statically-linked executable, exactly what we wanted.
How does it break for you?
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: gold vs. CT_STATIC_TOOLCHAIN
2011-12-14 0:09 ` Yann E. MORIN
@ 2011-12-14 11:15 ` Johannes Stezenbach
2011-12-14 11:43 ` Johannes Stezenbach
0 siblings, 1 reply; 8+ messages in thread
From: Johannes Stezenbach @ 2011-12-14 11:15 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: crossgcc
On Wed, Dec 14, 2011 at 01:09:21AM +0100, Yann E. MORIN wrote:
> Johannes, All,
>
> On Friday 02 December 2011 14:24:50 Johannes Stezenbach wrote:
> > with CT_STATIC_TOOLCHAIN ./scripts/build/binutils/binutils.sh
> > adds -all-static to LDFLAGS. However, -all-static is a libtool
> > option and gold is not libtoolized. Maybe cg-ng should just
> > disable gold when CT_STATIC_TOOLCHAIN is selected?
>
> It works here for me:
>
> $ file bin/armeb-unknown-linux-uclibcgnueabi-ld.gold
> bin/armeb-unknown-linux-uclibcgnueabi-ld.gold: ELF 64-bit LSB executable,
> x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.18,
> not stripped
>
> So, it is a statically-linked executable, exactly what we wanted.
>
> How does it break for you?
I didn't save the log so I'd have to rebuild to find out
(which I'll do asap), but IIRC it was similar to
$ gcc foo.c -all-static
gcc: error: unrecognized option â-all-staticâ
In case it matters, I used the newest available binutils,
(IIRC binutils-2.21.53 in ct-ng-1.13.2, and now 2.22
with ct-ng from hg.
Thanks
Johannes
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: gold vs. CT_STATIC_TOOLCHAIN
2011-12-14 11:15 ` Johannes Stezenbach
@ 2011-12-14 11:43 ` Johannes Stezenbach
2012-01-16 23:22 ` Yann E. MORIN
0 siblings, 1 reply; 8+ messages in thread
From: Johannes Stezenbach @ 2011-12-14 11:43 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: crossgcc
On Wed, Dec 14, 2011 at 12:15:25PM +0100, Johannes Stezenbach wrote:
> On Wed, Dec 14, 2011 at 01:09:21AM +0100, Yann E. MORIN wrote:
> > On Friday 02 December 2011 14:24:50 Johannes Stezenbach wrote:
> > > with CT_STATIC_TOOLCHAIN ./scripts/build/binutils/binutils.sh
> > > adds -all-static to LDFLAGS. However, -all-static is a libtool
> > > option and gold is not libtoolized. Maybe cg-ng should just
> > > disable gold when CT_STATIC_TOOLCHAIN is selected?
> >
> > It works here for me:
> >
> > $ file bin/armeb-unknown-linux-uclibcgnueabi-ld.gold
> > bin/armeb-unknown-linux-uclibcgnueabi-ld.gold: ELF 64-bit LSB executable,
> > x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.18,
> > not stripped
> >
> > So, it is a statically-linked executable, exactly what we wanted.
> >
> > How does it break for you?
>
> I didn't save the log so I'd have to rebuild to find out
Here we go:
[INFO ] Installing binutils
[EXTRA] Configuring binutils
[EXTRA] Prepare binutils for static build
[EXTRA] Building binutils
[ERROR] g++: error: unrecognized option '-all-static'
[ERROR] make[5]: *** [ld-new] Error 1
[ALL ] i686-build_pc-linux-gnu-ar cru libgold.a archive.o attributes.o binary.o common.o compressed_output.o copy-relocs.o cref.o defstd.o descriptors.o dirsearch.o dynobj.o dwarf_reader.o ehframe.o errors.o expression.o fileread.o gc.o gold.o gold-threads.o icf.o incremental.o int_encoding.o layout.o mapfile.o merge.o object.o options.o output.o parameters.o plugin.o readsyms.o reduced_debug_output.o reloc.o resolve.o script-sections.o script.o stringpool.o symtab.o target.o target-select.o timer.o version.o workqueue.o workqueue-threads.o yyscript.o
[ALL ] i686-build_pc-linux-gnu-ranlib libgold.a
[ALL ] mv -f .deps/arm.Tpo .deps/arm.Po
[ALL ] i686-build_pc-linux-gnu-g++ -W -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -frandom-seed=ld-new -pipe -static -all-static -o ld-new main.o i386.o x86_64.o sparc.o powerpc.o arm.o arm-reloc-property.o libgold.a ../libiberty/libiberty.a -lz
[ALL ] i686-build_pc-linux-gnu-g++ -W -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -frandom-seed=incremental-dump -pipe -static -all-static -o incremental-dump incremental-dump.o i386.o x86_64.o sparc.o powerpc.o arm.o arm-reloc-property.o libgold.a ../libiberty/libiberty.a -lz
[ERROR] g++: error: unrecognized option '-all-static'
[ERROR] make[5]: *** [ld-new] Error 1
[ALL ] make[5]: *** Waiting for unfinished jobs....
[ERROR] g++: error: unrecognized option '-all-static'
[ERROR] make[5]: *** [incremental-dump] Error 1
This happens both with CT_BINUTILS_LINKERS_LIST="gold" and "ld,gold".
Oh, and my host gcc is "gcc version 4.6.2 (Debian 4.6.2-7)",
binutils are "GNU ld (GNU Binutils for Debian) 2.22".
(I'm using Debian sid).
Thanks
Johannes
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: gold vs. CT_STATIC_TOOLCHAIN
2011-12-14 11:43 ` Johannes Stezenbach
@ 2012-01-16 23:22 ` Yann E. MORIN
2012-01-18 12:01 ` Johannes Stezenbach
0 siblings, 1 reply; 8+ messages in thread
From: Yann E. MORIN @ 2012-01-16 23:22 UTC (permalink / raw)
To: crossgcc; +Cc: Johannes Stezenbach
Johannes, All,
Sorry for the delay, important stuff to attend IRL... :-/
On Wednesday 14 December 2011 12:43:06 Johannes Stezenbach wrote:
> [INFO ] Installing binutils
> [EXTRA] Configuring binutils
> [EXTRA] Prepare binutils for static build
> [EXTRA] Building binutils
> [ERROR] g++: error: unrecognized option '-all-static'
> [ERROR] make[5]: *** [ld-new] Error 1
[--SNIP--]
> This happens both with CT_BINUTILS_LINKERS_LIST="gold" and "ld,gold".
>
> Oh, and my host gcc is "gcc version 4.6.2 (Debian 4.6.2-7)",
> binutils are "GNU ld (GNU Binutils for Debian) 2.22".
> (I'm using Debian sid).
Ah, I see why I don't have the issue. I'm using squeeze, and that has
gcc 4.4.5 and binutils 2.20.1.
Now, with respect to your initial patch... Your proposal was to disable gold
when building a static toolchain. I'd rather that we fix gold static build.
Unless someone beats me to it, I'll look at fixining this...
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: gold vs. CT_STATIC_TOOLCHAIN
2012-01-16 23:22 ` Yann E. MORIN
@ 2012-01-18 12:01 ` Johannes Stezenbach
0 siblings, 0 replies; 8+ messages in thread
From: Johannes Stezenbach @ 2012-01-18 12:01 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: crossgcc
Hi Yann,
On Tue, Jan 17, 2012 at 12:22:31AM +0100, Yann E. MORIN wrote:
> Sorry for the delay, important stuff to attend IRL... :-/
No problem, I was only worried because your email bounced.
Is anciens.enib.fr gone for good?
> On Wednesday 14 December 2011 12:43:06 Johannes Stezenbach wrote:
> > [INFO ] Installing binutils
> > [EXTRA] Configuring binutils
> > [EXTRA] Prepare binutils for static build
> > [EXTRA] Building binutils
> > [ERROR] g++: error: unrecognized option '-all-static'
> > [ERROR] make[5]: *** [ld-new] Error 1
> [--SNIP--]
> > This happens both with CT_BINUTILS_LINKERS_LIST="gold" and "ld,gold".
> >
> > Oh, and my host gcc is "gcc version 4.6.2 (Debian 4.6.2-7)",
> > binutils are "GNU ld (GNU Binutils for Debian) 2.22".
> > (I'm using Debian sid).
>
> Ah, I see why I don't have the issue. I'm using squeeze, and that has
> gcc 4.4.5 and binutils 2.20.1.
>
> Now, with respect to your initial patch... Your proposal was to disable gold
> when building a static toolchain. I'd rather that we fix gold static build.
>
> Unless someone beats me to it, I'll look at fixining this...
sid also has "gcc-4.4 (Debian 4.4.6-14) 4.4.6" but it also does not
support -all-static (which makes sense because it is a libtool option).
A few lines from my build log, maybe you can check what is different
for you:
[INFO ] Installing binutils
[EXTRA] Configuring binutils
[DEBUG] Extra config passed: '--enable-ld=no --enable-gold=yes --with-pkgversion=crosstool-NG hg+unknown-20120113.153456 - pxlw-201111 --disable-nls'
[DEBUG] ==> Executing: 'CFLAGS= -pipe ' 'CXXFLAGS= -pipe ' '/home/js/toolchain-v2/build/.build/src/binutils-2.22/configure' '--build=i686-build_pc-linux-gnu' '--host=i686-build_pc-linux-gnu' '--target=arm-unknown-linux-uclibcgnueabi' '--prefix=/tmp/tc/arm-unknown-linux-uclibcgnueabi' '--disable-multilib' '--disable-werror' '--enable-ld=no' '--enable-gold=yes' '--with-pkgversion=crosstool-NG hg+unknown-20120113.153456 - pxlw-201111' '--disable-nls' '--with-float=soft' '--with-sysroot=/tmp/tc/arm-unknown-linux-uclibcgnueabi/arm-unknown-linux-uclibcgnueabi/sysroot'
[EXTRA] Building binutils
[DEBUG] ==> Executing: 'make' 'LDFLAGS=-static -all-static' '-j5'
[ALL ] /bin/bash ./libtool --tag=CC --mode=link i686-build_pc-linux-gnu-gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -pipe -rpath /tmp/tc/arm-unknown-linux-uclibcgnueabi/i686-build_pc-linux-gnu/arm-unknown-linux-uclibcgnueabi/lib -release `cat ../bfd/libtool-soversion` -static -all-static -o libopcodes.la dis-buf.lo disassemble.lo dis-init.lo arm-dis.lo
[ALL ] libtool: link: i686-build_pc-linux-gnu-ar cru .libs/libopcodes.a dis-buf.o disassemble.o dis-init.o arm-dis.o
[ALL ] libtool: link: i686-build_pc-linux-gnu-ranlib .libs/libopcodes.a
[ALL ] libtool: link: ( cd ".libs" && rm -f "libopcodes.la" && ln -s "../libopcodes.la" "libopcodes.la" )
[ALL ] libtooldir=`/bin/bash ./libtool --config | sed -n -e 's/^objdir=//p'`; if [ -f $libtooldir/libopcodes.a ]; then
cp $libtooldir/libopcodes.a libopcodes.tmp; i686-build_pc-linux-gnu-ranlib libopcodes.tmp; /bin/bash /home/js/toolchain-v2/build/.build/src/binutils-2.22/opcodes/../move-if-change libopcodes.tmp libopcodes.a; else true; fi
[ALL ] i686-build_pc-linux-gnu-ar cru libgold.a archive.o attributes.o binary.o common.o compressed_output.o copy-relocs.o cref.o defstd.o descriptors.o dirsearch.o dynobj.o dwarf_reader.o ehframe.o errors.o expression.o fileread.o gc.o gold.o gold-threads.o icf.o incremental.o int_encoding.o layout.o mapfile.o merge.o object.o options.o output.o parameters.o plugin.o readsyms.o reduced_debug_output.o reloc.o resolve.o script-sections.o script.o stringpool.o symtab.o target.o target-select.o timer.o version.o workqueue.o workqueue-threads.o yyscript.o
[ALL ] i686-build_pc-linux-gnu-ranlib libgold.a
[ALL ] i686-build_pc-linux-gnu-g++ -W -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -frandom-seed=ld-new -pipe -static -all-static -o ld-new main.o i386.o x86_64.o sparc.o powerpc.o arm.o arm-reloc-property.o libgold.a ../libiberty/libiberty.a -lz
[ERROR] g++: error: unrecognized option '-all-static'
The difference for gold is that libtool is not used. The easiest fix would be
to patch the gold Makefile to filter out the -all-static. Or maybe gold
can be libtoolized. But first I would be interested to understand why this builds for you.
Thanks
Johannes
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-01-18 12:01 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-02 13:25 gold vs. CT_STATIC_TOOLCHAIN Johannes Stezenbach
2011-12-13 17:23 ` Johannes Stezenbach
2011-12-13 22:32 ` Yann E. MORIN
2011-12-14 0:09 ` Yann E. MORIN
2011-12-14 11:15 ` Johannes Stezenbach
2011-12-14 11:43 ` Johannes Stezenbach
2012-01-16 23:22 ` Yann E. MORIN
2012-01-18 12:01 ` Johannes Stezenbach
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).