Skip to content

Commit a3350c8

Browse files
glandiumjohn-sharratt
authored andcommitted
Adjust Makefile for LLVM trunk (16) as of 2022-11-08 (WebAssembly#344)
llvm/llvm-project@1e4e243 enabled sign-ext and mutable-globals by default, which adds corresponding __wasm_-prefixed #defines. llvm/llvm-project@9e95699 changed the definition of __GNUC_VA_LIST to match that of GCC headers, leaving it without a value.
1 parent 155cc03 commit a3350c8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,9 @@ check-symbols: startup_files libc
660660
@# TODO: Filter out __NO_MATH_ERRNO_ and a few __*WIDTH__ that are new to clang 14.
661661
@# TODO: clang defined __FLT_EVAL_METHOD__ until clang 15, so we force-undefine it
662662
@# for older versions.
663+
@# TODO: Undefine __wasm_mutable_globals__ and __wasm_sign_ext__, that are new to
664+
@# clang 16 for -mcpu=generic.
665+
@# TODO: As of clang 16, __GNUC_VA_LIST is #defined without a value.
663666
$(CC) $(CFLAGS) "$(SYSROOT_SHARE)/include-all.c" \
664667
-isystem $(SYSROOT_INC) \
665668
-std=gnu17 \
@@ -673,6 +676,8 @@ check-symbols: startup_files libc
673676
-U__clang_version__ \
674677
-U__clang_literal_encoding__ \
675678
-U__clang_wide_literal_encoding__ \
679+
-U__wasm_mutable_globals__ \
680+
-U__wasm_sign_ext__ \
676681
-U__GNUC__ \
677682
-U__GNUC_MINOR__ \
678683
-U__GNUC_PATCHLEVEL__ \
@@ -682,6 +687,7 @@ check-symbols: startup_files libc
682687
-U__BITINT_MAXWIDTH__ \
683688
-U__FLT_EVAL_METHOD__ -Wno-builtin-macro-redefined \
684689
| sed -e 's/__[[:upper:][:digit:]]*_ATOMIC_\([[:upper:][:digit:]_]*\)_LOCK_FREE/__compiler_ATOMIC_\1_LOCK_FREE/' \
690+
| sed -e 's/__GNUC_VA_LIST $$/__GNUC_VA_LIST 1/' \
685691
| grep -v '^#define __FLT16_' \
686692
| grep -v '^#define __\(BOOL\|INT_\(LEAST\|FAST\)\(8\|16\|32\|64\)\|INT\|LONG\|LLONG\|SHRT\)_WIDTH__' \
687693
> "$(SYSROOT_SHARE)/predefined-macros.txt"

expected/wasm64-wasi/posix/predefined-macros.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6445,8 +6445,6 @@
64456445
#define __wasm__ 1
64466446
#define __wasm_atomics__ 1
64476447
#define __wasm_bulk_memory__ 1
6448-
#define __wasm_mutable_globals__ 1
6449-
#define __wasm_sign_ext__ 1
64506448
#define _tolower(a) ((a)|0x20)
64516449
#define _toupper(a) ((a)&0x5f)
64526450
#define acos(x) __tg_real_complex(acos, (x))

0 commit comments

Comments
 (0)