[CMake] Regression between 2.4.8 and 2.6.2 for the macada version of the gcc compiler

Alan W. Irwin irwin at beluga.phys.uvic.ca
Thu Jan 29 12:56:41 EST 2009


This thread has included different questions for the macada gcc user that
have been brought up in various posts.  I will try to pass on all his
responses which he finally completed this morning.

Brad:

> What is the output of macada gcc with this command line:

> gcc -E -dM -x c /dev/null

See attached gcc_E_dM_x.out file.

Martin: [what is linker associated with macada compiler as revealed by gcc
-Wl,-v ?]

See attached gcc_Wl_v.out file.

Martin:

> I suspect the ada/gcc compiler calls ld directly without passing through
> /usr/bin/libtool. If this is true, changing "-current_version" to
> "-dylib_current_version" should solve the problem.

In Darwin.cmake, this user changed

SET(CMAKE_C_OSX_CURRENT_VERSION_FLAG -Wl,-current_version,)
to
SET(CMAKE_C_OSX_CURRENT_VERSION_FLAG -Wl,-dylib_current_version,)

and got 2.6.2 build success with the simple example.

He then went on to try and build PLplot, but ran into

/usr/bin/ld: unknown flag: -compatibility_version
collect2: ld returned 1 exit status

Darwin.cmake sets

SET(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG -Wl,-compatibility_version,)
SET(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")

but I cannot figure out how (and in what context) these variables are used,
and the macada user has currently not provided further details of the above
error.  (If necessary, I could get the context from him, and set up a simple
test to illustrate the problem, but it appears Brad foretold that
compatibility version would be an issue as well so a special test may not
be necessary to investigate this error any further.)

This user then changed Darwin.cmake following Brad's compatibility version
workaround advice:

SET(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG)
SET(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG)

and PLplot built using CMake-2.6.2 without any further problems!

My thanks to Brad and Martin for helping this user get this far.

Brad, do you now have enough information to permanently fix the
-current_version and -compatibility_version issues for macada gcc for the
forthcoming 2.6.3 release or do you need more information from this user?
Also, if there is some patched version of Darwin.cmake you would like him to
try, I would be happy to pass it on to him.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
-------------- next part --------------
#define __DBL_MIN_EXP__ (-1021)
#define __FLT_MIN__ 1.17549435e-38F
#define __DEC64_DEN__ 0.000000000000001E-383DD
#define __CHAR_BIT__ 8
#define _ARCH_PPCGR 1
#define __WCHAR_MAX__ 2147483647
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
#define __FLT_EVAL_METHOD__ 0
#define __DBL_MIN_10_EXP__ (-307)
#define __FINITE_MATH_ONLY__ 0
#define __GNUC_PATCHLEVEL__ 0
#define __DEC64_MAX_EXP__ 384
#define __SHRT_MAX__ 32767
#define __LDBL_MAX__ 1.79769313486231580793728971405301e+308L
#define _ARCH_PPC 1
#define __APPLE_CC__ 1
#define __UINTMAX_TYPE__ long long unsigned int
#define __DEC32_EPSILON__ 1E-6DF
#define __LDBL_MAX_EXP__ 1024
#define __SCHAR_MAX__ 127
#define __DBL_DIG__ 15
#define __SIZEOF_INT__ 4
#define __SIZEOF_POINTER__ 4
#define __USER_LABEL_PREFIX__ _
#define __STDC_HOSTED__ 1
#define __LDBL_HAS_INFINITY__ 1
#define __FLT_EPSILON__ 1.19209290e-7F
#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L
#define __DEC32_MAX__ 9.999999E96DF
#define __ppc__ 1
#define __SIZEOF_LONG__ 4
#define __APPLE__ 1
#define __DECIMAL_DIG__ 33
#define __LDBL_HAS_QUIET_NAN__ 1
#define __DYNAMIC__ 1
#define __GNUC__ 4
#define __FLT_HAS_DENORM__ 1
#define __SIZEOF_LONG_DOUBLE__ 16
#define __DBL_MAX__ 1.7976931348623157e+308
#define __DBL_HAS_INFINITY__ 1
#define __DEC32_MIN_EXP__ (-95)
#define __LDBL_HAS_DENORM__ 1
#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
#define __DEC32_MIN__ 1E-95DF
#define __DBL_MAX_EXP__ 1024
#define __DEC128_EPSILON__ 1E-33DL
#define __LONG_LONG_MAX__ 9223372036854775807LL
#define __SIZEOF_SIZE_T__ 4
#define __SIZEOF_WINT_T__ 4
#define __GXX_ABI_VERSION 1002
#define __FLT_MIN_EXP__ (-125)
#define __DBL_MIN__ 2.2250738585072014e-308
#define __DEC128_MIN__ 1E-6143DL
#define __REGISTER_PREFIX__
#define __DBL_HAS_DENORM__ 1
#define __NO_INLINE__ 1
#define __FLT_MANT_DIG__ 24
#define __VERSION__ "4.3.0 20070904 (experimental) [trunk revision  
128067]"
#define __BIG_ENDIAN__ 1
#define __DEC64_EPSILON__ 1E-15DD
#define __DEC128_MIN_EXP__ (-6143)
#define __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ 1040
#define __SIZE_TYPE__ long unsigned int
#define __DEC32_DEN__ 0.000001E-95DF
#define __FLT_RADIX__ 2
#define __LDBL_EPSILON__ 4.94065645841246544176568792868221e-324L
#define __SIZEOF_PTRDIFF_T__ 4
#define __NATURAL_ALIGNMENT__ 1
#define __FLT_HAS_QUIET_NAN__ 1
#define __FLT_MAX_10_EXP__ 38
#define __LONG_MAX__ 2147483647L
#define __FLT_HAS_INFINITY__ 1
#define __DEC64_MAX__ 9.999999999999999E384DD
#define __DEC64_MANT_DIG__ 16
#define __DEC32_MAX_EXP__ 96
#define _BIG_ENDIAN 1
#define __DEC128_DEN__ 0.000000000000000000000000000000001E-6143DL
#define __LDBL_MANT_DIG__ 106
#define __DBL_HAS_QUIET_NAN__ 1
#define __WCHAR_TYPE__ int
#define __SIZEOF_FLOAT__ 4
#define __pic__ 2
#define __DEC64_MIN_EXP__ (-383)
#define __FLT_DIG__ 6
#define __INT_MAX__ 2147483647
#define __MACH__ 1
#define __LONG_DOUBLE_128__ 1
#define __FLT_MAX_EXP__ 128
#define __DBL_MANT_DIG__ 53
#define __DEC64_MIN__ 1E-383DD
#define __WINT_TYPE__ int
#define __SIZEOF_SHORT__ 2
#define __LDBL_MIN_EXP__ (-968)
#define __LDBL_MAX_10_EXP__ 308
#define __DBL_EPSILON__ 2.2204460492503131e-16
#define __SIZEOF_WCHAR_T__ 4
#define __DEC_EVAL_METHOD__ 2
#define __INTMAX_MAX__ 9223372036854775807LL
#define __FLT_DENORM_MIN__ 1.40129846e-45F
#define __PIC__ 2
#define __FLT_MAX__ 3.40282347e+38F
#define __SIZEOF_DOUBLE__ 8
#define __FLT_MIN_10_EXP__ (-37)
#define __INTMAX_TYPE__ long long int
#define __DEC128_MAX_EXP__ 6144
#define __GNUC_MINOR__ 3
#define __DEC32_MANT_DIG__ 7
#define __DBL_MAX_10_EXP__ 308
#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
#define __STDC__ 1
#define __PTRDIFF_TYPE__ int
#define __DEC128_MANT_DIG__ 34
#define __LDBL_MIN_10_EXP__ (-291)
#define __SIZEOF_LONG_LONG__ 8
#define __LDBL_DIG__ 31
#define __POWERPC__ 1
#define __GNUC_GNU_INLINE__ 1
-------------- next part --------------
Running cmake.
-- The C compiler identification is GNU
-- Check for working C compiler: /usr/local/ada-4.3/bin/gcc
-- Check for working C compiler: /usr/local/ada-4.3/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp
Running make.
"/Applications/Programming/CMake 2.6-2.app/Contents/bin/cmake" -H/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build -B/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp --check-build-system CMakeFiles/Makefile.cmake 0
"/Applications/Programming/CMake 2.6-2.app/Contents/bin/cmake" -E cmake_progress_start /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/CMakeFiles /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/CMakeFiles/progress.make
make -f CMakeFiles/Makefile2 all
make -f Hello/CMakeFiles/Hello.dir/build.make Hello/CMakeFiles/Hello.dir/depend
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp && "/Applications/Programming/CMake 2.6-2.app/Contents/bin/cmake" -E cmake_depends "Unix Makefiles" /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build/Hello /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello/CMakeFiles/Hello.dir/DependInfo.cmake --color=
Dependee "/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello/CMakeFiles/Hello.dir/DependInfo.cmake" is newer than depender "/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello/CMakeFiles/Hello.dir/depend.internal".
Scanning dependencies of target Hello
make -f Hello/CMakeFiles/Hello.dir/build.make Hello/CMakeFiles/Hello.dir/build
"/Applications/Programming/CMake 2.6-2.app/Contents/bin/cmake" -E cmake_progress_report /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/CMakeFiles 1
[ 50%] Building C object Hello/CMakeFiles/Hello.dir/hello.o
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello && /usr/local/ada-4.3/bin/gcc  -Wl,-v  -DHello_EXPORTS -fPIC   -o CMakeFiles/Hello.dir/hello.o   -c /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/test_c_library_build/Hello/hello.c
Linking C shared library libHello.dylib
cd /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello && "/Applications/Programming/CMake 2.6-2.app/Contents/bin/cmake" -E cmake_link_script CMakeFiles/Hello.dir/link.txt --verbose=1
/usr/local/ada-4.3/bin/gcc  -Wl,-v  -dynamiclib -headerpad_max_install_names -Wl,-current_version,0.0.1 -o libHello.0.0.1.dylib -install_name /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello/libHello.0.0.dylib CMakeFiles/Hello.dir/hello.o 
collect2 version 4.3.0 20070904 (experimental) [trunk revision 128067] (Darwin/PowerPC)
/usr/bin/ld -dynamic -dylib -arch ppc -dylib_install_name /Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/temp/Hello/libHello.0.0.dylib -headerpad_max_install_names -macosx_version_min 10.4 -weak_reference_mismatches non-weak -o libHello.0.0.1.dylib -ldylib1.o -L/usr/local/ada-4.3/lib/gcc/powerpc-apple-darwin8/4.3.0 -L/usr/local/ada-4.3/lib/gcc/powerpc-apple-darwin8/4.3.0/../../.. -v -current_version 0.0.1 CMakeFiles/Hello.dir/hello.o -lgcc_s.10.4 -lgcc -lSystemStubs -lSystem
Apple Computer, Inc. version cctools-622.3.obj~2
/usr/bin/ld: unknown flag: -current_version
collect2: ld returned 1 exit status
make[2]: *** [Hello/libHello.0.0.1.dylib] Error 1
make[1]: *** [Hello/CMakeFiles/Hello.dir/all] Error 2
make: *** [all] Error 2
Done


More information about the CMake mailing list