From df950f4cfddd6696fe72f51d4260152f08bd643f Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 29 Sep 2025 12:14:48 -0700 Subject: [PATCH] prereq: use staging_dir's compiler Fixes compilation with missing OS GCC. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/20350 Signed-off-by: Hauke Mehrtens --- 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 ba95f7eb62e..af1d4b2fc20 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 23287eade47..ea018df345b 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))) -- 2.47.3