From patchwork Wed Apr 24 10:13:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mischa Jonker X-Patchwork-Id: 239144 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id B876F2C00ED for ; Wed, 24 Apr 2013 20:14:52 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id DE592FFA8F; Wed, 24 Apr 2013 10:14:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y7CmWHPrf4PM; Wed, 24 Apr 2013 10:14:28 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3BBB810B99D; Wed, 24 Apr 2013 10:13:47 +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 D62A58F753 for ; Wed, 24 Apr 2013 10:13:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B95488CB08 for ; Wed, 24 Apr 2013 10:13:47 +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 9ECnSNNl9xHh for ; Wed, 24 Apr 2013 10:13:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from kiruna.synopsys.com (us01smtp2.synopsys.com [198.182.44.80]) by whitealder.osuosl.org (Postfix) with ESMTP id 2CBBC8CAEE for ; Wed, 24 Apr 2013 10:13:47 +0000 (UTC) Received: from mailhost.synopsys.com (unknown [10.9.202.240]) by kiruna.synopsys.com (Postfix) with ESMTP id 4CD8FF5CC for ; Wed, 24 Apr 2013 03:13:47 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 2BF241B4; Wed, 24 Apr 2013 03:13:47 -0700 (PDT) Received: from localhost.localdomain (nl-droid1.internal.synopsys.com [10.100.24.228]) by mailhost.synopsys.com (Postfix) with ESMTP id 517521B2; Wed, 24 Apr 2013 03:13:46 -0700 (PDT) From: Mischa Jonker To: buildroot@busybox.net Date: Wed, 24 Apr 2013 12:13:19 +0200 Message-Id: <1366798403-6984-9-git-send-email-mjonker@synopsys.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1366798403-6984-1-git-send-email-mjonker@synopsys.com> References: <1366798403-6984-1-git-send-email-mjonker@synopsys.com> Cc: Mischa Jonker Subject: [Buildroot] [PATCH v2 08/12] arc: Make sure that libgcc doesn't get included when it doesn't exist yet 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 For ARC, libgcc is always included, even when -nostdlib is given. This is related to some small pieces of code that are not always generated by the compiler; a call to libgcc is used in those cases instead. During the initial stages of building the toolchain, this is a problem, as libgcc does not exist yet. The ARC compiler supports -really-nostdlib to override the default behavior. Signed-off-by: Mischa Jonker --- toolchain/uClibc/uclibc.mk | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/toolchain/uClibc/uclibc.mk b/toolchain/uClibc/uclibc.mk index 1629e76..d4f1d4c 100644 --- a/toolchain/uClibc/uclibc.mk +++ b/toolchain/uClibc/uclibc.mk @@ -404,6 +404,17 @@ ifeq ($(BR2_CCACHE),y) $(UCLIBC_DIR)/.config: | host-ccache endif +# For ARC, libgcc is always included, even when -nostdlib is given. This +# is related to some small pieces of code that are not always generated +# by the compiler; a call to libgcc is used in those cases instead. +# +# During the initial stages of building the toolchain, this is a problem, +# as libgcc does not exist yet. The ARC compiler supports -really-nostdlib +# to override the default behavior. +ifeq ($(BR2_arc),y) +REALLY_NOSTDLIB=-really-nostdlib +endif + $(UCLIBC_DIR)/.configured: $(LINUX_HEADERS_DIR)/.configured $(UCLIBC_DIR)/.config $(Q)$(call MESSAGE,"Installing uClibc headers") $(MAKE1) -C $(UCLIBC_DIR) \ @@ -422,8 +433,8 @@ $(UCLIBC_DIR)/.configured: $(LINUX_HEADERS_DIR)/.configured $(UCLIBC_DIR)/.confi cp -pLR $(LINUX_HEADERS_DIR)/include/* \ $(TOOLCHAIN_DIR)/uClibc_dev/usr/include/; \ fi - $(TARGET_CROSS)gcc -nostdlib -nostartfiles -shared -x c /dev/null -o $(TOOLCHAIN_DIR)/uClibc_dev/usr/lib/libc.so - $(TARGET_CROSS)gcc -nostdlib -nostartfiles -shared -x c /dev/null -o $(TOOLCHAIN_DIR)/uClibc_dev/usr/lib/libm.so + $(TARGET_CROSS)gcc -nostdlib $(REALLY_NOSTDLIB) -nostartfiles -shared -x c /dev/null -o $(TOOLCHAIN_DIR)/uClibc_dev/usr/lib/libc.so + $(TARGET_CROSS)gcc -nostdlib $(REALLY_NOSTDLIB) -nostartfiles -shared -x c /dev/null -o $(TOOLCHAIN_DIR)/uClibc_dev/usr/lib/libm.so cp -pLR $(UCLIBC_DIR)/lib/crt[1in].o $(TOOLCHAIN_DIR)/uClibc_dev/usr/lib/ touch $@