diff options
author | Gustavo Zacarias <gustavo@zacarias.com.ar> | 2014-05-25 19:12:57 -0300 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2014-07-30 20:25:10 +0200 |
commit | 169141a3eb0dc009a49895ebdc255bfc869ed5af (patch) | |
tree | 7a551c44038f731a936c19b4f0a15624332589fc /package/gcc | |
parent | 82cf4f00ac11fb08eff0f39a6c264d75f4ea0817 (diff) | |
download | buildroot-169141a3eb0dc009a49895ebdc255bfc869ed5af.tar.gz buildroot-169141a3eb0dc009a49895ebdc255bfc869ed5af.zip |
gcc-final: disable shared build for static
Disable shared build for host-gcc-final when building for static targets.
We really want static or shared, there's no such thing as "preferring static"
since we can't choose with any degree of granularity for which packages.
And it confuses linking scripts having both available at the same time. Fixes:
http://autobuild.buildroot.net/results/c54/c54bdf88eff6d60c7001cb0e2cb6792cc75178db/
[Thomas: slightly amend the commit to factorize the installation of
static libraries.]
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/gcc')
-rw-r--r-- | package/gcc/gcc-final/gcc-final.mk | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk index 622dcf2c72..44b956196a 100644 --- a/package/gcc/gcc-final/gcc-final.mk +++ b/package/gcc/gcc-final/gcc-final.mk @@ -35,7 +35,7 @@ define HOST_GCC_FINAL_CONFIGURE_CMDS ./configure \ --prefix="$(HOST_DIR)/usr" \ --sysconfdir="$(HOST_DIR)/etc" \ - --enable-shared --enable-static \ + --enable-static \ $(QUIET) $(HOST_GCC_FINAL_CONF_OPT) \ ) endef @@ -54,6 +54,13 @@ HOST_GCC_FINAL_CONF_OPT = \ $(DISABLE_LARGEFILE) \ --with-build-time-tools=$(HOST_DIR)/usr/$(GNU_TARGET_NAME)/bin +# Disable shared libs like libstdc++ if we do static since it confuses linking +ifeq ($(BR2_PREFER_STATIC_LIB),y) +HOST_GCC_FINAL_CONF_OPT += --disable-shared +else +HOST_GCC_FINAL_CONF_OPT += --enable-shared +endif + ifeq ($(BR2_GCC_ENABLE_OPENMP),y) HOST_GCC_FINAL_CONF_OPT += --enable-libgomp else @@ -141,17 +148,29 @@ endif endif ifneq ($(HOST_GCC_FINAL_USR_LIBS),) -define HOST_GCC_FINAL_INSTALL_USR_LIBS - mkdir -p $(TARGET_DIR)/usr/lib +define HOST_GCC_FINAL_INSTALL_STATIC_LIBS for i in $(HOST_GCC_FINAL_USR_LIBS) ; do \ - cp -dpf $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*/$${i}.so* \ - $(STAGING_DIR)/usr/lib/ ; \ cp -dpf $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*/$${i}.a \ $(STAGING_DIR)/usr/lib/ ; \ + done +endef + +ifeq ($(BR2_PREFER_STATIC_LIB),) +define HOST_GCC_FINAL_INSTALL_SHARED_LIBS + for i in $(HOST_GCC_FINAL_USR_LIBS) ; do \ + cp -dpf $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*/$${i}.so* \ + $(STAGING_DIR)/usr/lib/ ; \ cp -dpf $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*/$${i}.so* \ $(TARGET_DIR)/usr/lib/ ; \ done endef +endif + +define HOST_GCC_FINAL_INSTALL_USR_LIBS + mkdir -p $(TARGET_DIR)/usr/lib + $(HOST_GCC_FINAL_INSTALL_STATIC_LIBS) + $(HOST_GCC_FINAL_INSTALL_SHARED_LIBS) +endef HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_USR_LIBS endif |