zlib-ng: cmake failure on armv6 and armv7

While trying to build zlib-ng 2.0.1 for armv6 and armv7, I get the following error:

[  129s] -- Check size of void *
[  131s] -- Check size of void * - failed
[  131s] -- sizeof(void *) is  bytes
[  131s] CMake Error at CMakeLists.txt:453 (message):
[  131s]   sizeof(void *) is neither 32 nor 64 bit

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21 (10 by maintainers)

Commits related to this issue

Most upvoted comments

develop branch works properly:

[   87s] -- Arch detected: 'armv7'
[   87s] -- Basearch of 'armv7' has been detected as: 'arm'
[   87s] -- Performing Test HAVE_FLOATABI_SOFTFP
[   87s] -- Performing Test HAVE_FLOATABI_SOFTFP - Failed
[   87s] -- Performing Test HAVE_FLOATABI_HARD
[   87s] -- Performing Test HAVE_FLOATABI_HARD - Success
[   87s] -- ARM floating point arch: -mfloat-abi=hard

Thanks!

                if("${ARCH}" MATCHES "arm" AND NOT CMAKE_C_FLAGS MATCHES "-mfloat-abi")
                    # Check support for ARM floating point ABI
                    execute_process(COMMAND ${CMAKE_C_COMPILER} "-dumpmachine"
                                    OUTPUT_VARIABLE GCC_MACHINE)
                    if("${GCC_MACHINE}" MATCHES "gnueabihf")
                        set(FLOATABI "-mfloat-abi=hard")
                    elseif("${GCC_MACHINE}" MATCHES ".*gnueabi")
                        set(FLOATABI "-mfloat-abi=softfp")
                    endif()
                    message(STATUS "ARM floating point arch: ${FLOATABI}")
                    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLOATABI}")
                endif()

according to this part, you need add -DCMAKE_C_FLAGS=-mfloat-abi=hard to cmake command line as a workaround.

meanwhile it requires developers to update arm float-abi detection.