Skip to content

Commit

Permalink
Add support for illumos cross-compilation (#37753)
Browse files Browse the repository at this point in the history
  • Loading branch information
am11 committed Jun 19, 2020
1 parent 85a97b6 commit 43ae9af
Show file tree
Hide file tree
Showing 22 changed files with 165 additions and 177 deletions.
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ syntax: glob
### VisualStudio ###

# Tool Runtime Dir
.dotnet/
.dotnet-mono/
.packages/
.tools/
# note: there is no trailing slash so if these are symlinks (which are seen as files,
# instead of directories), git will still ignore them.
.dotnet
.dotnet-mono
.packages
.tools

# User-specific files
*.suo
Expand Down
14 changes: 14 additions & 0 deletions eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -577,4 +577,18 @@ else (CLR_CMAKE_HOST_WIN32)
if (AWK STREQUAL "AWK-NOTFOUND")
message(FATAL_ERROR "AWK not found")
endif()

# detect linker
set(ldVersion ${CMAKE_C_COMPILER};-Wl,--version)
execute_process(COMMAND ${ldVersion}
ERROR_QUIET
OUTPUT_VARIABLE ldVersionOutput)

if("${ldVersionOutput}" MATCHES "GNU ld" OR "${ldVersionOutput}" MATCHES "GNU gold")
set(LD_GNU 1)
elseif("${ldVersionOutput}" MATCHES "Solaris Link")
set(LD_SOLARIS 1)
else(CLR_CMAKE_HOST_OSX)
set(LD_OSX 1)
endif()
endif(CLR_CMAKE_HOST_WIN32)
8 changes: 4 additions & 4 deletions eng/native/configureplatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ if(CLR_CMAKE_HOST_OS STREQUAL SunOS)
COMMAND isainfo -n
OUTPUT_VARIABLE SUNOS_NATIVE_INSTRUCTION_SET)

if(SUNOS_NATIVE_INSTRUCTION_SET MATCHES "amd64")
if(SUNOS_NATIVE_INSTRUCTION_SET MATCHES "amd64" OR CMAKE_CROSSCOMPILING)
set(CLR_CMAKE_HOST_UNIX_AMD64 1)
set(CMAKE_SYSTEM_PROCESSOR "amd64")
else()
Expand All @@ -165,11 +165,11 @@ if(CLR_CMAKE_HOST_OS STREQUAL SunOS)
ERROR_QUIET)

set(CLR_CMAKE_HOST_SUNOS 1)
if(SUNOS_KERNEL_KIND STREQUAL illumos)
if(SUNOS_KERNEL_KIND STREQUAL illumos OR CMAKE_CROSSCOMPILING)
set(CLR_CMAKE_HOST_OS_ILLUMOS 1)
else(SUNOS_KERNEL_KIND STREQUAL illumos)
else(SUNOS_KERNEL_KIND STREQUAL illumos OR CMAKE_CROSSCOMPILING)
set(CLR_CMAKE_HOST_OS_SOLARIS 1)
endif(SUNOS_KERNEL_KIND STREQUAL illumos)
endif(SUNOS_KERNEL_KIND STREQUAL illumos OR CMAKE_CROSSCOMPILING)
endif(CLR_CMAKE_HOST_OS STREQUAL SunOS)

if(CLR_CMAKE_HOST_OS STREQUAL Windows)
Expand Down
7 changes: 4 additions & 3 deletions eng/native/configuretools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,18 @@ if(NOT WIN32 AND NOT CLR_CMAKE_TARGET_BROWSER)
"${TOOLSET_PREFIX}${exec}")

if (EXEC_LOCATION_${exec} STREQUAL "EXEC_LOCATION_${exec}-NOTFOUND")
message(FATAL_ERROR "Unable to find toolchain executable for: ${exec}.")
message(FATAL_ERROR "Unable to find toolchain executable. Name: ${exec}, Prefix: ${TOOLSET_PREFIX}.")
endif()
set(${var} ${EXEC_LOCATION_${exec}} PARENT_SCOPE)
endfunction()

locate_toolchain_exec(ar CMAKE_AR)
locate_toolchain_exec(link CMAKE_LINKER)
locate_toolchain_exec(nm CMAKE_NM)

if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
locate_toolchain_exec(ranlib CMAKE_RANLIB)
else()
locate_toolchain_exec(link CMAKE_LINKER)
endif()

if(NOT CLR_CMAKE_TARGET_OSX AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND (NOT CLR_CMAKE_TARGET_ANDROID OR CROSS_ROOTFS))
Expand Down
14 changes: 14 additions & 0 deletions eng/native/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,20 @@ function(preprocess_compile_asm)
set(${COMPILE_ASM_OUTPUT_OBJECTS} ${ASSEMBLED_OBJECTS} PARENT_SCOPE)
endfunction()

function(set_exports_linker_option exports_filename)
if(LD_GNU OR LD_SOLARIS)
# Add linker exports file option
if(LD_SOLARIS)
set(EXPORTS_LINKER_OPTION -Wl,-M,${exports_filename} PARENT_SCOPE)
else()
set(EXPORTS_LINKER_OPTION -Wl,--version-script=${exports_filename} PARENT_SCOPE)
endif()
elseif(LD_OSX)
# Add linker exports file option
set(EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${exports_filename} PARENT_SCOPE)
endif()
endfunction()

function(generate_exports_file)
set(INPUT_LIST ${ARGN})
list(GET INPUT_LIST -1 outputFilename)
Expand Down
23 changes: 7 additions & 16 deletions src/coreclr/src/dlls/dbgshim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,16 @@ else(CLR_CMAKE_TARGET_WIN32)
set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/dbgshim_unixexports.src)
set(EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/dbgshim.exports)
generate_exports_file(${DEF_SOURCES} ${EXPORTS_FILE})
endif(CLR_CMAKE_TARGET_WIN32)

if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)
# This option is necessary to ensure that the overloaded delete operator defined inside
# of the utilcode will be used instead of the standard library delete operator.
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic")
if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)
# This option is necessary to ensure that the overloaded delete operator defined inside
# of the utilcode will be used instead of the standard library delete operator.
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic")
endif(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)

# Add linker exports file option
if(CLR_CMAKE_HOST_SUNOS)
set(EXPORTS_LINKER_OPTION -Wl,-M,${EXPORTS_FILE})
else(CLR_CMAKE_HOST_SUNOS)
set(EXPORTS_LINKER_OPTION -Wl,--version-script=${EXPORTS_FILE})
endif(CLR_CMAKE_HOST_SUNOS)
endif(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)
set_exports_linker_option(${EXPORTS_FILE})

if(CLR_CMAKE_HOST_OSX)
# Add linker exports file option
set(EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${EXPORTS_FILE})
endif(CLR_CMAKE_HOST_OSX)
endif(CLR_CMAKE_TARGET_WIN32)

add_library_clr(dbgshim SHARED ${DBGSHIM_SOURCES})

Expand Down
44 changes: 17 additions & 27 deletions src/coreclr/src/dlls/mscordac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,34 +71,24 @@ else(CLR_CMAKE_HOST_WIN32)
# Add lib redefines file to DAC
list(APPEND CLR_DAC_SOURCES libredefines.S)
endif(CLR_CMAKE_HOST_LINUX)
endif(CLR_CMAKE_HOST_WIN32)

if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)
# This option is necessary to ensure that the overloaded delete operator defined inside
# of the utilcode will be used instead of the standard library delete operator.
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic")

# The following linked options can be inserted into the linker libraries list to
# ensure proper resolving of circular references between a subset of the libraries.
set(START_LIBRARY_GROUP -Wl,--start-group)
set(END_LIBRARY_GROUP -Wl,--end-group)

# These options are used to force every object to be included even if it's unused.
set(START_WHOLE_ARCHIVE -Wl,--whole-archive)
set(END_WHOLE_ARCHIVE -Wl,--no-whole-archive)

# Add linker exports file option
if(CLR_CMAKE_HOST_SUNOS)
set(EXPORTS_LINKER_OPTION -Wl,-M,${EXPORTS_FILE})
else(CLR_CMAKE_HOST_SUNOS)
set(EXPORTS_LINKER_OPTION -Wl,--version-script=${EXPORTS_FILE})
endif(CLR_CMAKE_HOST_SUNOS)
endif(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)

if(CLR_CMAKE_HOST_OSX)
# Add linker exports file option
set(EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${EXPORTS_FILE})
endif(CLR_CMAKE_HOST_OSX)
if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)
# This option is necessary to ensure that the overloaded delete operator defined inside
# of the utilcode will be used instead of the standard library delete operator.
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic")

# The following linked options can be inserted into the linker libraries list to
# ensure proper resolving of circular references between a subset of the libraries.
set(START_LIBRARY_GROUP -Wl,--start-group)
set(END_LIBRARY_GROUP -Wl,--end-group)

# These options are used to force every object to be included even if it's unused.
set(START_WHOLE_ARCHIVE -Wl,--whole-archive)
set(END_WHOLE_ARCHIVE -Wl,--no-whole-archive)
endif(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)

set_exports_linker_option(${EXPORTS_FILE})
endif(CLR_CMAKE_HOST_WIN32)

# Create object library to enable creation of proper dependency of mscordaccore.exp on mscordac.obj and
# mscordaccore on both the mscordaccore.exp and mscordac.obj.
Expand Down
26 changes: 8 additions & 18 deletions src/coreclr/src/dlls/mscordbi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,15 @@ else(CLR_CMAKE_HOST_WIN32)
set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/mscordbi_unixexports.src)
set(EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/mscordbi.exports)
generate_exports_file(${DEF_SOURCES} ${EXPORTS_FILE})
endif(CLR_CMAKE_HOST_WIN32)

if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)
# This option is necessary to ensure that the overloaded new/delete operators defined inside
# of the utilcode will be used instead of the standard library delete operator.
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic")

# Add linker exports file option
if(CLR_CMAKE_HOST_SUNOS)
set(EXPORTS_LINKER_OPTION -Wl,-M,${EXPORTS_FILE})
else(CLR_CMAKE_HOST_SUNOS)
set(EXPORTS_LINKER_OPTION -Wl,--version-script=${EXPORTS_FILE})
endif(CLR_CMAKE_HOST_SUNOS)
endif(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)

if(CLR_CMAKE_HOST_OSX)
# Add linker exports file option
set(EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${EXPORTS_FILE})
endif(CLR_CMAKE_HOST_OSX)
if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)
# This option is necessary to ensure that the overloaded new/delete operators defined inside
# of the utilcode will be used instead of the standard library delete operator.
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic")
endif(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)

set_exports_linker_option(${EXPORTS_FILE})
endif(CLR_CMAKE_HOST_WIN32)

add_library_clr(mscordbi SHARED ${MSCORDBI_SOURCES})
target_precompile_header(TARGET mscordbi HEADER stdafx.h)
Expand Down
10 changes: 2 additions & 8 deletions src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,16 @@ else(CLR_CMAKE_HOST_WIN32)
# These options are used to force every object to be included even if it's unused.
set(START_WHOLE_ARCHIVE -Wl,--whole-archive)
set(END_WHOLE_ARCHIVE -Wl,--no-whole-archive)

if(CLR_CMAKE_TARGET_SUNOS)
set(EXPORTS_LINKER_OPTION -Wl,-M,${EXPORTS_FILE})
elseif(CLR_CMAKE_TARGET_SUNOS)
set(EXPORTS_LINKER_OPTION -Wl,--version-script=${EXPORTS_FILE})
endif(CLR_CMAKE_TARGET_SUNOS)
endif(CLR_CMAKE_TARGET_LINUX OR CLR_CMAKE_TARGET_FREEBSD OR CLR_CMAKE_TARGET_NETBSD OR CLR_CMAKE_TARGET_SUNOS)

if(CLR_CMAKE_TARGET_OSX)
# These options are used to force every object to be included even if it's unused.
set(START_WHOLE_ARCHIVE -force_load)
set(END_WHOLE_ARCHIVE )

set(EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${EXPORTS_FILE})
endif(CLR_CMAKE_TARGET_OSX)

set_exports_linker_option(${EXPORTS_FILE})

if(CLR_CMAKE_TARGET_ANDROID AND CLR_CMAKE_HOST_ARCH_ARM)
set(EXPORTS_LINKER_OPTION "${EXPORTS_LINKER_OPTION} -Wl,--no-warn-shared-textrel")
endif(CLR_CMAKE_TARGET_ANDROID AND CLR_CMAKE_HOST_ARCH_ARM)
Expand Down
8 changes: 1 addition & 7 deletions src/coreclr/src/ilasm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,8 @@ if(CLR_CMAKE_HOST_UNIX)
mscorrc
coreclrpal
palrt
${CMAKE_DL_LIBS}
)

# FreeBSD and NetBSD implement dlopen(3) in libc
if(NOT CLR_CMAKE_TARGET_FREEBSD AND NOT CLR_CMAKE_TARGET_NETBSD)
target_link_libraries(ilasm
dl
)
endif(NOT CLR_CMAKE_TARGET_FREEBSD AND NOT CLR_CMAKE_TARGET_NETBSD)
else()
target_link_libraries(ilasm
${ILASM_LINK_LIBRARIES}
Expand Down
8 changes: 1 addition & 7 deletions src/coreclr/src/ildasm/exe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,8 @@ if(CLR_CMAKE_HOST_UNIX)
mscorrc
coreclrpal
palrt
${CMAKE_DL_LIBS}
)

# FreeBSD and NetBSD implement dlopen(3) in libc
if(NOT CLR_CMAKE_TARGET_FREEBSD AND NOT CLR_CMAKE_TARGET_NETBSD)
target_link_libraries(ildasm
dl
)
endif(NOT CLR_CMAKE_TARGET_FREEBSD AND NOT CLR_CMAKE_TARGET_NETBSD)
else()
target_link_libraries(ildasm
${ILDASM_LINK_LIBRARIES}
Expand Down
9 changes: 1 addition & 8 deletions src/coreclr/src/jit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -321,16 +321,9 @@ else()
if(CLR_CMAKE_TARGET_LINUX OR CLR_CMAKE_TARGET_FREEBSD OR CLR_CMAKE_TARGET_NETBSD OR CLR_CMAKE_TARGET_SUNOS)
# This is required to force using our own PAL, not one that we are loaded with.
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic")

if(CLR_CMAKE_TARGET_SUNOS)
set(JIT_EXPORTS_LINKER_OPTION -Wl,-M,${JIT_EXPORTS_FILE})
else(CLR_CMAKE_TARGET_SUNOS)
set(JIT_EXPORTS_LINKER_OPTION -Wl,--version-script=${JIT_EXPORTS_FILE})
endif(CLR_CMAKE_TARGET_SUNOS)
elseif(CLR_CMAKE_TARGET_OSX)
set(JIT_EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${JIT_EXPORTS_FILE})
endif()

set_exports_linker_option(${JIT_EXPORTS_FILE})
set(SHARED_LIB_SOURCES ${SOURCES})
endif()

Expand Down
1 change: 1 addition & 0 deletions src/coreclr/src/pal/tests/palsuite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-Wno-sign-compare)
add_compile_options(-Wno-narrowing)
add_compile_options(-fno-builtin)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fpermissive>)
add_compile_options(-Wno-int-to-pointer-cast)
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,9 @@ convert_to_absolute_path(DEF_SOURCES1 ${DEF_SOURCES1})
set(EXPORTS_FILE1 ${CMAKE_CURRENT_BINARY_DIR}/dlltest1.exports)
generate_exports_file(${DEF_SOURCES1} ${EXPORTS_FILE1})

if(CLR_CMAKE_TARGET_LINUX OR CLR_CMAKE_TARGET_FREEBSD OR CLR_CMAKE_TARGET_NETBSD)
set(EXPORTS_LINKER_OPTION1 -Wl,--version-script=${EXPORTS_FILE1})
endif(CLR_CMAKE_TARGET_LINUX OR CLR_CMAKE_TARGET_FREEBSD OR CLR_CMAKE_TARGET_NETBSD)

if(CLR_CMAKE_TARGET_OSX)
set(EXPORTS_LINKER_OPTION1 -Wl,-exported_symbols_list,${EXPORTS_FILE1})
endif(CLR_CMAKE_TARGET_OSX)

if(CLR_CMAKE_TARGET_SUNOS)
# Add linker exports file option
set(EXPORTS_LINKER_OPTION -Wl,-M,${EXPORTS_FILE})
endif(CLR_CMAKE_TARGET_SUNOS)
if(CLR_CMAKE_HOST_UNIX)
set_exports_linker_option(${EXPORTS_FILE})
endif(CLR_CMAKE_HOST_UNIX)

set(DLL1SOURCES dlltest1.cpp)
add_library(paltest_pal_sxs_test1_dll1 SHARED ${DLL1SOURCES})
Expand Down
47 changes: 33 additions & 14 deletions src/coreclr/tryrun.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,21 @@ macro(set_cache_value)
set(${ARGV0}__TRYRUN_OUTPUT "dummy output" CACHE STRING "Output from TRY_RUN" FORCE)
endmacro()

if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv6-alpine-linux-musleabihf OR
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv7-alpine-linux-musleabihf OR
EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv6-alpine-linux-musleabihf OR
EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/aarch64-alpine-linux-musl)

SET(ALPINE_LINUX 1)
else()
SET(ALPINE_LINUX 0)
if(EXISTS ${CROSS_ROOTFS}/bin/freebsd-version)
set(FREEBSD 1)
set(CMAKE_SYSTEM_NAME FreeBSD)
set(CLR_CMAKE_TARGET_OS FreeBSD)
else()
SET(FREEBSD 0)
endif()

set(ALPINE_LINUX 1)
elseif(EXISTS ${CROSS_ROOTFS}/bin/freebsd-version)
set(FREEBSD 1)
set(CMAKE_SYSTEM_NAME FreeBSD)
set(CLR_CMAKE_TARGET_OS FreeBSD)
elseif(EXISTS ${CROSS_ROOTFS}/usr/platform/i86pc)
set(ILLUMOS 1)
set(CLR_CMAKE_TARGET_OS SunOS)
endif()

if(TARGET_ARCH_NAME MATCHES "^(armel|arm|arm64|x86)$" OR FREEBSD)
if(TARGET_ARCH_NAME MATCHES "^(armel|arm|arm64|x86)$" OR FREEBSD OR ILLUMOS)
set_cache_value(FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL_EXITCODE 1)
set_cache_value(GETPWUID_R_SETS_ERRNO_EXITCODE 0)
set_cache_value(HAS_POSIX_SEMAPHORES_EXITCODE 0)
Expand Down Expand Up @@ -68,11 +67,31 @@ if(TARGET_ARCH_NAME MATCHES "^(armel|arm|arm64|x86)$" OR FREEBSD)
set_cache_value(HAVE_BROKEN_FIFO_KEVENT_EXITCODE 1)
set_cache_value(HAVE_PROCFS_MAPS 0)
set_cache_value(HAVE_PROCFS_STAT 0)
set_cache_value(HAVE_PROCFS_STATUS 0)
set_cache_value(HAVE_PROCFS_STATUS_EXITCODE 0)
set_cache_value(GETPWUID_R_SETS_ERRNO 0)
set_cache_value(UNGETC_NOT_RETURN_EOF 0)
set_cache_value(HAVE_COMPATIBLE_ILOGBNAN 1)
set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 0)
elseif(ILLUMOS)
set_cache_value(GETPWUID_R_SETS_ERRNO_EXITCODE 1)
set_cache_value(HAVE_COMPATIBLE_ACOS_EXITCODE 1)
set_cache_value(HAVE_COMPATIBLE_ASIN_EXITCODE 1)
set_cache_value(HAVE_COMPATIBLE_ATAN2_EXITCODE 1)
set_cache_value(HAVE_COMPATIBLE_POW_EXITCODE 1)
set_cache_value(HAVE_COMPATIBLE_ILOGBNAN_EXITCODE 0)
set_cache_value(HAVE_COMPATIBLE_LOG10_EXITCODE 1)
set_cache_value(HAVE_COMPATIBLE_LOG_EXITCODE 1)
set_cache_value(HAVE_LARGE_SNPRINTF_SUPPORT_EXITCODE 1)
set_cache_value(HAVE_PROCFS_CTL_EXITCODE 1)
set_cache_value(HAVE_PROCFS_STATUS_EXITCODE 1)
set_cache_value(HAVE_CLOCK_THREAD_CPUTIME_EXITCODE 1)
set_cache_value(SSCANF_CANNOT_HANDLE_MISSING_EXPONENT_EXITCODE 1)
set_cache_value(SSCANF_SUPPORT_ll_EXITCODE 1)
set_cache_value(UNGETC_NOT_RETURN_EOF_EXITCODE 0)
set_cache_value(COMPILER_SUPPORTS_W_CLASS_MEMACCESS 1)
set_cache_value(HAVE_SET_MAX_VARIABLE 1)
set_cache_value(HAVE_FULLY_FEATURED_PTHREAD_MUTEXES 1)
set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 0)
endif()
else()
message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, arm64 and x86 are supported!")
Expand Down
Loading

0 comments on commit 43ae9af

Please sign in to comment.