From patchwork Fri Feb 20 00:37:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Neuling X-Patchwork-Id: 441804 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8B3FD140293 for ; Fri, 20 Feb 2015 11:38:20 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 047ED1A0E01 for ; Fri, 20 Feb 2015 11:38:20 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 05C151A0DF3 for ; Fri, 20 Feb 2015 11:38:13 +1100 (AEDT) Received: from localhost.localdomain (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id DA77514018C; Fri, 20 Feb 2015 11:38:12 +1100 (AEDT) Received: by localhost.localdomain (Postfix, from userid 1000) id C6EE8D47040; Fri, 20 Feb 2015 11:38:12 +1100 (AEDT) From: Michael Neuling To: stewart@linux.vnet.ibm.com Date: Fri, 20 Feb 2015 11:37:45 +1100 Message-Id: <1424392679-27859-2-git-send-email-mikey@neuling.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1424392679-27859-1-git-send-email-mikey@neuling.org> References: <1424392679-27859-1-git-send-email-mikey@neuling.org> Cc: imunsie@au.ibm.com, grimm@linux.vnet.ibm.com, skiboot@lists.ozlabs.org Subject: [Skiboot] [PATCH 02/16] Makefile: Link with libgcc X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Add linking with libgcc so that we can access functions like __builtin_*. Final size of skiboot remains unchanged with this patch. Signed-off-by: Michael Neuling --- Makefile.main | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.main b/Makefile.main index b5376fc..665baf4 100644 --- a/Makefile.main +++ b/Makefile.main @@ -120,6 +120,7 @@ OBJS += $(LIBPORE) endif OBJS += $(LIBC) $(CCAN) $(DEVSRC_OBJ) OBJS_NO_VER = $(OBJS) +EXTRA_LIBS = -Wl,-lgcc ALL_OBJS = $(OBJS) version.o ALL_OBJS_1 = $(ALL_OBJS) asm/dummy_map.o @@ -129,12 +130,12 @@ $(TARGET).lid: $(TARGET).elf $(call Q,OBJCOPY, $(OBJCOPY) -O binary -S $^ $@, $@) $(TARGET).tmp.elf: $(ALL_OBJS_1) $(TARGET).lds $(KERNEL) - $(call Q,LD, $(CC) $(LDFLAGS) -T $(TARGET).lds $(ALL_OBJS_1) -o $@, $@) + $(call Q,LD, $(CC) $(LDFLAGS) -T $(TARGET).lds $(ALL_OBJS_1) $(EXTRA_LIBS) -o $@, $@) asm/real_map.o : $(TARGET).tmp.map $(TARGET).elf: $(ALL_OBJS_2) $(TARGET).lds $(KERNEL) - $(call Q,LD, $(CC) $(LDFLAGS) -T $(TARGET).lds $(ALL_OBJS_2) -o $@, $@) + $(call Q,LD, $(CC) $(LDFLAGS) -T $(TARGET).lds $(ALL_OBJS_2) $(EXTRA_LIBS) -o $@, $@) $(SUBDIRS): $(call Q,MKDIR,mkdir $@, $@)