[openwrt/openwrt] prereq: use staging_dir's compiler

LEDE Commits lede-commits at lists.infradead.org
Sun Oct 19 15:56:24 PDT 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/df950f4cfddd6696fe72f51d4260152f08bd643f

commit df950f4cfddd6696fe72f51d4260152f08bd643f
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Mon Sep 29 12:14:48 2025 -0700

    prereq: use staging_dir's compiler
    
    Fixes compilation with missing OS GCC.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20350
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 include/prereq-build.mk | 2 +-
 include/prereq.mk       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/prereq-build.mk b/include/prereq-build.mk
index ba95f7eb62..af1d4b2fc2 100644
--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk
@@ -237,7 +237,7 @@ endif
 
 $(STAGING_DIR_HOST)/bin/mkhash: $(SCRIPT_DIR)/mkhash.c
 	mkdir -p $(dir $@)
-	$(CC) -O2 -I$(TOPDIR)/tools/include -o $@ $<
+	$(STAGING_DIR_HOST)/bin/gcc -O2 -I$(TOPDIR)/tools/include -o $@ $<
 
 $(STAGING_DIR_HOST)/bin/xxd: $(SCRIPT_DIR)/xxdi.pl
 	$(LN) $< $@
diff --git a/include/prereq.mk b/include/prereq.mk
index 23287eade4..ea018df345 100644
--- a/include/prereq.mk
+++ b/include/prereq.mk
@@ -71,7 +71,7 @@ endef
 # 4: optional link library test (example -lncurses)
 define RequireCHeader
   define Require/$(1)
-    echo 'int main(int argc, char **argv) { $(3); return 0; }' | gcc -include $(1) -x c -o $(TMP_DIR)/a.out - $(4)
+    echo 'int main(int argc, char **argv) { $(3); return 0; }' | $(STAGING_DIR_HOST)/bin/gcc -include $(1) -x c -o $(TMP_DIR)/a.out - $(4)
   endef
 
   $$(eval $$(call Require,$(1),$(2)))




More information about the lede-commits mailing list