Hi

I'm building binaries for AIX using GCC and native ld (also testing with GCC cross-compiler with GNU binutils) and I get issues with exceptions not being caught like they should.

I'm linking a number of static C and C++ archives into several binaries and I notice that under certain conditions CMake adds libgcc_eh.a to the linker line. It actually appears twice in between target_link_libraries libs and the RPATH section at the end. Something like this:

c++ -g <object_files> -o <executable> -Wl,-brtl,-bexpall \
<link_libraries> \
<full_path_to>/libgcc_eh.a \
<full_path_to>/libgcc_eh.a \
-Wl,-blibpath:<rpath>

If I manually add libsupc++.a to the linker line my program links and runs correctly, BUT if I strip both libgcc_eh.a and libsupc++.a from the linker command it also links and runs correctly. Since supc++ is a subset of stdc++ I thought I wouldn't need that anyway.

Is this expected behavior? Is libgcc_eh.a really needed here or is there a way to avoid it? Or should CMake also add libsupc++?

Best Regards,
Ådne Hovda

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to