Skip to content

Commit ab416e9

Browse files
authored
Support building against clang 18 (#100258)
This is a targeted backport from a few other PRs that makes it possible to build dotnet/runtme's 8.0 branch on Fedora 40 which includes clang 18. - dotnet/arcade#14572 - #94782 - #99811
1 parent 3f774aa commit ab416e9

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
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="17 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"
66+
if [ "$compiler" = "clang" ]; then versions="18 17 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="13 12 11 10 9 8 7 6 5 4.9"; fi
6868

6969
for version in $versions; do

eng/native/configurecompiler.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,9 @@ if (CLR_CMAKE_HOST_UNIX)
590590
# other clang 16.0 suppressions
591591
add_compile_options(-Wno-single-bit-bitfield-constant-conversion)
592592
add_compile_options(-Wno-cast-function-type-strict)
593+
594+
# clang 18.1 supressions
595+
add_compile_options(-Wno-switch-default)
593596
else()
594597
add_compile_options(-Wno-uninitialized)
595598
add_compile_options(-Wno-strict-aliasing)

src/coreclr/pal/src/include/pal/palinternal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ function_name() to call the system's implementation
426426
#undef va_start
427427
#undef va_end
428428
#undef va_copy
429+
#undef va_arg
429430
#undef stdin
430431
#undef stdout
431432
#undef stderr

0 commit comments

Comments
 (0)