From patchwork Thu Oct 10 09:40:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 282186 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 73FA72C00D0 for ; Thu, 10 Oct 2013 20:41:00 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id CA6D632DEA; Thu, 10 Oct 2013 09:40:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EeDuIA93FF+A; Thu, 10 Oct 2013 09:40:53 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 13B7932E16; Thu, 10 Oct 2013 09:40:53 +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 D91F21C2EA3 for ; Thu, 10 Oct 2013 09:40:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D5AFE8C3E2 for ; Thu, 10 Oct 2013 09:40:51 +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 RH5cKGlA5wy4 for ; Thu, 10 Oct 2013 09:40:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sysmic.org (88-191-79-235.rev.poneytelecom.eu [88.191.79.235]) by whitealder.osuosl.org (Postfix) with ESMTPS id 3113E8C3FA for ; Thu, 10 Oct 2013 09:40:51 +0000 (UTC) Received: from localhost.localdomain (mal35-3-82-240-201-171.fbx.proxad.net [82.240.201.171]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jezz) by sysmic.org (Postfix) with ESMTPSA id 1E2E36061D; Thu, 10 Oct 2013 11:40:48 +0200 (CEST) From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= To: buildroot@busybox.net Date: Thu, 10 Oct 2013 11:40:42 +0200 Message-Id: <1381398042-6925-1-git-send-email-jezz@sysmic.org> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Cc: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= Subject: [Buildroot] [PATCH] Compile static versions of gcc libraries 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: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Since default configure options for host packages include --disable-static, gcc was not configured to build static version of its libraries (libgcc.a, libstdc++.a, ...). This patch replace --disable-static by --enable-static in configure command. Notice some options was removed sinces they was ignored by gcc configure script. Once it was compiled, this commit takes care to copy static libraries to $STAGING Signed-off-by: Jérôme Pouiller Tested-by: Baruch Siach --- package/gcc/gcc-final/gcc-final.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk index b396382..49de481 100644 --- a/package/gcc/gcc-final/gcc-final.mk +++ b/package/gcc/gcc-final/gcc-final.mk @@ -26,6 +26,21 @@ HOST_GCC_FINAL_SUBDIR = build HOST_GCC_FINAL_PRE_CONFIGURE_HOOKS += HOST_GCC_CONFIGURE_SYMLINK +define HOST_GCC_FINAL_CONFIGURE_CMDS + (cd $(HOST_GCC_FINAL_SRCDIR) && rm -rf config.cache; \ + $(HOST_CONFIGURE_OPTS) \ + CFLAGS="$(HOST_CFLAGS)" \ + LDFLAGS="$(HOST_LDFLAGS)" \ + $(HOST_GCC_FINAL_CONF_ENV) \ + ./configure \ + --prefix="$(HOST_DIR)/usr" \ + --sysconfdir="$(HOST_DIR)/etc" \ + --enable-shared --enable-static \ + $(QUIET) $(HOST_GCC_FINAL_CONF_OPT) \ + ) +endef + + # Languages supported by the cross-compiler GCC_FINAL_CROSS_LANGUAGES-y = c GCC_FINAL_CROSS_LANGUAGES-$(BR2_INSTALL_LIBSTDCPP) += c++ @@ -133,6 +148,8 @@ define HOST_GCC_FINAL_INSTALL_USR_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/ ; \ cp -dpf $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*/$${i}.so* \ $(TARGET_DIR)/usr/lib/ ; \ done