Skip to content

Commit

Permalink
Revert changes breaking build on FreeBSD (#7885)
Browse files Browse the repository at this point in the history
* Add clang-versions used on modern FreeBSD versions.

This helps .NET build on FreeBSD.

* Update FreeBSD target

Current release is 12, not 11.

* Fix linking on FreeBSD.

These changes have previously been introduced in `dotnet/runtime`, but been reverted through automated updates later on.

This commit re-introduces them.
  • Loading branch information
josteink authored Sep 12, 2021
1 parent 054309c commit 7366700
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion eng/common/cross/toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ elseif(TARGET_ARCH_NAME STREQUAL "x86")
set(TOOLCHAIN "i686-linux-gnu")
elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
set(triple "x86_64-unknown-freebsd11")
set(triple "x86_64-unknown-freebsd12")
elseif (ILLUMOS)
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
set(TOOLCHAIN "x86_64-illumos")
Expand Down Expand Up @@ -91,6 +91,9 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(CMAKE_CXX_COMPILER_TARGET ${triple})
set(CMAKE_ASM_COMPILER_TARGET ${triple})
set(CMAKE_SYSROOT "${CROSS_ROOTFS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=lld")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fuse-ld=lld")
elseif(ILLUMOS)
set(CMAKE_SYSROOT "${CROSS_ROOTFS}")

Expand Down
2 changes: 1 addition & 1 deletion eng/common/native/find-native-compiler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if [ -z "$CLR_CC" ]; then
# Set default versions
if [ -z "$majorVersion" ]; then
# note: gcc (all versions) and clang versions higher than 6 do not have minor version in file name, if it is zero.
if [ "$compiler" = "clang" ]; then versions=( 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 )
if [ "$compiler" = "clang" ]; then versions=( 12 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 )
elif [ "$compiler" = "gcc" ]; then versions=( 9 8 7 6 5 4.9 ); fi

for version in "${versions[@]}"; do
Expand Down

0 comments on commit 7366700

Please sign in to comment.