[CMake] CHECK_TYPE_SIZE("size_t" SIZEOF_SIZE_T) failed while crosscompile

Claus Klein claus.klein at arcormail.de
Wed Jan 10 14:59:46 EST 2007


On Wednesday 10 January 2007 20:22, Bill Hoffman wrote:
> Claus Klein wrote:
> >
> > thanks  for quick anser.
> >
> > If it works with:
> > cmake -DSIZEOF_SIZE_T=4 ..
> > it is ok for me.
> >
> > But my real intention is:
> >
> > It ist possible to prevent test which use TRY_RUN()?
> >
> > That was the most often problem with configure, why continue this with cmake?
> >
> > While crosscompiling, sure!
> >
> > -Claus
> >
> >   
> Right now there is no way to do this, other than pre-set the variable.  
> However, there are plans
> at some point to add better support for cross-compiling.   When that 
> happens, in cross-compile
> mode all try_run calls will cause errors.  This has not yet been 
> implemented.
> 
> -Bill
> 
> 
Why is 'Check size of void*' done by default?

For me, the current implemention is buggy. With an real cross-compiler tool chain there is no error while cmake:

+ CC=/tools/LinuxPpcCDK/bin/powerpc-linux-gcc
+ CXX=/tools/LinuxPpcCDK/bin/powerpc-linux-g++
+ AR=/tools/LinuxPpcCDK/bin/powerpc-linux-ar
+ PKG_CONFIG_PATH=/tools/LinuxPpcCDK/lib/pkgconfig
+ PKG_CONFIG_DEBUG_SPEW=1
+ CMAKE_LIBRARY_PATH=/tools/LinuxPpcCDK/lib:/tools/LinuxPpcCDK/usr/lib
+ CMAKE_INCLUDE_PATH=/tools/LinuxPpcCDK/include:/tools/LinuxPpcCDK/usr/include
+ cmake -DWITH_OpenSSL=ON -DWITH_TCLDev=OFF -DWITH_PerlDev=OFF -DWITH_GnuTLS=OFF -DWITH_PostgreSQL=OFF -DWITH_MySQL=OFF -DWITH_Zeroconf=OFF -DWITH_TESTS=OFF ..
-- Check for working C compiler: /tools/LinuxPpcCDK/bin/powerpc-linux-gcc
-- Check for working C compiler: /tools/LinuxPpcCDK/bin/powerpc-linux-gcc -- works
-- Check size of void*
-- Check size of void* - done		<<<<<<<<<<<<<<<<<<< no error
-- Found OpenSSL: /tools/LinuxPpcCDK/lib/libssl.so
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Performing Test HAVE_FLAGS_64
-- Performing Test HAVE_FLAGS_64 - Success
-- Looking for include files HAVE_EXECINFO_H
-- Looking for include files HAVE_EXECINFO_H - not found.
-- Looking for include files HAVE_STDINT_H
-- Looking for include files HAVE_STDINT_H - found
-- Looking for include files HAVE_SYS_TYPES_H
-- Looking for include files HAVE_SYS_TYPES_H - found
-- Looking for include files HAVE_INTTYPES_H
-- Looking for include files HAVE_INTTYPES_H - found
-- Looking for include files HAVE_UNISTD_H
-- Looking for include files HAVE_UNISTD_H - found
-- Looking for include files HAVE_UTIME_H
-- Looking for include files HAVE_UTIME_H - found
-- Looking for include files HAVE_DL_H
-- Looking for include files HAVE_DL_H - not found.
-- Looking for include files HAVE_LIMITS_H
-- Looking for include files HAVE_LIMITS_H - found
-- Looking for include files HAVE_MALLOC_H
-- Looking for include files HAVE_MALLOC_H - found
-- Looking for include files HAVE_SYS_PARAM_H
-- Looking for include files HAVE_SYS_PARAM_H - found
-- Looking for include files HAVE_SYS_MOUNT_H
-- Looking for include files HAVE_SYS_MOUNT_H - found
-- Looking for include files HAVE_SYS_STATVFS_H
-- Looking for include files HAVE_SYS_STATVFS_H - found
-- Looking for include files HAVE_PTHREAD
-- Looking for include files HAVE_PTHREAD - found
-- Check size of off_t
-- Check size of off_t - done
-- DEBUG off_t is 126		<<<<<<<<<<<<<<<<<<< no error
-- Looking for backtrace
-- Looking for backtrace - not found
-- Looking for getsockname
-- Looking for getsockname - found
-- Looking for inet_ntoa
-- Looking for inet_ntoa - found
-- Looking for inet_ntop
-- Looking for inet_ntop - found
-- Looking for inet_pton
-- Looking for inet_pton - found
-- Looking for regcomp
-- Looking for regcomp - found
-- Looking for strlcat
-- Looking for strlcat - found
-- Looking for strptime
-- Looking for strptime - found
-- Looking for strtok_r
-- Looking for strtok_r - found
-- Looking for strtoull
-- Looking for strtoull - found
-- Looking for statvfs
-- Looking for statvfs - found
-- Looking for stat64
-- Looking for stat64 - found
-- Looking for include files HAVE_ICONV
-- Looking for include files HAVE_ICONV - not found.
-- Looking for include files HAVE_LANGINFO_CODESET
-- Looking for include files HAVE_LANGINFO_CODESET - found
-- Looking for include files HAVE_WCHAR_H
-- Looking for include files HAVE_WCHAR_H - found
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Configuring for release
-- Configuring for UTF-8
-- Check for working CXX compiler: /tools/LinuxPpcCDK/bin/powerpc-linux-g++
-- Check for working CXX compiler: /tools/LinuxPpcCDK/bin/powerpc-linux-g++ -- works
-- Configuring done
-- Generating done
-- Build files have been written to: /home/claus/src/wzdftpd/trunk/build
+ cmake -DWITH_OpenSSL=ON -DWITH_TCLDev=OFF -DWITH_PerlDev=OFF -DWITH_GnuTLS=OFF -DWITH_PostgreSQL=OFF -DWITH_MySQL=OFF -DWITH_Zeroconf=OFF -L -DWITH_TESTS=OFF ..
-- DEBUG off_t is 126
-- Configuring for release
-- Configuring for UTF-8
-- Configuring done
-- Generating done
-- Build files have been written to: /home/claus/src/wzdftpd/trunk/build
-- Cache values
BUILD_TESTING:BOOL=ON
CMAKE_BACKWARDS_COMPATIBILITY:STRING=2.4
CMAKE_BUILD_TYPE:STRING=
CMAKE_INSTALL_PREFIX:PATH=/usr/local
DART_ROOT:PATH=DART_ROOT-NOTFOUND
EXECUTABLE_OUTPUT_PATH:PATH=
LIBRARY_OUTPUT_PATH:PATH=
WITH_GnuTLS:BOOL=OFF
WITH_IPV6:BOOL=OFF
WITH_MySQL:BOOL=OFF
WITH_OpenSSL:BOOL=ON
WITH_PerlDev:BOOL=OFF
WITH_PostgreSQL:BOOL=OFF
WITH_TCLDev:BOOL=OFF
WITH_TESTS:BOOL=OFF
WITH_UTF8:BOOL=ON
WITH_Zeroconf:BOOL=OFF
+ egrep 'SIZEOF_\w*|NOTFOUND|=\/usr' CMakeCache.txt
CMAKE_AR:FILEPATH=/usr/bin/ar
CMAKE_INSTALL_PREFIX:PATH=/usr/local
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/gmake
CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib
COMPRESSIONCOMMAND:FILEPATH=/usr/bin/gzip
COVERAGE_COMMAND:FILEPATH=/usr/bin/gcov
CVSCOMMAND:FILEPATH=/usr/bin/cvs
DART_ROOT:PATH=DART_ROOT-NOTFOUND
GUNZIPCOMMAND:FILEPATH=/usr/bin/gunzip
JAVACOMMAND:FILEPATH=/usr/bin/java
MAKECOMMAND:STRING=/usr/bin/gmake -i
MEMORYCHECK_COMMAND:FILEPATH=/usr/bin/valgrind
SCPCOMMAND:FILEPATH=/usr/bin/scp
SVNCOMMAND:FILEPATH=/usr/bin/svn
CMAKE_BUILD_TOOL:INTERNAL=/usr/bin/gmake
CMAKE_COMMAND:INTERNAL=/usr/local/bin/cmake
CMAKE_CTEST_COMMAND:INTERNAL=/usr/local/bin/ctest
CMAKE_EDIT_COMMAND:INTERNAL=/usr/local/bin/ccmake
CMAKE_ROOT:INTERNAL=/usr/local/share/cmake-2.4
CMAKE_SIZEOF_VOID_P:INTERNAL=126		<<<<<<<<<<<<<<<<<<< shell error
HAVE_CMAKE_SIZEOF_VOID_P:INTERNAL=TRUE
HAVE_SIZEOF_OFF_T:INTERNAL=TRUE
SIZEOF_OFF_T:INTERNAL=126		<<<<<<<<<<<<<<<<<<< shell error
+ make
Scanning dependencies of target libwzd_core
...


see man bash(1):

       If a command is not found, the child process created to execute it returns a status of 127.  If a  command  is
       found but is not executable, the return status is 126.

-Claus


More information about the CMake mailing list