Skip to content

Commit 0ca07a2

Browse files
committed
Suppress clang-16 warnings
1 parent 27341c2 commit 0ca07a2

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed

eng/common/native/init-compiler.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ if [ -z "$CLR_CC" ]; then
6363
# Set default versions
6464
if [ -z "$majorVersion" ]; then
6565
# note: gcc (all versions) and clang versions higher than 6 do not have minor version in file name, if it is zero.
66-
if [ "$compiler" = "clang" ]; then versions="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"
66+
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"
6767
elif [ "$compiler" = "gcc" ]; then versions="12 11 10 9 8 7 6 5 4.9"; fi
6868

6969
for version in $versions; do

eng/native/configurecompiler.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,14 @@ if (CLR_CMAKE_HOST_UNIX)
453453
add_compile_options(-Wno-incompatible-ms-struct)
454454

455455
add_compile_options(-Wno-reserved-identifier)
456+
457+
# clang 16.0 introduced buffer hardening https://discourse.llvm.org/t/rfc-c-buffer-hardening/65734
458+
# which we are not conforming to yet.
459+
add_compile_options(-Wno-unsafe-buffer-usage)
460+
461+
# other clang 16.0 suppressions
462+
add_compile_options(-Wno-single-bit-bitfield-constant-conversion)
463+
add_compile_options(-Wno-cast-function-type-strict)
456464
else()
457465
add_compile_options(-Wno-uninitialized)
458466
add_compile_options(-Wno-strict-aliasing)

src/coreclr/dlls/mscordbi/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ elseif(CLR_CMAKE_HOST_UNIX)
109109

110110
if(CLR_CMAKE_HOST_LINUX)
111111
add_dependencies(mscordbi pal_redefines_file)
112+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--undefined-version")
112113
endif(CLR_CMAKE_HOST_LINUX)
113114

114115
endif(CLR_CMAKE_HOST_WIN32)

src/native/corehost/apphost/static/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ if(CLR_CMAKE_TARGET_WIN32)
6666
add_linker_flag("/DEF:${CMAKE_CURRENT_SOURCE_DIR}/singlefilehost.def")
6767

6868
else()
69-
if(CLR_CMAKE_TARGET_OSX)
70-
set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/singlefilehost_OSXexports.src)
69+
if(CLR_CMAKE_TARGET_FREEBSD)
70+
set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/singlefilehost_freebsdexports.src)
7171
else()
7272
set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/singlefilehost_unixexports.src)
7373
endif()

src/native/corehost/apphost/static/singlefilehost_OSXexports.src renamed to src/native/corehost/apphost/static/singlefilehost_freebsdexports.src

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ g_dacTable
99

1010
; Used by profilers
1111
MetaDataGetDispenser
12+
13+
; FreeBSD needs to reexport these
14+
__progname
15+
environ

src/native/corehost/apphost/static/singlefilehost_unixexports.src

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,3 @@ g_dacTable
99

1010
; Used by profilers
1111
MetaDataGetDispenser
12-
13-
; FreeBSD needs to reexport these
14-
__progname
15-
environ

0 commit comments

Comments
 (0)