Commit 42ec3f17 authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: Prepare LDFLAGS for general use

Some arch Makefiles use LDFLAGS to keep special flags for the final
vmlinux link. However, we'd rather use LDFLAGS along the lines of
CFLAGS, AFLAGS etc, so get rid of these special cases.
parent 156f72cf
...@@ -18,8 +18,7 @@ ...@@ -18,8 +18,7 @@
LD=$(CROSS_COMPILE)ld -m elf_i386 LD=$(CROSS_COMPILE)ld -m elf_i386
OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
LDFLAGS=-e stext LINKFLAGS =-T $(TOPDIR)/arch/i386/vmlinux.lds -e stext
LINKFLAGS =-T $(TOPDIR)/arch/i386/vmlinux.lds $(LDFLAGS)
CFLAGS += -pipe CFLAGS += -pipe
......
...@@ -21,8 +21,7 @@ FINAL_LD=$(CROSS_COMPILE)ld --warn-common --warn-section-align ...@@ -21,8 +21,7 @@ FINAL_LD=$(CROSS_COMPILE)ld --warn-common --warn-section-align
CPP=$(CC) -E CPP=$(CC) -E
OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
LDFLAGS = LINKFLAGS =-T $(TOPDIR)/arch/parisc/vmlinux.lds
LINKFLAGS =-T $(TOPDIR)/arch/parisc/vmlinux.lds $(LDFLAGS)
CFLAGS_PIPE := -pipe CFLAGS_PIPE := -pipe
CFLAGS_NSR := -fno-strength-reduce CFLAGS_NSR := -fno-strength-reduce
......
...@@ -15,13 +15,12 @@ ...@@ -15,13 +15,12 @@
LD=$(CROSS_COMPILE)ld -m elf_s390 LD=$(CROSS_COMPILE)ld -m elf_s390
OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
LDFLAGS=-e start
ifeq ($(CONFIG_SHARED_KERNEL),y) ifeq ($(CONFIG_SHARED_KERNEL),y)
LINKSCRIPT := arch/s390/vmlinux-shared.lds LINKSCRIPT := arch/s390/vmlinux-shared.lds
else else
LINKSCRIPT := arch/s390/vmlinux.lds LINKSCRIPT := arch/s390/vmlinux.lds
endif endif
LINKFLAGS =-T $(TOPDIR)/$(LINKSCRIPT) $(LDFLAGS) LINKFLAGS =-T $(TOPDIR)/$(LINKSCRIPT) -e start
CFLAGS_PIPE := -pipe CFLAGS_PIPE := -pipe
CFLAGS_NSR := -fno-strength-reduce CFLAGS_NSR := -fno-strength-reduce
......
...@@ -16,13 +16,12 @@ ...@@ -16,13 +16,12 @@
LD=$(CROSS_COMPILE)ld -m elf64_s390 LD=$(CROSS_COMPILE)ld -m elf64_s390
CPP=$(CC) -E CPP=$(CC) -E
OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
LDFLAGS=-e start
ifeq ($(CONFIG_SHARED_KERNEL),y) ifeq ($(CONFIG_SHARED_KERNEL),y)
LINKSCRIPT := arch/s390x/vmlinux-shared.lds LINKSCRIPT := arch/s390x/vmlinux-shared.lds
else else
LINKSCRIPT := arch/s390x/vmlinux.lds LINKSCRIPT := arch/s390x/vmlinux.lds
endif endif
LINKFLAGS =-T $(TOPDIR)/$(LINKSCRIPT) $(LDFLAGS) LINKFLAGS =-T $(TOPDIR)/$(LINKSCRIPT) -e start
MODFLAGS += -fpic MODFLAGS += -fpic
CFLAGS_PIPE := -pipe CFLAGS_PIPE := -pipe
......
...@@ -35,8 +35,7 @@ export IA32_CC IA32_LD IA32_AS IA32_OBJCOPY IA32_CPP ...@@ -35,8 +35,7 @@ export IA32_CC IA32_LD IA32_AS IA32_OBJCOPY IA32_CPP
LD=$(CROSS_COMPILE)ld -m elf_x86_64 LD=$(CROSS_COMPILE)ld -m elf_x86_64
OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
LDFLAGS=-e stext LINKFLAGS =-T $(TOPDIR)/arch/x86_64/vmlinux.lds -e stext
LINKFLAGS =-T $(TOPDIR)/arch/x86_64/vmlinux.lds $(LDFLAGS)
CFLAGS += -mno-red-zone CFLAGS += -mno-red-zone
CFLAGS += -mcmodel=kernel CFLAGS += -mcmodel=kernel
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment