On Tue, Mar 13, 2007 at 10:28:41PM -0400, Jack Howarth wrote:
> Interestingly, while...
>
> gcc-4 pr30703.C -fmessage-length=0 -fopenmp -O0 -L/sw/lib/gcc4.2/lib -lgomp
> -lstdc++ -lm -m32 -o ./pr30703.exe
> /usr/bin/ld: Undefined symbols:
> __Unwind_Resume
> collect2: ld returned 1 exit status
>
> fails on powerpc-apple-darwin8....
>
> gcc-4 pr30703.C -fmessage-length=0 -fopenmp -O0 -L/sw/lib/gcc4.2/lib -lgomp
> -lstdc++ -lm -m32 -shared-libgcc -o ./pr30703.exe
>
> ...links fine. On powerpc-apple-darwin8, libgcc.a is missing __Unwind_Resume.
> I wonder why this doesn't show up
> on any other architectures?
Because libstdc++.so links against libgcc_s.so.1 which exports that symbol
(was linked with -shared-libgcc). Or, on ELFish targets that use recent
binutils when neither -shared-libgcc nor -static-libgcc is used,
libgcc_s.so.1 is linked in --as-needed.
libgcc.a doesn't contain the unwinder on purpose, it is only in libgcc_s.so
and libgcc_eh.a, so that every binary or library doesn't have its own copy
of the unwinder (which causes severe problems).
Jakub