[cmake-developers] CMake adds libgcc_eh.a to the linker line on AIX

Ådne Hovda ahovda at openit.com
Fri Feb 7 10:15:20 EST 2014


On 2/7/2014 3:33 PM, Brad King wrote:
> like CMAKE_C_IMPLICIT_LINK_LIBRARIES.  Does libgcc_eh.a appear in any
> of them?

You are right, it's there.

If I run "powerpc-ibm-aix5.3.0.0-gcc
/opt/cmake/share/cmake-2.8/Modules/CMakeCCompilerABI.c -v" I see
libgcc_eh.as among collect2's args.

For "powerpc-ibm-aix5.3.0.0-g++
/opt/cmake/share/cmake-2.8/Modules/CMakeCXXCompilerABI.cpp -v" it is
indeed not present.

> Whatever lang's compiler is used to drive the link has a known set of
> libraries.  All other libraries implicitly used by the other
> languages will be added to the link line explicitly.

Turns out gcc would try to link libgcc statically by default, and 
brought in libgcc_eh.a, but that's not working well when linked with C++ 
code using exceptions. Had I only read the docs... 
http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html#index-shared-libgcc-1093 
. I'll try to set the -shared-libgcc flag in my toolchain file and 
hopefully have it work.

Thanks!

Ådne




More information about the cmake-developers mailing list