aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Stanley <joel@jms.id.au>2018-05-04 11:40:32 +0930
committerStewart Smith <stewart@linux.ibm.com>2018-05-04 03:25:04 -0500
commit9dfebfc20485a79a4016eedadf89cc180c4580a0 (patch)
tree6883281309ba21db3a158c1fd15040a1754409f0
parent8d4fa16d384ea6de53d7396fb6d212dcd0b8af27 (diff)
downloadskiboot-9dfebfc20485a79a4016eedadf89cc180c4580a0.zip
skiboot-9dfebfc20485a79a4016eedadf89cc180c4580a0.tar.gz
skiboot-9dfebfc20485a79a4016eedadf89cc180c4580a0.tar.bz2
Makefile: Use LD to link the final binary
We were using gcc instead of ld. This isn't required, as we're disabling all of the things that gcc could do for us. This helps enable clang as the compiler, with GNU ld used for the final linking step. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r--Makefile.main7
1 files changed, 4 insertions, 3 deletions
diff --git a/Makefile.main b/Makefile.main
index 8cd5e2d..92dd92b 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -128,7 +128,8 @@ LDFLAGS += -Wl,-pie
LDFLAGS += -Wl,-Ttext-segment,$(LD_TEXT) -Wl,-N -Wl,--build-id=none
LDFLAGS += -Wl,--no-multi-toc
LDFLAGS += -mcpu=power7 -mbig-endian -Wl,--oformat,elf64-powerpc
-LDFLAGS_FINAL = $(LDFLAGS) -Wl,--whole-archive
+LDFLAGS_FINAL = -EB -m elf64ppc --no-multi-toc -N --build-id=none --whole-archive
+LDFLAGS_FINAL += -static -nostdlib -pie -Ttext-segment=$(LD_TEXT) --oformat=elf64-powerpc
LDRFLAGS=-melf64ppc
# Debug stuff
#LDFLAGS += -Wl,-v -Wl,-Map,foomap
@@ -267,12 +268,12 @@ $(TARGET).tmp.a: $(ALL_OBJS)
$(call Q,AR, $(AR) rcsTPD $@ $(ALL_OBJS), $@)
$(TARGET).tmp.elf: $(ALL_OBJS_1) $(TARGET).lds $(KERNEL)
- $(call Q,LD, $(CC) $(LDFLAGS_FINAL) -o $@ -T $(TARGET).lds $(ALL_OBJS_1), $@)
+ $(call Q,LD, $(LD) $(LDFLAGS_FINAL) -o $@ -T $(TARGET).lds $(ALL_OBJS_1), $@)
asm/real_map.o : $(TARGET).tmp.map
$(TARGET).elf: $(ALL_OBJS_2) $(TARGET).lds $(KERNEL)
- $(call Q,LD, $(CC) $(LDFLAGS_FINAL) -o $@ -T $(TARGET).lds $(ALL_OBJS_2), $@)
+ $(call Q,LD, $(LD) $(LDFLAGS_FINAL) -o $@ -T $(TARGET).lds $(ALL_OBJS_2), $@)
$(SUBDIRS):
$(call Q,MKDIR,mkdir -p $@, $@)