This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Statically linking libstdc++ and libgcc_s

Alas, other forums do not seem to have the answer to this one, perhaps the 
developers can assist....

I'm trying to statically link an app to libstdc++ and libgcc_s to permit 
easier distribution of the resulting binary.

I'm doing this on Solaris 2.5.1 using gcc-3.1.1 and binutils 2.12.1

Alas, my best attempt links without complaint, error or warning, but
then seg faults's on running...

collect2 -V  -G  -z text -Y P,/usr/ccs/lib:/usr/lib -Qy -o myprogram -L.. 
  -L/usr/ccs/bin -L/usr/ccs/lib 
  ....many user .o's and -l...a's...
  -dn -lstdc++ -lgcc_eh -dy -lsocket -lnsl -lrx -ldb

Curiously enough the linux RH7.3 using same toolsuite versions doesn't 
even link.

Any suggestions as to which is the right part of TFM to R?

Gcc was configured as so..
--host=sparc-sun-solaris2.5.1 --with-as=/usr/local/gcc1541A/bin/as 
--with-ld=/usr/local/gcc1541A/bin/ld --with-gnu-as --with-gnu-ld 
--prefix=/usr/local/gcc1541B --exec-prefix=/usr/local/gcc1541B 
--disable-threads --enable-languages=c,c++ --norecursion -- 

John Carter                             Phone : (64)(3) 358 6639
Tait Electronics                        Fax   : (64)(3) 359 4632
PO Box 1645 Christchurch                Email :
New Zealand

This email message is intended only for the addressee(s) and contains
information which may be confidential and/or copyright.  If you are not
the intended recipient please do not read, save, forward, disclose, or
copy the contents of this email. If this email has been sent to you in
error, please notify the sender by reply email and he will be
along to delete you, this email and any copies or links to this email.  
No representation is made that this email, you, or the sender are free of
viruses. Virus scanning and prevention is recommended and is the
responsibility of consenting adults.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]