[CMake] cmake shared library exported symbols on 64bit AIX XLC compiler

Michael Hufer michael.hufer at dionglobal.de
Tue Feb 24 03:49:49 EST 2015


Hi Roman,
you approach ("<CMAKE_XL_CreateExportList_FLAGS> right after 
${CMAKE_XL_CreateExportList} in XL.cmake and then add -X32/-X64 into 
CMAKE_XL_CreateExportList_FLAGS in your CMakeLists.txt") did not work. 
It generated the attached link.txt, where it did not replace 
<CMAKE_XL_CreateExportList_FLAGS> with "-X64" (I set it with "set( 
CMAKE_XL_CreateExportList_FLAGS -X64 )" in the CMakeLists.txt).

Furthermore, I think the whole handling of 64bit builds on AIX is broken 
in cmake. Other tools dealing with object files like ar, nm, and ranlib 
also need a "-X64" flag when dealing with 64bit object files. cmake does 
not set them itself when CMAKE_SIZEOF_VOID_P indicates a 64bit build and 
also does not have CMAKE_${tool}_FLAGS variables to be able to set these 
flags manually in a CMakeLists.txt.

Regards,
     Michael.

On 02/24/2015 06:57 AM, Roman Bolshakov wrote:
> Hi Michael,
>
> Gotcha, thanks for explanation. Right, there should be a way to pass
> -X32/-X64 for CreateExportList right prior to
> <OBJECT_DIR>/objects.exp. Current definition in
> Modules/Compiler/XL.cmake doesn't have a spot for that:
>         set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
>        "${CMAKE_XL_CreateExportList} <OBJECT_DIR>/objects.exp <OBJECTS>
>        "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS>
> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS>
> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS>
> -Wl,-bE:<OBJECT_DIR>/objects.exp <SONAME_FLAG><TARGET_SONAME> -o
> <TARGET> <OBJECTS> <LINK_LIBRARIES>"
>        )
>
> I think it's worth a bug report/contribution. Not sure if it'd work
> but if you might try to modify your local installation of CMake and
> add something like <CMAKE_XL_CreateExportList_FLAGS> right after
> ${CMAKE_XL_CreateExportList} in XL.cmake and then add -X32/-X64 into
> CMAKE_XL_CreateExportLists_FLAGS in your CMakeLists.txt
>
> Roman

-- 
Michael Hufer
Senior Software Developer
-------------------------------
Dion Global Solutions GmbH
Mainzer Landstr. 199  I  60322 Frankfurt am Main  I  Germany
phone: +49 69 50952 241
email:michael.hufer at dionglobal.com | web: www.dionglobal.com/de
HRB-Nr./Commercial Register No. 83397
Geschäftsführer / Managing Directors: Ralph James Horne, Joseph Nash

-------------- next part --------------
/usr/vacpp/bin/CreateExportList CMAKE_XL_CreateExportList_FLAGS CMakeFiles/xmq_s.dir/objects.exp CMakeFiles/xmq_s.dir/Xmq.cpp.o CMakeFiles/xmq_s.dir/XmqMsgDump.cpp.o CMakeFiles/xmq_s.dir/xmq_s_version.cpp.o
/usr/vacpp/bin/xlC_r    -q64 -qthreaded -qalias=noansi -qhalt=e -qtwolink -qrtti=all -qinlglue -qnotemplateregistry -qnotempinc -qlanglvl=newexcp -g -L/home/xgbuild/xgen-trunk/lib/AIX_p64 -L/home/xgbuild/xgen-trunk/external/AIX_p64/libs/mqs-6.0/lib -qexpfile=export.symbols -q64 -bh:5 -lc -lm -G -Wl,-bnoipath -Wl,-bE:CMakeFiles/xmq_s.dir/objects.exp  -o libxmq_s.so CMakeFiles/xmq_s.dir/Xmq.cpp.o CMakeFiles/xmq_s.dir/XmqMsgDump.cpp.o CMakeFiles/xmq_s.dir/xmq_s_version.cpp.o  -L/home/xgbuild/xgen-trunk/lib/AIX_p64 ../libxgencore/libxgencore.so -lmqm_r -lmqmxa64_r -lACE -lexpat -lpcre -Wl,-blibpath:/home/xgbuild/xgen-trunk/build/pitbull/src/libxgencore:/home/xgbuild/xgen-trunk/lib/AIX_p64:/usr/lib:/lib 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: XL.cmake
Type: text/x-cmake
Size: 2648 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150224/91d803a6/attachment.bin>


More information about the CMake mailing list