File tree 7 files changed +37
-8
lines changed
native/corehost/apphost/static
7 files changed +37
-8
lines changed Original file line number Diff line number Diff line change @@ -367,6 +367,15 @@ if (CLR_CMAKE_HOST_UNIX)
367
367
add_compile_options (-Wno-incompatible-ms-struct)
368
368
369
369
add_compile_options (-Wno-reserved-identifier)
370
+
371
+ # clang 16.0 introduced buffer hardening https://discourse.llvm.org/t/rfc-c-buffer-hardening/65734
372
+ # which we are not conforming to yet.
373
+ add_compile_options (-Wno-unsafe-buffer-usage)
374
+
375
+ # other clang 16.0 suppressions
376
+ add_compile_options (-Wno-single-bit-bitfield-constant-conversion)
377
+ add_compile_options (-Wno-cast-function-type -strict)
378
+ add_compile_options (-Wno-incompatible-function-pointer-types-strict)
370
379
else ()
371
380
add_compile_options (-Wno-unknown-pragmas)
372
381
add_compile_options (-Wno-uninitialized)
Original file line number Diff line number Diff line change @@ -46,8 +46,8 @@ if [[ -z "$CLR_CC" ]]; then
46
46
# Set default versions
47
47
if [[ -z " $majorVersion " ]]; then
48
48
# note: gcc (all versions) and clang versions higher than 6 do not have minor version in file name, if it is zero.
49
- if [[ " $compiler " == " clang" ]]; then versions=( 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 )
50
- elif [[ " $compiler " == " gcc" ]]; then versions=( 11 10 9 8 7 6 5 4.9 ); fi
49
+ if [[ " $compiler " == " clang" ]]; then versions=( 16 15 14 13 12 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 )
50
+ elif [[ " $compiler " == " gcc" ]]; then versions=( 12 11 10 9 8 7 6 5 4.9 ); fi
51
51
52
52
for version in " ${versions[@]} " ; do
53
53
parts=(${version// ./ } )
Original file line number Diff line number Diff line change @@ -99,6 +99,17 @@ elseif(CLR_CMAKE_HOST_UNIX)
99
99
mscordaccore
100
100
)
101
101
102
+ # Before llvm 16, lld was setting `--undefined-version` by default. The default was
103
+ # flipped to `--no-undefined-version` in lld 16, so we will explicitly set it to
104
+ # `--undefined-version` for our use-case.
105
+ include (CheckLinkerFlag OPTIONAL )
106
+ if (COMMAND check_linker_flag)
107
+ check_linker_flag(CXX -Wl,--undefined-version LINKER_SUPPORTS_UNDEFINED_VERSION)
108
+ if (LINKER_SUPPORTS_UNDEFINED_VERSION)
109
+ add_linker_flag(-Wl,--undefined-version )
110
+ endif (LINKER_SUPPORTS_UNDEFINED_VERSION)
111
+ endif (COMMAND check_linker_flag)
112
+
102
113
# COREDBI_LIBRARIES is mentioned twice because ld is one pass linker and will not find symbols
103
114
# if they are defined after they are used. Having all libs twice makes sure that ld will actually
104
115
# find all symbols.
Original file line number Diff line number Diff line change @@ -51,6 +51,15 @@ if(CMAKE_C_COMPILER_ID STREQUAL Clang)
51
51
add_compile_options (-Wthread-safety)
52
52
add_compile_options (-Wno-thread-safety-analysis)
53
53
add_compile_options (-Wno-reserved-identifier)
54
+
55
+ # clang 16.0 introduced buffer hardening https://discourse.llvm.org/t/rfc-c-buffer-hardening/65734
56
+ # which we are not conforming to yet.
57
+ add_compile_options (-Wno-unsafe-buffer-usage)
58
+
59
+ # other clang 16.0 suppressions
60
+ add_compile_options (-Wno-single-bit-bitfield-constant-conversion)
61
+ add_compile_options (-Wno-cast-function-type -strict)
62
+ add_compile_options (-Wno-incompatible-function-pointer-types-strict)
54
63
elseif (CMAKE_C_COMPILER_ID STREQUAL GNU)
55
64
add_compile_options (-Wno-stringop-truncation)
56
65
endif ()
Original file line number Diff line number Diff line change @@ -73,8 +73,8 @@ if(CLR_CMAKE_TARGET_WIN32)
73
73
add_linker_flag("/DEF:${CMAKE_CURRENT_SOURCE_DIR} /singlefilehost.def" )
74
74
75
75
else ()
76
- if (CLR_CMAKE_TARGET_OSX )
77
- set (DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR} /singlefilehost_OSXexports .src)
76
+ if (CLR_CMAKE_TARGET_FREEBSD )
77
+ set (DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR} /singlefilehost_freebsdexports .src)
78
78
else ()
79
79
set (DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR} /singlefilehost_unixexports.src)
80
80
endif ()
Original file line number Diff line number Diff line change @@ -9,3 +9,7 @@ g_dacTable
9
9
10
10
; Used by profilers
11
11
MetaDataGetDispenser
12
+
13
+ ; FreeBSD needs to reexport these
14
+ __progname
15
+ environ
Original file line number Diff line number Diff line change @@ -9,7 +9,3 @@ g_dacTable
9
9
10
10
; Used by profilers
11
11
MetaDataGetDispenser
12
-
13
- ; FreeBSD needs to reexport these
14
- __progname
15
- environ
You can’t perform that action at this time.
0 commit comments