[OpenWrt-Devel] build: explicitly unexport CONFIG_SITE
diff mbox

Message ID db18c281ae79cdf649c21d075c68d970588d72a0.1421377326.git.mschiffer@universe-factory.net
State Accepted
Headers show

Commit Message

Matthias Schiffer Jan. 16, 2015, 3:03 a.m. UTC
On systems with CONFIG_SITE in the environment (e.g. OpenSUSE) make will export
the CONFIG_SITE set in include/package.mk by default. This will cause host
builds to get the target site configuration, leading to all kinds of weirdness
(wrong pointer size, wrong endianess).

Fix this by explicitly unexporting CONFIG_SITE. The explicit export for the
target builds overrides the unexport, so the target builds will still correctly
get the site config.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
---

This bug was reported on openwrt-devel by Luiz Angelo Daros de Luca some months
ago, and now I hit it myself.

This should also be backported to BB.

 include/package.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Felix Fietkau Jan. 18, 2015, 12:40 a.m. UTC | #1
On 2015-01-16 04:03, Matthias Schiffer wrote:
> On systems with CONFIG_SITE in the environment (e.g. OpenSUSE) make will export
> the CONFIG_SITE set in include/package.mk by default. This will cause host
> builds to get the target site configuration, leading to all kinds of weirdness
> (wrong pointer size, wrong endianess).
> 
> Fix this by explicitly unexporting CONFIG_SITE. The explicit export for the
> target builds overrides the unexport, so the target builds will still correctly
> get the site config.
> 
> Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Applied in r44019, thanks.

- Felix

Patch
diff mbox

diff --git a/include/package.mk b/include/package.mk
index a1b90da..e85e395 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -95,7 +95,7 @@  CONFIG_SITE:=$(INCLUDE_DIR)/site/$(REAL_GNU_TARGET_NAME)
 CUR_MAKEFILE:=$(filter-out Makefile,$(firstword $(MAKEFILE_LIST)))
 SUBMAKE:=$(NO_TRACE_MAKE) $(if $(CUR_MAKEFILE),-f $(CUR_MAKEFILE))
 PKG_CONFIG_PATH=$(STAGING_DIR)/usr/lib/pkgconfig:$(STAGING_DIR)/usr/share/pkgconfig
-unexport QUIET
+unexport QUIET CONFIG_SITE
 
 ifeq ($(DUMP)$(filter prereq clean refresh update,$(MAKECMDGOALS)),)
   ifneq ($(if $(QUILT),,$(CONFIG_AUTOREBUILD)),)