fixdep: Allow overriding HOSTCC and HOSTLD
authorBen Hutchings <benh@debian.org>
Sat, 13 May 2023 11:03:26 +0000 (13:03 +0200)
committerSalvatore Bonaccorso <carnil@debian.org>
Tue, 12 Aug 2025 03:28:04 +0000 (05:28 +0200)
Forwarded: not-needed

objtool always uses HOSTCC, HOSTLD, and HOSTAR, so we need to override
these on the command line for cross-builds of linux-kbuild.  But it
also builds fixdep which still needs to be native in a cross-build.
Add support for REALHOSTCC and REALHOSTLD variables which, if set,
override HOSTCC and HOSTLD for fixdep only.

Gbp-Pq: Topic debian
Gbp-Pq: Name fixdep-allow-overriding-hostcc-and-hostld.patch

tools/build/Makefile.include

index d7f7e0bc2a18f8787700cebe5e2a1dfad936cbec..2e96af74687cf7c81f452a9794e94067a8fb7303 100644 (file)
@@ -12,7 +12,10 @@ else
 endif
 
 fixdep:
-       $(SILENT_MAKE) -C $(srctree)/tools/build $(OUTPUT)fixdep
+       $(SILENT_MAKE) -C $(srctree)/tools/build \
+               $(if $(REALHOSTCC),HOSTCC=$(REALHOSTCC) KBUILD_HOSTCFLAGS=) \
+               $(if $(REALHOSTLD),HOSTLD=$(REALHOSTLD) KBUILD_HOSTLDFLAGS=) \
+               $(OUTPUT)fixdep
 
 fixdep-clean:
        $(Q)$(MAKE) -C $(srctree)/tools/build clean