NetBSD system static libgcc is too old and causing problems

John Marino gnugcc@marino.st
Wed Jan 19 07:23:00 GMT 2011


The NetBSD system gcc is version 4.1.  The following libraries are found 
at /usr/lib (symlinks skipped):
libgcc.a
libgcc_p.a
libgcc_pic.a
libgcc_eh.
libgcc_eh_p.a
libgcc_eh_pic.a
libgcc_s.so

I'm developing a package for NetBSD's pkgsrc that builds gcc's C and Ada 
compilers.  GNAT builds perfectly, but some of the software is giving 
unexpected errors such as _Unwind_GetIPInfo symbol unknown (which was 
added after version 4.1).   What appears to be happening is that the new 
gcc is preferentially linking to the dynamic and statics system versions 
of libgcc.  Moving the static libgcc* out of /usr/lib/ allows the 
software to build as expected.

One solution is to alter the library path for each individual software.  
It would be better if gcc could be fixed to linked to the proper 
libraries at:
/usr/pkg/lib
/usr/pkg/lib/gcc/$TRIPLET/$VERSION/

Is this something that could (and should) be handled at the spec level?

Here is dump of the specs:
*libgcc:
%{!shared:%{!symbolic: %{static|static-libgcc:-lgcc 
-lgcc_eh}%{!static:%{!static-libgcc:%{!shared-libgcc:-lgcc --as-needed 
-lgcc_s --no-as-needed}%{shared-libgcc:-lgcc_s%{!shared: -lgcc}}}}}}


Obviously replacing the system libgcc with a pkgsrc-built libgcc is not 
an option, nor is removing the static system libgcc.  I'm looking for 
advice on how to build gcc where it can co-exist with the system libgcc 
and not preferentially link to it by default (e.g. not alter library 
search path before use.)  Note that my primary problem is the static 
libraries (e.g. libgcc_eh.a) and not the shared libgcc_s.

Thanks,
John



More information about the Gcc-help mailing list