]> git.proxmox.com Git - wasi-libc.git/commitdiff
Fix predefined macros check after recent clang change
authorSam Clegg <sbc@chromium.org>
Fri, 12 Jul 2019 09:21:15 +0000 (02:21 -0700)
committerDan Gohman <sunfish@mozilla.com>
Tue, 16 Jul 2019 14:12:28 +0000 (07:12 -0700)
This is an alternative to #75.

Makefile

index c6170ca88e3dffd6986300b2838e408c2b7a9da7..843c385974488bf47d130d0a6b617e32ccc5da72 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -467,9 +467,15 @@ finish: startup_files libc
        # which we don't need to track here. For the __*_ATOMIC_*_LOCK_FREE
        # macros, squash individual compiler names to attempt, toward keeping
        # these files compiler-independent.
+       #
+       # We have to add `-isystem $(SYSROOT_INC)` because otherwise clang puts
+       # its builtin include path first, which produces compiler-specific
+       # output.
+       #
        # 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.
        "$(WASM_CC)" $(WASM_CFLAGS) "$(SYSROOT_SHARE)/include-all.c" \
+           -isystem $(SYSROOT_INC) \
            -E -dM -Wno-\#warnings \
            -D_ALL_SOURCE \
            -U__llvm__ \