contrib/wasi-libc/llvm-14.patch
2022-04-10 12:25:50 +10:00

31 lines
1.5 KiB
Diff

From c06cecb74c8b7662305235aac10921e81efd602d Mon Sep 17 00:00:00 2001
From: Mike Hommey <mh@glandium.org>
Date: Fri, 8 Apr 2022 10:38:53 +0900
Subject: [PATCH] Adjust the Makefile for LLVM 14
Rebased by Danny Rawlins, crux at romster dot me
diff -pruN wasi-libc-3eb02a798b3ec0048c39d2ab8b97a70575892a5a.orig/Makefile wasi-libc-3eb02a798b3ec0048c39d2ab8b97a70575892a5a/Makefile
--- wasi-libc-3eb02a798b3ec0048c39d2ab8b97a70575892a5a.orig/Makefile 2022-04-09 09:44:41.031980458 +0000
+++ wasi-libc-3eb02a798b3ec0048c39d2ab8b97a70575892a5a/Makefile 2022-04-09 09:48:10.370241521 +0000
@@ -530,6 +530,7 @@ check-symbols: startup_files libc
@#
@# TODO: Undefine __FLOAT128__ for now since it's not in clang 8.0.
@# TODO: Filter out __FLT16_* for now, as not all versions of clang have these.
+ @# TODO: Filter out __NO_MATH_ERRNO_ and a few __*WIDTH__ that are new to clang 14.
$(WASM_CC) $(CFLAGS) "$(SYSROOT_SHARE)/include-all.c" \
-isystem $(SYSROOT_INC) \
-std=gnu17 \
@@ -548,8 +549,11 @@ check-symbols: startup_files libc
-U__GNUC_PATCHLEVEL__ \
-U__VERSION__ \
-U__FLOAT128__ \
+ -U__NO_MATH_ERRNO__ \
+ -U__BITINT_MAXWIDTH__ \
| sed -e 's/__[[:upper:][:digit:]]*_ATOMIC_\([[:upper:][:digit:]_]*\)_LOCK_FREE/__compiler_ATOMIC_\1_LOCK_FREE/' \
| 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"
# Check that the computed metadata matches the expected metadata.