From patchwork Sun May 25 22:12:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Zacarias X-Patchwork-Id: 352302 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id C7A01140091 for ; Mon, 26 May 2014 08:13:59 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 171298A395; Sun, 25 May 2014 22:13:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JCZpY6Aid9lt; Sun, 25 May 2014 22:13:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 75AE289CC7; Sun, 25 May 2014 22:13:58 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id EDC811BF9D8 for ; Sun, 25 May 2014 22:13:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id EAB8A84375 for ; Sun, 25 May 2014 22:13:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2aeJXaajNJwY for ; Sun, 25 May 2014 22:13:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from loknar.toptech.com.ar (loknar.toptech.com.ar [78.46.79.162]) by whitealder.osuosl.org (Postfix) with ESMTPS id 0F47683CFD for ; Sun, 25 May 2014 22:13:55 +0000 (UTC) Received: from asgard (host213.190-31-126.telecom.net.ar [190.31.126.213]) (authenticated bits=0) by loknar.toptech.com.ar (8.14.8/8.14.8) with ESMTP id s4PMDnLm020376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 25 May 2014 22:13:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zacarias.com.ar; s=dkey; t=1401056033; bh=ftPClPcweJ2Pjs/4wdVJOigsHPAo1y3D1VF8ZVbwnG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Pm8FnSL4GBwOVExaqJAxWU8r84BTOgCs6DnEpnSKJ7l4ps8+CtJLSg7B4Ml1n6JW1 rmRY4ryIoF151NTes0oIpVsywu/pSWs/X9voHDcUlQVEZHBb3dKd7d8s+q5Pg8G63I UbC9ebRkXCAjaxWyX2NCQQ7zYXVg0n5Yw132RQkg= Received: by asgard (sSMTP sendmail emulation); Sun, 25 May 2014 19:13:22 -0300 From: Gustavo Zacarias To: buildroot@busybox.net Date: Sun, 25 May 2014 19:12:57 -0300 Message-Id: <1401055980-28742-3-git-send-email-gustavo@zacarias.com.ar> X-Mailer: git-send-email 1.8.5.5 In-Reply-To: <1401055980-28742-1-git-send-email-gustavo@zacarias.com.ar> References: <1401055980-28742-1-git-send-email-gustavo@zacarias.com.ar> X-Virus-Scanned: clamav-milter 0.98.1 at loknar X-Virus-Status: Clean Subject: [Buildroot] [WIP PATCH 2/5] gcc-final: disable shared build for static X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net 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/ Signed-off-by: Gustavo Zacarias --- package/gcc/gcc-final/gcc-final.mk | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk index 622dcf2..366dc42 100644 --- a/package/gcc/gcc-final/gcc-final.mk +++ b/package/gcc/gcc-final/gcc-final.mk @@ -26,7 +26,7 @@ HOST_GCC_FINAL_SUBDIR = build HOST_GCC_FINAL_PRE_CONFIGURE_HOOKS += HOST_GCC_CONFIGURE_SYMLINK -define HOST_GCC_FINAL_CONFIGURE_CMDS +define HOST_GCC_FINAL_CONFIGURE_CMDS (cd $(HOST_GCC_FINAL_SRCDIR) && rm -rf config.cache; \ $(HOST_CONFIGURE_OPTS) \ CFLAGS="$(HOST_CFLAGS)" \ @@ -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,6 +148,15 @@ endif endif ifneq ($(HOST_GCC_FINAL_USR_LIBS),) +ifeq ($(BR2_PREFER_STATIC_LIB),y) +define HOST_GCC_FINAL_INSTALL_USR_LIBS + mkdir -p $(TARGET_DIR)/usr/lib + for i in $(HOST_GCC_FINAL_USR_LIBS) ; do \ + cp -dpf $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*/$${i}.a \ + $(STAGING_DIR)/usr/lib/ ; \ + done +endef +else define HOST_GCC_FINAL_INSTALL_USR_LIBS mkdir -p $(TARGET_DIR)/usr/lib for i in $(HOST_GCC_FINAL_USR_LIBS) ; do \ @@ -152,6 +168,7 @@ define HOST_GCC_FINAL_INSTALL_USR_LIBS $(TARGET_DIR)/usr/lib/ ; \ done endef +endif HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_USR_LIBS endif