This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Specs file help
- From: Ian Lance Taylor <iant at google dot com>
- To: james at dolphtech dot com
- Cc: gcc-help at gcc dot gnu dot org
- Date: 12 Oct 2007 10:00:55 -0700
- Subject: Re: Specs file help
- References: <1192198353.2646.13.camel@munchie.dolphtech.com>
James Trickel <james@dolphtech.com> writes:
> g++: v3.4.2
> OS : Solaris 8 sparc
> specs : see attached
>
> I am trying to compile c++ programs and shared libraries without the
> libstdc++.so.6 and libgcc_s.so.1 dependencies.
>
> # ldd *.so
> libstdc++.so.6 => /usr/local/lib/libstdc++.so.6
> libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1
>
> # ldd (binary)
> (same results as above)
>
> I have tweaked the /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.2/specs
> file before to remove the libgcc_s.so dependency by tweaking the
> '*libgcc' line. Now the libgcc_s.so.1 dependency for binaries compiled
> with 'gcc' have been removed.
>
> Any ideas?
Use the -static-libgcc option.
(Actually, I don't remember whether that was implemented in gcc 3.4,
but it's the right thing to do).
(Note that some complicated cases of throwing exceptions across shared
library boundaries will not work if you do this.)
Ian