Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions eng/native/build-commons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ check_prereqs()

function version { echo "$@" | awk -F. '{ printf("%d%02d%02d\n", $1,$2,$3); }'; }

local cmake_version="$(cmake --version | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+")"
local cmake_version="$(cmake --version | awk '/^cmake version [0-9]+\.[0-9]+\.[0-9]+$/ {print $3}')"

if [[ "$(version "$cmake_version")" -lt "$(version 3.14.2)" ]]; then
echo "Please install CMake 3.14.2 or newer from http://www.cmake.org/download/ or https://apt.kitware.com and ensure it is on your path."; exit 1;
Expand Down Expand Up @@ -385,7 +385,7 @@ done
platform=$(uname)
if [[ "$platform" == "FreeBSD" ]]; then
__NumProc=$(sysctl hw.ncpu | awk '{ print $2+1 }')
elif [[ "$platform" == "NetBSD" ]]; then
elif [[ "$platform" == "NetBSD" || "$platform" == "SunOS" ]]; then
__NumProc=$(($(getconf NPROCESSORS_ONLN)+1))
elif [[ "$platform" == "Darwin" ]]; then
__NumProc=$(($(getconf _NPROCESSORS_ONLN)+1))
Expand Down
8 changes: 5 additions & 3 deletions eng/native/configureplatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ if(NOT CLR_CMAKE_TARGET_EMSCRIPTEN)
# Skip check_pie_supported call on Android as ld from llvm toolchain with NDK API level 21
# complains about missing linker flag `-no-pie` (while level 28's ld does support this flag,
# but since we know that PIE is supported, we can safely skip this redundant check).
if(NOT CLR_CMAKE_TARGET_ANDROID)
#
# The default linker on Solaris also does not support PIE.
if(NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_SUNOS)
# All code we build should be compiled as position independent
get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)
if("CXX" IN_LIST languages)
Expand All @@ -374,10 +376,10 @@ if(NOT CLR_CMAKE_TARGET_EMSCRIPTEN)
message(WARNING "PIE is not supported at link time: ${PIE_SUPPORT_OUTPUT}.\n"
"PIE link options will not be passed to linker.")
endif()
endif(NOT CLR_CMAKE_TARGET_ANDROID)
endif()

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif(NOT CLR_CMAKE_TARGET_EMSCRIPTEN)
endif()

string(TOLOWER "${CMAKE_BUILD_TYPE}" LOWERCASE_CMAKE_BUILD_TYPE)
if(LOWERCASE_CMAKE_BUILD_TYPE STREQUAL debug)
Expand Down
2 changes: 2 additions & 0 deletions eng/native/init-distro-rid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ initDistroRidGlobal()
distroRid="android-$buildArch"
elif [ "$targetOs" = "FreeBSD" ]; then
distroRid="freebsd-$buildArch"
elif [ "$targetOs" = "SunOS" ]; then
distroRid="sunos-$buildArch"
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/tests/setup-stress-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ fi
packageDir=$(<"${CoreDisToolsPackagePathOutputFile}")

# Get library path
libPath=`find $packageDir | grep $rid | grep -m 1 libcoredistools`
libPath="$(find "$packageDir" -path "*$rid*libcoredistools*" -print | head -n 1)"
echo "libPath to be used: ${libPath}"

if [ ! -e $libPath ] || [ -z "$libPath" ]; then
Expand Down
5 changes: 5 additions & 0 deletions src/libraries/Native/Unix/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ elseif (CLR_CMAKE_TARGET_FREEBSD)
set(CMAKE_REQUIRED_INCLUDES ${CROSS_ROOTFS}/usr/local/include)
elseif (CLR_CMAKE_TARGET_NETBSD)
set(PAL_UNIX_NAME \"NETBSD\")
elseif (CLR_CMAKE_TARGET_SUNOS)
set(PAL_UNIX_NAME \"SUNOS\")
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} /opt/local/include)
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /opt/local/lib)
include_directories(SYSTEM /opt/local/include)
else ()
message(FATAL_ERROR "Unknown platform. Cannot define PAL_UNIX_NAME, used by RuntimeInformation.")
endif ()
Expand Down