Commit bfdca998 authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: Rename ld flags for vmlinux to LDFLAGS_vmlinux

Everywhere else we use CFLAGS_<target> etc to designate special flags
for an object, so handle vmlinux the same way.
parent 42ec3f17
...@@ -224,7 +224,7 @@ NETWORKS := net/network.o ...@@ -224,7 +224,7 @@ NETWORKS := net/network.o
include arch/$(ARCH)/Makefile include arch/$(ARCH)/Makefile
export NETWORKS DRIVERS LIBS HEAD LDFLAGS LINKFLAGS MAKEBOOT ASFLAGS export NETWORKS DRIVERS LIBS HEAD LDFLAGS MAKEBOOT ASFLAGS
# boot target # boot target
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
...@@ -245,7 +245,7 @@ boot: vmlinux ...@@ -245,7 +245,7 @@ boot: vmlinux
vmlinux-objs := $(HEAD) $(INIT) $(CORE_FILES) $(LIBS) $(DRIVERS) $(NETWORKS) vmlinux-objs := $(HEAD) $(INIT) $(CORE_FILES) $(LIBS) $(DRIVERS) $(NETWORKS)
quiet_cmd_link_vmlinux = LD $@ quiet_cmd_link_vmlinux = LD $@
cmd_link_vmlinux = $(LD) $(LINKFLAGS) $(HEAD) $(INIT) \ cmd_link_vmlinux = $(LD) $(LDFLAGS_$(@F)) $(HEAD) $(INIT) \
--start-group \ --start-group \
$(CORE_FILES) \ $(CORE_FILES) \
$(LIBS) \ $(LIBS) \
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
NM := $(NM) -B NM := $(NM) -B
LINKFLAGS = -static -T arch/alpha/vmlinux.lds -N #-relax LDFLAGS_vmlinux = -static -T arch/alpha/vmlinux.lds -N #-relax
CFLAGS := $(CFLAGS) -pipe -mno-fp-regs -ffixed-8 CFLAGS := $(CFLAGS) -pipe -mno-fp-regs -ffixed-8
# Determine if we can use the BWX instructions with GAS. # Determine if we can use the BWX instructions with GAS.
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
# Copyright (C) 1995-2001 by Russell King # Copyright (C) 1995-2001 by Russell King
LINKFLAGS :=-p -X -T arch/arm/vmlinux.lds LDFLAGS_vmlinux :=-p -X -T arch/arm/vmlinux.lds
GZFLAGS :=-9 GZFLAGS :=-9
CFLAGS +=-pipe CFLAGS +=-pipe
......
...@@ -31,7 +31,7 @@ LD = if [ ! -e $(LD_SCRIPT).tmp -o $(LD_SCRIPT) -nt $(LD_SCRIPT).tmp ]; then \ ...@@ -31,7 +31,7 @@ LD = if [ ! -e $(LD_SCRIPT).tmp -o $(LD_SCRIPT) -nt $(LD_SCRIPT).tmp ]; then \
else true; \ else true; \
fi && $(CROSS_COMPILE)ld -mcrislinux fi && $(CROSS_COMPILE)ld -mcrislinux
LINKFLAGS = -T $(LD_SCRIPT).tmp LDFLAGS_vmlinux = -T $(LD_SCRIPT).tmp
# objcopy is used to make binary images from the resulting linked file # objcopy is used to make binary images from the resulting linked file
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +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
LINKFLAGS =-T $(TOPDIR)/arch/i386/vmlinux.lds -e stext LDFLAGS_vmlinux :=-T arch/i386/vmlinux.lds -e stext
CFLAGS += -pipe CFLAGS += -pipe
......
...@@ -13,7 +13,7 @@ AWK := awk ...@@ -13,7 +13,7 @@ AWK := awk
export AWK export AWK
LINKFLAGS = -static -T arch/$(ARCH)/vmlinux.lds LDFLAGS_vmlinux := -static -T arch/$(ARCH)/vmlinux.lds
AFLAGS_KERNEL := -mconstant-gp AFLAGS_KERNEL := -mconstant-gp
EXTRA = EXTRA =
......
...@@ -25,9 +25,9 @@ ifneq ($(COMPILE_ARCH),$(ARCH)) ...@@ -25,9 +25,9 @@ ifneq ($(COMPILE_ARCH),$(ARCH))
endif endif
ifndef CONFIG_SUN3 ifndef CONFIG_SUN3
LINKFLAGS = -T $(TOPDIR)/arch/m68k/vmlinux.lds LDFLAGS_vmlinux = -T $(TOPDIR)/arch/m68k/vmlinux.lds
else else
LINKFLAGS = -T $(TOPDIR)/arch/m68k/vmlinux-sun3.lds -N LDFLAGS_vmlinux = -T $(TOPDIR)/arch/m68k/vmlinux-sun3.lds -N
endif endif
# without -fno-strength-reduce the 53c7xx.c driver fails ;-( # without -fno-strength-reduce the 53c7xx.c driver fails ;-(
......
...@@ -36,7 +36,7 @@ endif ...@@ -36,7 +36,7 @@ endif
# crossformat linking we rely on the elf2ecoff tool for format conversion. # crossformat linking we rely on the elf2ecoff tool for format conversion.
# #
GCCFLAGS := -G 0 -mno-abicalls -fno-pic GCCFLAGS := -G 0 -mno-abicalls -fno-pic
LINKFLAGS += -static LDFLAGS_vmlinux += -static
MODFLAGS += -mlong-calls MODFLAGS += -mlong-calls
LD := $(LD) -G 0 LD := $(LD) -G 0
...@@ -270,7 +270,7 @@ vmlinux: arch/$(ARCH)/ld.script ...@@ -270,7 +270,7 @@ vmlinux: arch/$(ARCH)/ld.script
arch/$(ARCH)/ld.script: arch/$(ARCH)/ld.script.in arch/$(ARCH)/Makefile arch/$(ARCH)/ld.script: arch/$(ARCH)/ld.script.in arch/$(ARCH)/Makefile
sed -e 's/@@LOADADDR@@/$(LOADADDR)/' <$< >$@ sed -e 's/@@LOADADDR@@/$(LOADADDR)/' <$< >$@
LINKFLAGS += -T arch/$(ARCH)/ld.script LDFLAGS_vmlinux += -T arch/$(ARCH)/ld.script
HEAD := arch/mips/kernel/head.o arch/mips/kernel/init_task.o HEAD := arch/mips/kernel/head.o arch/mips/kernel/init_task.o
......
...@@ -35,7 +35,7 @@ endif ...@@ -35,7 +35,7 @@ endif
# #
CFLAGS += -I $(TOPDIR)/include/asm/gcc $(CFLAGS) CFLAGS += -I $(TOPDIR)/include/asm/gcc $(CFLAGS)
CFLAGS += -mabi=64 -G 0 -mno-abicalls -fno-pic -Wa,--trap -pipe CFLAGS += -mabi=64 -G 0 -mno-abicalls -fno-pic -Wa,--trap -pipe
LINKFLAGS += -G 0 -static # -N LDFLAGS_vmlinux += -G 0 -static # -N
MODFLAGS += -mlong-calls MODFLAGS += -mlong-calls
ifdef CONFIG_REMOTE_DEBUG ifdef CONFIG_REMOTE_DEBUG
...@@ -118,7 +118,7 @@ endif ...@@ -118,7 +118,7 @@ endif
# #
ifdef CONFIG_BOOT_ELF32 ifdef CONFIG_BOOT_ELF32
CFLAGS += -Wa,-32 CFLAGS += -Wa,-32
LINKFLAGS += -T arch/mips64/ld.script.elf32 LDFLAGS_vmlinux += -T arch/mips64/ld.script.elf32
endif endif
# #
# The 64-bit ELF tools are pretty broken so at this time we generate 64-bit # The 64-bit ELF tools are pretty broken so at this time we generate 64-bit
...@@ -126,13 +126,13 @@ endif ...@@ -126,13 +126,13 @@ endif
# #
ifdef CONFIG_BOOT_ELF64 ifdef CONFIG_BOOT_ELF64
CFLAGS += -Wa,-32 CFLAGS += -Wa,-32
LINKFLAGS += -T arch/mips64/ld.script.elf32 LDFLAGS_vmlinux += -T arch/mips64/ld.script.elf32
#AS += -64 #AS += -64
#LD += -m elf64bmip #LD += -m elf64bmip
#LINKFLAGS += -T arch/mips64/ld.script.elf64 #LDFLAGS_vmlinux += -T arch/mips64/ld.script.elf64
endif endif
LINKFLAGS += -Ttext $(LOADADDR) LDFLAGS_vmlinux += -Ttext $(LOADADDR)
HEAD := arch/mips64/kernel/head.o arch/mips64/kernel/init_task.o HEAD := arch/mips64/kernel/head.o arch/mips64/kernel/init_task.o
......
...@@ -21,7 +21,7 @@ FINAL_LD=$(CROSS_COMPILE)ld --warn-common --warn-section-align ...@@ -21,7 +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
LINKFLAGS =-T $(TOPDIR)/arch/parisc/vmlinux.lds LDFLAGS_vmlinux =-T arch/parisc/vmlinux.lds
CFLAGS_PIPE := -pipe CFLAGS_PIPE := -pipe
CFLAGS_NSR := -fno-strength-reduce CFLAGS_NSR := -fno-strength-reduce
......
...@@ -21,7 +21,7 @@ else ...@@ -21,7 +21,7 @@ else
KERNELLOAD =0xc0000000 KERNELLOAD =0xc0000000
endif endif
LINKFLAGS = -T arch/ppc/vmlinux.lds -Ttext $(KERNELLOAD) -Bstatic LDFLAGS_vmlinux = -T arch/ppc/vmlinux.lds -Ttext $(KERNELLOAD) -Bstatic
CPPFLAGS := $(CPPFLAGS) -I$(TOPDIR)/arch/$(ARCH) CPPFLAGS := $(CPPFLAGS) -I$(TOPDIR)/arch/$(ARCH)
AFLAGS := $(AFLAGS) -I$(TOPDIR)/arch/$(ARCH) AFLAGS := $(AFLAGS) -I$(TOPDIR)/arch/$(ARCH)
CFLAGS := $(CFLAGS) -I$(TOPDIR)/arch/$(ARCH) -fsigned-char \ CFLAGS := $(CFLAGS) -I$(TOPDIR)/arch/$(ARCH) -fsigned-char \
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
KERNELLOAD =0xc000000000000000 KERNELLOAD =0xc000000000000000
LINKFLAGS = -T arch/ppc64/vmlinux.lds -Bstatic \ LDFLAGS_vmlinux = -T arch/ppc64/vmlinux.lds -Bstatic \
-e $(KERNELLOAD) -Ttext $(KERNELLOAD) -e $(KERNELLOAD) -Ttext $(KERNELLOAD)
CFLAGS := $(CFLAGS) -fsigned-char -msoft-float -pipe \ CFLAGS := $(CFLAGS) -fsigned-char -msoft-float -pipe \
-Wno-uninitialized -mminimal-toc -mtraceback=full \ -Wno-uninitialized -mminimal-toc -mtraceback=full \
......
...@@ -20,7 +20,7 @@ ifeq ($(CONFIG_SHARED_KERNEL),y) ...@@ -20,7 +20,7 @@ ifeq ($(CONFIG_SHARED_KERNEL),y)
else else
LINKSCRIPT := arch/s390/vmlinux.lds LINKSCRIPT := arch/s390/vmlinux.lds
endif endif
LINKFLAGS =-T $(TOPDIR)/$(LINKSCRIPT) -e start LDFLAGS_vmlinux := -T $(LINKSCRIPT) -e start
CFLAGS_PIPE := -pipe CFLAGS_PIPE := -pipe
CFLAGS_NSR := -fno-strength-reduce CFLAGS_NSR := -fno-strength-reduce
......
...@@ -21,7 +21,7 @@ ifeq ($(CONFIG_SHARED_KERNEL),y) ...@@ -21,7 +21,7 @@ ifeq ($(CONFIG_SHARED_KERNEL),y)
else else
LINKSCRIPT := arch/s390x/vmlinux.lds LINKSCRIPT := arch/s390x/vmlinux.lds
endif endif
LINKFLAGS =-T $(TOPDIR)/$(LINKSCRIPT) -e start LDFLAGS_vmlinux := -T $(LINKSCRIPT) -e start
MODFLAGS += -fpic MODFLAGS += -fpic
CFLAGS_PIPE := -pipe CFLAGS_PIPE := -pipe
......
...@@ -15,12 +15,12 @@ ...@@ -15,12 +15,12 @@
ifdef CONFIG_CPU_LITTLE_ENDIAN ifdef CONFIG_CPU_LITTLE_ENDIAN
CFLAGS += -ml CFLAGS += -ml
AFLAGS += -ml AFLAGS += -ml
# LINKFLAGS += -EL # LDFLAGS_vmlinux += -EL
LDFLAGS := -EL LDFLAGS := -EL
else else
CFLAGS += -mb CFLAGS += -mb
AFLAGS += -mb AFLAGS += -mb
# LINKFLAGS += -EB # LDFLAGS_vmlinux += -EB
LDFLAGS := -EB LDFLAGS := -EB
endif endif
...@@ -47,10 +47,10 @@ endif ...@@ -47,10 +47,10 @@ endif
# none has been choosen above. # none has been choosen above.
# #
LINKSCRIPT = arch/sh/vmlinux.lds LINKSCRIPT = arch/sh/vmlinux.lds
LINKFLAGS += -T $(word 1,$(LINKSCRIPT)) -e _stext LDFLAGS_vmlinux += -T $(word 1,$(LINKSCRIPT)) -e _stext
ifdef LOADADDR ifdef LOADADDR
LINKFLAGS += -Ttext $(word 1,$(LOADADDR)) LDFLAGS_vmlinux += -Ttext $(word 1,$(LOADADDR))
endif endif
# #
......
...@@ -30,8 +30,8 @@ else ...@@ -30,8 +30,8 @@ else
CFLAGS := $(CFLAGS) -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7 CFLAGS := $(CFLAGS) -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
endif endif
#LINKFLAGS = -N -Ttext 0xf0004000 #LDFLAGS_vmlinux = -N -Ttext 0xf0004000
LINKFLAGS = -T arch/sparc/vmlinux.lds LDFLAGS_vmlinux = -T arch/sparc/vmlinux.lds
HEAD := arch/sparc/kernel/head.o arch/sparc/kernel/init_task.o HEAD := arch/sparc/kernel/head.o arch/sparc/kernel/init_task.o
......
...@@ -53,7 +53,7 @@ ifeq ($(CONFIG_MCOUNT),y) ...@@ -53,7 +53,7 @@ ifeq ($(CONFIG_MCOUNT),y)
CFLAGS := $(CFLAGS) -pg CFLAGS := $(CFLAGS) -pg
endif endif
LINKFLAGS = -T arch/sparc64/vmlinux.lds LDFLAGS_vmlinux = -T arch/sparc64/vmlinux.lds
HEAD := arch/sparc64/kernel/head.o arch/sparc64/kernel/init_task.o HEAD := arch/sparc64/kernel/head.o arch/sparc64/kernel/init_task.o
......
...@@ -35,7 +35,7 @@ export IA32_CC IA32_LD IA32_AS IA32_OBJCOPY IA32_CPP ...@@ -35,7 +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
LINKFLAGS =-T $(TOPDIR)/arch/x86_64/vmlinux.lds -e stext LDFLAGS_vmlinux := -T arch/x86_64/vmlinux.lds -e stext
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