wanted: entirely self-contained cross tool chain (no ldd references to /lib/libdl.so.2 etc)
Roman Duka
rduka@mail.ru
Tue Dec 16 00:26:00 GMT 2003
Ken Wolcott wrote:
> I'm a build engineer, tasked to make certain that the tool chain, checked into
> to ClearCase, can be used on various Linux machines whose library versions
> might differ (Red Hat 8, Red Hat 9, Gentoo, Mandrake, Debian, etc). We want
> the tool chain to be entirely static.
>
> On Monday 15 December 2003 18:13, Roman Duka wrote:
>
>>Ken Wolcott wrote:
>>
>>>Hi;
>>>
>>> I'm still unable to generate a cross tool chain that is entirely
>>>self-contained, ie: no references to /lib/libdl.so.2 or
>>>/lib/i686/libc.so.6 or anything like that.
>>>
>>>I have changed crosstool.sh so that binutils make and the final gcc build
>>>make calls have
>>>
>>>LDFLAGS="-static"
>>>
>>>but that apparently isn't sufficient. How to make ld static?
>>>
>>>
>>>arm-arm9-linux-gnu-addr2line
>>> libdl.so.2 => /lib/libdl.so.2 (0x4002f000)
>>> libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>>> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
>>>arm-arm9-linux-gnu-ar
>>> libdl.so.2 => /lib/libdl.so.2 (0x4002f000)
>>> libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>>> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
>>>arm-arm9-linux-gnu-as
>>> libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>>> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
>>>arm-arm9-linux-gnu-c++
>>> not a dynamic executable
>>>arm-arm9-linux-gnu-c++filt
>>> not a dynamic executable
>>>arm-arm9-linux-gnu-cpp
>>> not a dynamic executable
>>>arm-arm9-linux-gnu-g++
>>> not a dynamic executable
>>>arm-arm9-linux-gnu-gcc
>>> not a dynamic executable
>>>arm-arm9-linux-gnu-gccbug
>>> not a dynamic executable
>>>arm-arm9-linux-gnu-gcov
>>> not a dynamic executable
>>>arm-arm9-linux-gnu-ld
>>> libdl.so.2 => /lib/libdl.so.2 (0x4002f000)
>>> libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>>> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
>>>arm-arm9-linux-gnu-nm
>>> libdl.so.2 => /lib/libdl.so.2 (0x4002f000)
>>> libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>>> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
>>>arm-arm9-linux-gnu-objcopy
>>> libdl.so.2 => /lib/libdl.so.2 (0x4002f000)
>>> libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>>> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
>>>arm-arm9-linux-gnu-objdump
>>> libdl.so.2 => /lib/libdl.so.2 (0x4002f000)
>>> libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>>> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
>>>arm-arm9-linux-gnu-ranlib
>>> libdl.so.2 => /lib/libdl.so.2 (0x4002f000)
>>> libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>>> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
>>>arm-arm9-linux-gnu-readelf
>>> libdl.so.2 => /lib/libdl.so.2 (0x4002f000)
>>> libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>>> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
>>>arm-arm9-linux-gnu-size
>>> libdl.so.2 => /lib/libdl.so.2 (0x4002f000)
>>> libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>>> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
>>>arm-arm9-linux-gnu-strings
>>> libdl.so.2 => /lib/libdl.so.2 (0x4002f000)
>>> libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>>> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
>>>arm-arm9-linux-gnu-strip
>>> libdl.so.2 => /lib/libdl.so.2 (0x4002f000)
>>> libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>>> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
>>>*************************************************************************
>>>*
>>>
>>>------
>>>Want more information? See the CrossGCC FAQ,
>>>http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to
>>>crossgcc-unsubscribe@sources.redhat.com
>>
>>why do you want to do that?
>>
>>
>>------
>>Want more information? See the CrossGCC FAQ,
>>http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to
>>crossgcc-unsubscribe@sources.redhat.com
>
>
>
>
ok try this:
When making binutils, you have to set LDFLAGS to -all-static not just
-static:
configure --prefix=<yourprefix> --disable-nls && make
LDFLAGS=-all-static && make install
When making gcc:
configure --prefix=<yourprefix> --enable-languages=c --disable-nls
--disable-shared && make LDFLAGS=-static && make install (or whatever)
tell us if you managed to build all static tool chain
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
More information about the crossgcc
mailing list