Static linked GCC toolchain

prakash prakash_bhurke@persistent.co.in
Sat Sep 2 12:33:00 GMT 2006


Hi,

I am trying to build a gcc-3.4.5 on RedHat 7.1 so that I can use it on 
following different platforms:
RH 7.1, RH7.3, RH8, RH9, RHEL2.1 RHEL4.0, FC2, FC3,etc

My requirement is to use gcc without setting LD_LIBRARY_PATH to location 
of libgcc_s.so, on different platform as mentioned above. I don't want 
application binaries which are generated/created as statically linked 
executables by these toolchain. I have observed that Red hat's default 
/usr/bin/gcc is statically linked gcc. I tried same configuration 
parameter (returned by #/usr/bin/gcc -v) to build it, but I could not 
able to get statically linked gcc. I could not able to find out how they 
build it on Net. Here is steps (found on net) which I tried:

# LDFLAGS=-static ../gcc-3.4.5/configure --prefix=/home/praks/GCC345 
--enable-languages=c,c++,java
#make LDFLAGS=-static bootstrap && make LDFLAGS=-static

But it creates gcc which is dependent on libgcc_s.so
-----------------------------------------------------
(praks) bin> ./gcc
./gcc: error while loading shared libraries: libgcc_s.so.1: cannot load 
shared object file: No such file or directory
(praks) bin> ldd ./gcc
libgcc_s.so.1 => not found
libc.so.6 => /lib/i686/libc.so.6 (0x40023000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
(praks) bin>
-----------------------------------------------------

However, GCC configure script supports --enable-static && 
--enable-shared. With help of these flags we can build gcc toolchain 
statically linked. But binaries which are generated by these toolchain 
are statically linked executables. I want only statically gcc linked 
toolchain & I want to use this gcc toolchain on different platforms as 
mentioned earlier. It would be nice if anyone could give pointers.

Regards,
Prakash



DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Pvt. Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Pvt. Ltd. does not accept any liability for virus infected mails.

--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list