freebsd-dev/share/mk
Jessica Clarke c8edd05426 clang: Support building with GCC and DEBUG_FILES disabled
If MK_DEBUG_FILES=no then the Clang link rule has clang as .TARGET,
rather than clang.full, causing the implicit ${CFLAGS.${.TARGET:T}} to
be CFLAGS.clang, and thus pull in flags intended for when your compiler
is Clang, not when linking Clang itself. This doesn't matter if your
compiler is in fact Clang, but it breaks using GCC as, for example,
bsd.sys.mk adds -Qunused-arguments to CFLAGS.clang. This is seen when
trying to build a bootstrap toolchain on Linux where GCC is the system
compiler.

Thus, introduce a new internal NO_TARGET_FLAGS variable that is set by
Clang to disable the addition of these implicit flags. This is a bigger
hammer than necessary, as flags for .o files would be safe, but that is
not needed for Clang.

Note that the same problem does not arise for LDFLAGS when building LLD
with BFD, since our build produces a program called ld.lld, not plain
lld (unlike upstream, where ld.lld is a symlink to lld so they can
support multiple different flavours in one binary).

Suggested by:	sjg
Fixes:		31ba4ce889 ("Allow bootstrapping llvm-tblgen on macOS and Linux")
MFC after:	1 week
Reviewed by:	dim, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D31532
2021-08-24 15:04:25 +01:00
..
atf.test.mk Another round of attempting to squelch -Wdeprecated-declarations, which 2019-09-17 06:07:08 +00:00
auto.obj.mk Ensure .OBJDIR has known value 2017-11-04 21:02:26 +00:00
bsd.arch.inc.mk
bsd.clang-analyze.mk Move all sources from the llvm project into contrib/llvm-project. 2019-12-20 19:53:05 +00:00
bsd.compat.mk Add build system support for ASAN+UBSAN instrumentation 2021-08-02 14:33:24 +01:00
bsd.compiler.mk bsd.compiler.mk: Fix cross-building from non-FreeBSD 2021-08-12 23:45:09 +01:00
bsd.confs.mk pkgbase: Create a FreeBSD-utilities package and make it the default one 2019-09-05 14:15:47 +00:00
bsd.cpu.mk bsd.cpu.mk: add support for x86-64-v[234] levels as CPUTYPE 2021-08-06 09:33:37 -04:00
bsd.crunchgen.mk rescue: Restore 'make depend' call to fix WITH_META_MODE after r334008. 2018-05-24 18:49:19 +00:00
bsd.dep.mk Emit an error when we seen absolute paths to .o files 2021-06-21 16:13:54 +01:00
bsd.dirs.mk pkgbase: Create a FreeBSD-utilities package and make it the default one 2019-09-05 14:15:47 +00:00
bsd.doc.mk pkgbase: Create a FreeBSD-utilities package and make it the default one 2019-09-05 14:15:47 +00:00
bsd.dtb.mk Introduce bsd.sysdir.mk to consolidate looking for the kernel. 2019-11-21 15:59:33 +00:00
bsd.endian.mk [PowerPC64LE] Set up powerpc.powerpc64le architecture 2020-09-22 23:49:30 +00:00
bsd.files.mk mk: Set the DIR tags based on the files one 2021-01-04 16:20:04 +01:00
bsd.incs.mk bsd.incs.mk: Add support to override tags for a specific include group 2021-01-04 16:21:32 +01:00
bsd.info.mk
bsd.init.mk Update dirdeps.mk et al to latest 2020-11-24 21:45:38 +00:00
bsd.kmod.mk Introduce bsd.sysdir.mk to consolidate looking for the kernel. 2019-11-21 15:59:33 +00:00
bsd.lib.mk Use compressed debug in standalone userland debug files by default 2021-08-04 16:08:40 -04:00
bsd.libnames.mk Remove the MK_LIBCPLUSPLUS option 2021-02-01 09:32:07 +00:00
bsd.linker.mk bsd.linker.mk: Detect LLD when built with PACKAGE_VENDOR 2021-07-20 16:10:22 +01:00
bsd.links.mk Reapply r295227: Stop hiding link install commands. 2017-11-06 19:33:50 +00:00
bsd.man.mk pkgbase: Add an src.conf option for splitting man pages 2021-03-16 07:13:09 +01:00
bsd.mkopt.mk insetad -> instead 2021-06-09 20:17:22 -06:00
bsd.nls.mk Move all of the directory path into the DIR part of the component and make the 2018-05-31 13:26:12 +00:00
bsd.obj.mk NO_OBJ: Always fix .OBJDIR regardless of AUTO_OBJ. 2020-04-07 17:07:04 +00:00
bsd.opts.mk Disable PROFILE option by default 2021-08-07 20:24:36 -04:00
bsd.own.mk Standardize EFI's ESP mount point. 2019-11-20 21:06:29 +00:00
bsd.port.mk
bsd.port.options.mk
bsd.port.post.mk
bsd.port.pre.mk
bsd.port.subdir.mk
bsd.prog.mk Use compressed debug in standalone userland debug files by default 2021-08-04 16:08:40 -04:00
bsd.progs.mk Add build system support for ASAN+UBSAN instrumentation 2021-08-02 14:33:24 +01:00
bsd.README Add build system support for ASAN+UBSAN instrumentation 2021-08-02 14:33:24 +01:00
bsd.sanitizer.mk Fix GCC and -DWITH_CLEAN build after 7bc797e3f3 2021-08-02 16:03:05 +01:00
bsd.snmpmod.mk pkgbase: Put the mibs and defs in the bnsmp package 2021-06-19 17:50:03 +02:00
bsd.subdir.mk Add a guard for broken SUBDIR.${MK_FOO} use 2020-11-16 19:15:11 +00:00
bsd.suffixes-posix.mk
bsd.suffixes.mk Similar to r335710 avoid ccache when linking a .cc file directly. 2019-06-15 17:08:18 +00:00
bsd.symver.mk Remove the SYMVER build option. 2020-04-30 22:08:40 +00:00
bsd.sys.mk clang: Support building with GCC and DEBUG_FILES disabled 2021-08-24 15:04:25 +01:00
bsd.sysdir.mk Introduce bsd.sysdir.mk to consolidate looking for the kernel. 2019-11-21 15:59:33 +00:00
bsd.test.mk Make capsicum test cases fine-grained 2020-10-06 06:45:52 +00:00
dirdeps-options.mk Update dirdeps.mk et al to latest 2020-11-24 21:45:38 +00:00
dirdeps-targets.mk Update dirdeps.mk et al to latest 2020-11-24 21:45:38 +00:00
dirdeps.mk Update dirdeps.mk et al to latest 2020-11-24 21:45:38 +00:00
gendirdeps.mk Update dirdeps.mk et al to latest 2020-11-24 21:45:38 +00:00
googletest.test.inc.mk Work around two -Werror warning issues in googletest, which have been 2020-01-31 18:26:23 +00:00
googletest.test.mk Make capsicum test cases fine-grained 2020-10-06 06:45:52 +00:00
host-target.mk
install-new.mk
kmod.opts.mk Add a kmod.opts.mk. 2019-11-21 18:14:26 +00:00
local.autodep.mk Update dirdeps.mk et al to latest 2020-11-24 21:45:38 +00:00
local.dirdeps-options.mk retire BSD_CRTBEGIN option 2020-01-31 18:04:04 +00:00
local.dirdeps.mk Update dirdeps.mk et al to latest 2020-11-24 21:45:38 +00:00
local.gendirdeps.mk Update dirdeps.mk et al to latest 2020-11-24 21:45:38 +00:00
local.init.mk Include ${.CURDIR}/local.init.mk if it exists 2020-03-31 15:59:29 +00:00
local.meta.sys.mk Update dirdeps.mk et al to latest 2020-11-24 21:45:38 +00:00
local.sys.env.mk AUTO_OBJ: Hide 'creating dirs' output with 'make -s'. 2017-11-08 16:03:58 +00:00
local.sys.mk META_MODE: Delete build targets that fail. 2019-06-15 17:08:28 +00:00
Makefile Install bsd.sysdir.mk. 2019-11-21 19:54:10 +00:00
meta2deps.py Update dirdeps.mk et al to latest 2020-11-24 21:45:38 +00:00
meta2deps.sh Update dirdeps.mk et al to latest 2020-11-24 21:45:38 +00:00
meta.autodep.mk Update dirdeps.mk et al to latest 2020-11-24 21:45:38 +00:00
meta.stage.mk Update dirdeps.mk et al to latest 2020-11-24 21:45:38 +00:00
meta.subdir.mk Update dirdeps.mk et al to latest 2020-11-24 21:45:38 +00:00
meta.sys.mk Update dirdeps.mk et al to latest 2020-11-24 21:45:38 +00:00
netbsd-tests.test.mk
plain.test.mk Feex a cuple of small typos 2018-07-27 10:44:38 +00:00
src.init.mk
src.libnames.mk Simplify and speed up the kyua build 2021-07-02 09:21:05 +01:00
src.lua.mk Add flua to the base system, install to /usr/libexec 2019-11-18 23:21:13 +00:00
src.opts.mk Mark LLDB/CLANG_BOOTSTRAP/LLD_BOOTSTRAP as broken on non-FreeBSD for now 2021-08-17 17:44:52 +01:00
src.sys.env.mk META_MODE: Allow 'make all install' to work with filemon. 2020-01-17 14:29:27 +00:00
src.sys.mk build: provide a default WARNS for all in-tree builds 2020-09-18 17:17:46 +00:00
src.sys.obj.mk tinderbox: Only build clang/lld once if needed. 2018-06-27 16:58:10 +00:00
src.tools.mk ncurses: Add support for terminfo database 2021-02-25 14:25:11 +01:00
stage-install.sh
suite.test.mk make check: suppress echo of kyua binary location 2021-01-16 00:07:50 -06:00
sys.dependfile.mk
sys.mk Add build system support for ASAN+UBSAN instrumentation 2021-08-02 14:33:24 +01:00
tap.test.mk Feex a cuple of small typos 2018-07-27 10:44:38 +00:00
version_gen.awk share and pc-sysinstall: adoption of SPDX licensing ID tags. 2017-11-27 15:28:26 +00:00