]> git.proxmox.com Git - wasi-libc.git/commitdiff
Adjust Makefile for LLVM trunk (16) as of 2022-11-08 (#344)
authorMike Hommey <mh@glandium.org>
Wed, 7 Dec 2022 16:27:06 +0000 (01:27 +0900)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 2 Aug 2023 10:24:08 +0000 (12:24 +0200)
https://github.com/llvm/llvm-project/commit/1e4e2433bcd1a0296ef1043c462252f0d087d90c
enabled sign-ext and mutable-globals by default, which adds
corresponding __wasm_-prefixed #defines.

https://github.com/llvm/llvm-project/commit/9e956995db1fc7e792e3dfb3a465a52626195557
changed the definition of __GNUC_VA_LIST to match that of GCC headers,
leaving it without a value.

Makefile
expected/wasm32-wasi/posix/predefined-macros.txt

index 37551cb51e0b5a91e097c974dbe8c2ef08bdecfc..f8ae4d6bd8c17eaa63c1fd506fef9ef49d42cb22 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -650,6 +650,9 @@ check-symbols: startup_files libc
        @# TODO: Filter out __NO_MATH_ERRNO_ and a few __*WIDTH__ that are new to clang 14.
        @# TODO: clang defined __FLT_EVAL_METHOD__ until clang 15, so we force-undefine it
        @# for older versions.
+       @# TODO: Undefine __wasm_mutable_globals__ and __wasm_sign_ext__, that are new to
+       @# clang 16 for -mcpu=generic.
+       @# TODO: As of clang 16, __GNUC_VA_LIST is #defined without a value.
        $(CC) $(CFLAGS) "$(SYSROOT_SHARE)/include-all.c" \
            -isystem $(SYSROOT_INC) \
            -std=gnu17 \
@@ -663,6 +666,8 @@ check-symbols: startup_files libc
            -U__clang_version__ \
            -U__clang_literal_encoding__ \
            -U__clang_wide_literal_encoding__ \
+           -U__wasm_mutable_globals__ \
+           -U__wasm_sign_ext__ \
            -U__GNUC__ \
            -U__GNUC_MINOR__ \
            -U__GNUC_PATCHLEVEL__ \
@@ -672,6 +677,7 @@ check-symbols: startup_files libc
            -U__BITINT_MAXWIDTH__ \
            -U__FLT_EVAL_METHOD__ -Wno-builtin-macro-redefined \
            | sed -e 's/__[[:upper:][:digit:]]*_ATOMIC_\([[:upper:][:digit:]_]*\)_LOCK_FREE/__compiler_ATOMIC_\1_LOCK_FREE/' \
+           | sed -e 's/__GNUC_VA_LIST $$/__GNUC_VA_LIST 1/' \
            | grep -v '^#define __FLT16_' \
            | grep -v '^#define __\(BOOL\|INT_\(LEAST\|FAST\)\(8\|16\|32\|64\)\|INT\|LONG\|LLONG\|SHRT\)_WIDTH__' \
            > "$(SYSROOT_SHARE)/predefined-macros.txt"
index ac909209ea7f1dbe2a6bb63c264fdb8e703818ad..5523a77c8dd0c0b5beb0d544fc6f44ace527b6c4 100644 (file)
 #define __wasm__ 1
 #define __wasm_atomics__ 1
 #define __wasm_bulk_memory__ 1
-#define __wasm_mutable_globals__ 1
-#define __wasm_sign_ext__ 1
 #define _tolower(a) ((a)|0x20)
 #define _toupper(a) ((a)&0x5f)
 #define acos(x) __tg_real_complex(acos, (x))