aboutsummaryrefslogtreecommitdiff
path: root/Makefile.main
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2015-02-20 11:37:45 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-02-23 13:32:00 +1100
commit8f5b8616de0b8ea92033725765c0a99db5cd84c4 (patch)
tree71d9e28d02c297f7ca4f2077983e837ca487df0e /Makefile.main
parentedba5b11158fc433a2b5519677bf76a995c4b9a2 (diff)
downloadskiboot-8f5b8616de0b8ea92033725765c0a99db5cd84c4.zip
skiboot-8f5b8616de0b8ea92033725765c0a99db5cd84c4.tar.gz
skiboot-8f5b8616de0b8ea92033725765c0a99db5cd84c4.tar.bz2
Makefile: Link with libgcc
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 <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'Makefile.main')
-rw-r--r--Makefile.main5
1 files 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 $@, $@)