Page MenuHomeFreeBSD

D31532.1795623243.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D31532.1795623243.diff

diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -273,7 +273,14 @@
# Only allow .TARGET when not using PROGS as it has the same syntax
# per PROG which is ambiguous with this syntax. This is only needed
# for PROG_VARS vars.
-.if !defined(_RECURSING_PROGS)
+#
+# Some directories (currently just clang) also need to disable this since
+# CFLAGS.${COMPILER_TYPE}, CFLAGS.${.IMPSRC:T} and CFLAGS.${.TARGET:T} all live
+# in the same namespace, meaning that, for example, GCC builds of clang pick up
+# CFLAGS.clang via CFLAGS.${.TARGET:T} and thus try to pass Clang-specific
+# flags. Ideally the different sources of CFLAGS would be namespaced to avoid
+# collisions.
+.if !defined(_RECURSING_PROGS) && !defined(NO_TARGET_FLAGS)
.if ${MK_WARNS} != "no"
CFLAGS+= ${CWARNFLAGS.${.TARGET:T}}
.endif
diff --git a/usr.bin/clang/clang/Makefile b/usr.bin/clang/clang/Makefile
--- a/usr.bin/clang/clang/Makefile
+++ b/usr.bin/clang/clang/Makefile
@@ -34,4 +34,7 @@
LIBADD+= z
+# Ensure we don't add CFLAGS.clang when using GCC
+NO_TARGET_FLAGS=
+
.include "../clang.prog.mk"

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 25, 4:14 PM (3 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41994247
Default Alt Text
D31532.1795623243.diff (1 KB)

Event Timeline