[CMake] Cross-compiling for z/OS -- linker question

Phil Smith phil at voltage.com
Tue Aug 5 13:30:03 EDT 2008


Next issue: linking. I have a toolchain file now that looks like this:

------------------------------------------------------------
# Tell CMAKE the target system name
SET(CMAKE_SYSTEM_NAME "ZOS")

# Specify the cross-compilers
SET(CMAKE_C_COMPILER   "c:/progra~1/dignus/cc.bat")
SET(CMAKE_CXX_COMPILER "c:/progra~1/dignus/cxx.bat")

# Linker
SET(CMAKE_CXX_LINK_EXECUTABLE "c:/progra~1/dignus/linkit.bat")
SET(CMAKE_C_LINK_EXECUTABLE   "c:/progra~1/dignus/linkit.bat")
SET(CMAKE_EXECUTABLE_SUFFIX   "OUT")

INCLUDE (CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER   (c:/progra~1/dignus/cc.bat Dignus)
CMAKE_FORCE_CXX_COMPILER (c:/progra~1/dignus/cxx.bat Dignus)
------------------------------------------------------------

(I'm actually likely to change all "ZOS" to "DIGNUS", since it's really not specific to z/OS, but rather to System z -- but that's for later.)

CMAKE calls cc.bat correctly for CheckInclude and CheckTypeSizeC. But then it calls linkit.bat with NO operands -- so linkit has no idea what it's supposed to linkedit!  What am I missing?

Background, in case it helps: the Dignus C/C++ compilers are two-stage: they generate assembler, which must then be assembled with dasm.exe to generate object. That's what cc.bat and cxx.bat do (with some fooling around with filenames so things work).  The result of the cc.bat call for CheckTypeSizeC, for example, is a CheckTypeSizeC.c.o in CMakeFiles\CMakeTmp\CMakeFiles\cmTryCompileExec.dir.

The linkit.bat call is then expected (by me, anyway!) to generate the appropriate executable for the regex in CheckTypeSize.cmake to scan. But since linkit.bat gets called with NO operands, that doesn't happen.
--
...phsiii

Phil Smith III
phil at voltage.com
Voltage Security, Inc.
www.voltage.com
(703) 476-4511 (home office)
(703) 568-6662 (cell)




More information about the CMake mailing list