From a57d3368a9e78cd5433bb7d144eaab545599a306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrich=20Sp=C3=B6rlein?= Date: Tue, 10 Aug 2021 19:06:47 +0200 Subject: [PATCH] Fix parallel builds w/ LTO on systems where make is not GNU make. When compiling with LTO, the lto-wrapper of GCC will detect the presence of parallelism via the environment, and either call $MAKE or simply `make` (and the detection of a jobserver messes this up for FreeBSD). On FreeBSD and other systems, you have to build with `gmake` and the way to have lto-wrapper use the same make(1) is to pass it via the environment. This fixes the (parallel) linking when LTO is active under FreeBSD. --- tmk_core/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index fc2dc68be224..abfd0eb340ba 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -340,7 +340,7 @@ BEGIN = gccversion sizebefore # Note the obj.txt depeendency is there to force linking if a source file is deleted %.elf: $(OBJ) $(MASTER_OUTPUT)/cflags.txt $(MASTER_OUTPUT)/ldflags.txt $(MASTER_OUTPUT)/obj.txt | $(BEGIN) @$(SILENT) || printf "$(MSG_LINKING) $@" | $(AWK_CMD) - $(eval CMD=$(CC) $(ALL_CFLAGS) $(filter-out %.txt,$^) --output $@ $(LDFLAGS)) + $(eval CMD=MAKE=$(MAKE) $(CC) $(ALL_CFLAGS) $(filter-out %.txt,$^) --output $@ $(LDFLAGS)) @$(BUILD_CMD)