Skip to content

Commit 06fac82

Browse files
committed
Auto merge of #31388 - gmbonnet:compiler-rt-werror, r=alexcrichton
Without this patch, `compiler-rt` fails to build when the `CFLAGS` environment variable contains a `-Werror=*` flag (for example `-Werror=format-security`). The build system was removing only the `-Werror` part from the flag, thus passing an unrecognized `=*` (for example `=format-security`) argument to gcc.
2 parents 2ad6dc2 + e9dfc94 commit 06fac82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mk/rt.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ COMPRT_AR_$(1) := $$(AR_$(1))
245245
# We chomp -Werror here because GCC warns about the type signature of
246246
# builtins not matching its own and the build fails. It's a bit hacky,
247247
# but what can we do, we're building libclang-rt using GCC ......
248-
COMPRT_CFLAGS_$(1) := $$(subst -Werror,,$$(CFG_GCCISH_CFLAGS_$(1))) -std=c99
248+
COMPRT_CFLAGS_$(1) := $$(filter-out -Werror -Werror=*,$$(CFG_GCCISH_CFLAGS_$(1))) -std=c99
249249

250250
# FreeBSD Clang's packaging is problematic; it doesn't copy unwind.h to
251251
# the standard include directory. This should really be in our changes to

0 commit comments

Comments
 (0)