Generation of *.s files from *.S files in kbuild
Subsystems (10)
Hello,
Is the generation of *.s files from *.S files in the kernel build system a wide spread phenomenon? As far as I can see only vmlinux.lds.s is built that way in my default i386 config.
It causes problems when trying to cross-build a kernel on a file system that has case-insensitive filenames, or on a GNU port that is case insensitive (such as Cygwin).
If anyone wondered, I'm trying to cross build a Linux kernel on a Cygwin system using a Linux native toolchain, in order to make development of the Windows port of coLinux easier for some people.
Signature · 2 lines
Dan Aloni [email protected]
Quoted 6 lines · Dan Aloni
Hello,
Is the generation of *.s files from *.S files in the kernel build system a wide spread phenomenon? As far as I can see only vmlinux.lds.s is built that way in my default i386 config.
Quoted 8 lines
It causes problems when trying to cross-build a kernel on a file system that has case-insensitive filenames, or on a GNU port that is case insensitive (such as Cygwin).
If anyone wondered, I'm trying to cross build a Linux kernel on a Cygwin system using a Linux native toolchain, in order to make development of the Windows port of coLinux easier for some people.
Hi Dan,
I'm having the exact same problem on Mac OSX with the case-insensitive HFS+ filesystem.
After looking the only files that use this rule are the vmlinux.lds files. (Although there is one of them for each architecture.)
It is actually a bit frustrating because due to the way make works this is a problem even if you use a separate build directory.
The solution is fairly striaght forward -- just change the suffixes, the problem is exactly how to change them. I would propose changing it such that was stick with "vmlinux.lds.S" and have it generate "vmlinux.lds"
This would require the fewest changes to implement, just 1/ change %.s %.S rule to %.lds %.lds.S
2/ change the link flags from "-T vmlinux.lds.s" -> "-T vmlinux.lds"
Cheers,
Benno
Quoted 8 lines · Benno
The solution is fairly striaght forward -- just change the suffixes, the problem is exactly how to change them. I would propose changing it such that was stick with "
vmlinux.lds.S" and have it generate "vmlinux.lds"This would require the fewest changes to implement, just 1/ change %.s %.S rule to %.lds %.lds.S
2/ change the link flags from "-T vmlinux.lds.s" -> "-Tvmlinux.lds"
I agree with this approach, and see no defencies.
Care to send two patches.
One that do what you suggest for i386, and another that cover the rest of the architectures?
Sam
Quoted 10 lines · Sam Ravnborg
Quoted 8 lines · Benno
The solution is fairly striaght forward -- just change the suffixes, the problem is exactly how to change them. I would propose changing it such that was stick with "
vmlinux.lds.S" and have it generate "vmlinux.lds"This would require the fewest changes to implement, just 1/ change %.s %.S rule to %.lds %.lds.S
2/ change the link flags from "-T vmlinux.lds.s" -> "-Tvmlinux.lds"
Quoted 5 lines
I agree with this approach, and see no defencies.
Care to send two patches.
One that do what you suggest for i386, and another that cover the rest of the architectures?
Here's the first patch:
Makefile +7 -7
@@ -549,7 +549,7 @@ $(NM) $@ | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map endef -LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.s +LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds # Generate section listing all symbols and add it into vmlinux # It's a three stage process:
@@ -575,23 +575,23 @@ .tmp_kallsyms%.S: .tmp_vmlinux% $(call cmd,kallsyms) -.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE +.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds FORCE +$(call if_changed_rule,vmlinux__) -.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds.s FORCE +.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds FORCE $(call if_changed_rule,vmlinux__) endif # Finally the vmlinux rule -vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE +vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds FORCE $(call if_changed_rule,vmlinux) # The actual objects are generated when descending, # make sure no implicit rule kicks in -$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.s: $(vmlinux-dirs) ; +$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds: $(vmlinux-dirs) ; # Handle descending into subdirectories listed in $(vmlinux-dirs)
@@ -632,10 +632,10 @@ # All the preparing.. prepare-all: prepare0 prepare -# Leave this as default for preprocessing vmlinux.lds.s, which is now +# Leave this as default for preprocessing vmlinux.lds, which is now # done in arch/$(ARCH)/kernel/Makefile -export AFLAGS_vmlinux.lds.o += -P -C -U$(ARCH) +export AFLAGS_vmlinux.o += -P -C -U$(ARCH) # Single targets # ---------------------------------------------------------------------------
arch/i386/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \ ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_i386.o \
scripts/Makefile.build +4 -4
@@ -194,11 +194,11 @@ $(real-objs-m) : modkern_aflags := $(AFLAGS_MODULE) $(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE) -quiet_cmd_as_s_S = CPP $(quiet_modtag) $@ -cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< +quiet_cmd_as_lds_lds_S = CPP $(quiet_modtag) $@ +cmd_as_lds_lds_S = $(CPP) $(a_flags) -o $@ $< -%.s: %.S FORCE - $(call if_changed_dep,as_s_S) +%.lds: %.lds.S FORCE + $(call if_changed_dep,as_lds_lds_S) quiet_cmd_as_o_S = AS $(quiet_modtag) $@ cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
Signature · 2 lines
Dan Aloni [email protected]
Re: [PATCH 1/2] #2 (Generation of *.s files from *.S files in kbuild)
Quoted 11 lines · Dan Aloni
Quoted 10 lines · Sam Ravnborg
Quoted 8 lines · Benno
The solution is fairly striaght forward -- just change the suffixes, the problem is exactly how to change them. I would propose changing it such that was stick with "
vmlinux.lds.S" and have it generate "vmlinux.lds"This would require the fewest changes to implement, just 1/ change %.s %.S rule to %.lds %.lds.S
2/ change the link flags from "-T vmlinux.lds.s" -> "-Tvmlinux.lds"
Quoted 7 lines
Quoted 5 lines
I agree with this approach, and see no defencies.
Care to send two patches.
One that do what you suggest for i386, and another that cover the rest of the architectures?Here's the first patch:
There was a small typo in my source tree. Second try:
Makefile +6 -6
@@ -549,7 +549,7 @@ $(NM) $@ | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map endef -LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.s +LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds # Generate section listing all symbols and add it into vmlinux # It's a three stage process:
@@ -575,23 +575,23 @@ .tmp_kallsyms%.S: .tmp_vmlinux% $(call cmd,kallsyms) -.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE +.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds FORCE +$(call if_changed_rule,vmlinux__) -.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds.s FORCE +.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds FORCE $(call if_changed_rule,vmlinux__) endif # Finally the vmlinux rule -vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE +vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds FORCE $(call if_changed_rule,vmlinux) # The actual objects are generated when descending, # make sure no implicit rule kicks in -$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.s: $(vmlinux-dirs) ; +$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds: $(vmlinux-dirs) ; # Handle descending into subdirectories listed in $(vmlinux-dirs)
@@ -635,7 +635,7 @@ # Leave this as default for preprocessing vmlinux.lds.S, which is now # done in arch/$(ARCH)/kernel/Makefile -export AFLAGS_vmlinux.lds.o += -P -C -U$(ARCH) +export AFLAGS_vmlinux.o += -P -C -U$(ARCH) # Single targets # ---------------------------------------------------------------------------
arch/i386/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \ ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_i386.o \
scripts/Makefile.build +4 -4
@@ -194,11 +194,11 @@ $(real-objs-m) : modkern_aflags := $(AFLAGS_MODULE) $(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE) -quiet_cmd_as_s_S = CPP $(quiet_modtag) $@ -cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< +quiet_cmd_as_lds_lds_S = CPP $(quiet_modtag) $@ +cmd_as_lds_lds_S = $(CPP) $(a_flags) -o $@ $< -%.s: %.S FORCE - $(call if_changed_dep,as_s_S) +%.lds: %.lds.S FORCE + $(call if_changed_dep,as_lds_lds_S) quiet_cmd_as_o_S = AS $(quiet_modtag) $@ cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
Signature · 2 lines
Dan Aloni [email protected]
Re: [PATCH 1/2] #2 (Generation of *.s files from *.S files in kbuild)
Quoted 6 lines · Dan Aloni
diff -urN linux-2.6.7/scripts/Makefile.build linux-2.6.7-work/scripts/Makefile.build
scripts/Makefile.build +0
-0@@ -194,11 +194,11 @@ $(real-objs-m) : modkern_aflags := $(AFLAGS_MODULE) $(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE)
scripts/Makefile.build line 201
Quoted 10 lines
scripts/Makefile.build +4
-4-quiet_cmd_as_s_S = CPP $(quiet_modtag) $@ -cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< +quiet_cmd_as_lds_lds_S = CPP $(quiet_modtag) $@ +cmd_as_lds_lds_S = $(CPP) $(a_flags) -o $@ $< -%.s: %.S FORCE - $(call if_changed_dep,as_s_S) +%.lds: %.lds.S FORCE + $(call if_changed_dep,as_lds_lds_S)
This is not good.
The .S -> .s is used for assembly.
An additional rule is needed:
Something like:quiet_cmd_cpp_lds_S = LDS $@
cmd_cpp_lds_S = $(CPP) $(cpp_flags) -o $@ $<
%.lds: %.lds.S FORCE
$(call if_changed_dep,cpp_lds_S)
Adding a new rule it no longer are acceptable to misuse AFLAGS for this. So you have to add support for a new set of flags.
Better name them with CPP so they can be used for other preprocessings tasks later if needed.
So in Makefile.lib you need to add cpp_flags like a_flags but using CPPFLAGS, EXTRA_CPPFLAGS, and CPPFLAGS_@
Try building a clean kernel after implementing this.
Thanks,
Sam
Re: [PATCH 1/2] #2 (Generation of *.s files from *.S files in kbuild)
Quoted 13 lines · Sam Ravnborg
Quoted 12 lines · Dan Aloni
diff -urN linux-2.6.7/scripts/Makefile.build linux-2.6.7-work/scripts/Makefile.build
scripts/Makefile.build +2
-2@@ -194,11 +194,11 @@ $(real-objs-m) : modkern_aflags := $(AFLAGS_MODULE) $(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE) -quiet_cmd_as_s_S = CPP $(quiet_modtag) $@ -cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< +quiet_cmd_as_lds_lds_S = CPP $(quiet_modtag) $@ +cmd_as_lds_lds_S = $(CPP) $(a_flags) -o $@ $<
Quoted 8 lines
scripts/Makefile.build line 201
Quoted 4 lines
scripts/Makefile.build +2
-2-%.s: %.S FORCE - $(call if_changed_dep,as_s_S) +%.lds: %.lds.S FORCE + $(call if_changed_dep,as_lds_lds_S)This is not good.
The .S -> .s is used for assembly.
Actually the only rule I saw that is being used for assembly is the .S -> .o rule (examples under arch/i386/kernel).
Quoted 15 lines
An additional rule is needed:
Something like:
quiet_cmd_cpp_lds_S= LDS $@cmd_cpp_lds_S = $(CPP) $(cpp_flags) -o $@ $<%.lds: %.lds.S FORCE
$(call if_changed_dep,cpp_lds_S)Adding a new rule it no longer are acceptable to misuse AFLAGS for this. So you have to add support for a new set of flags.
Better name them with CPP so they can be used for other preprocessings tasks later if needed.
Quoted 4 lines
So in Makefile.lib you need to add
cpp_flagslikea_flagsbut using CPPFLAGS,EXTRA_CPPFLAGS, and CPPFLAGS_@Try building a clean kernel after implementing this.
Okay, I'll send a patch when it's ready.
Signature · 2 lines
Dan Aloni [email protected]
Re: [PATCH 1/2] #2 (Generation of *.s files from *.S files in kbuild)
Quoted 5 lines · Dan Aloni
Quoted 1 line
The .S -> .s is used for assembly.
Actually the only rule I saw that is being used for assembly is the .S -> .o rule (examples under
arch/i386/kernel).
Meant to be used if someone do:
make arch/i386/crypto/aes-i586-asm.s
to see the preprocessed version of the .S file.
It's not used in the normal build process.
Sam
PATCH 1/1 [#3 1/2] Generate vmlinux.lds instead of vmlinux.lds.s
In reply to Sam RavnborgHello Sam,
Here's the first patch. Note that I had to choose PPFLAGS instead of CPPFLAGS because otherwise it would have collided with the other uses of CPPFLAGS.
I've test-built a clean kernel.
This applies against 2.6.8.1 (the Olympic kernel :).
Makefile +13 -7
@@ -300,6 +300,7 @@ CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -fno-common AFLAGS := -D__ASSEMBLY__ +PPFLAGS := -D__ASSEMBLY__ export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \ CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
@@ -309,6 +310,7 @@ export CPPFLAGS NOSTDINC_FLAGS OBJCOPYFLAGS LDFLAGS export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE +export PPFLAGS PPFLAGS_KERNEL PPFLAGS_MODULE # When compiling out-of-tree modules, put MODVERDIR in the module # tree rather than in the kernel tree. The kernel tree might
@@ -540,7 +542,7 @@ do_system_map = $(NM) $(1) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > $(2) -LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.s +LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds # Generate section listing all symbols and add it into vmlinux # It's a three stage process:
@@ -584,13 +586,13 @@ .tmp_kallsyms%.S: .tmp_vmlinux% $(call cmd,kallsyms) -.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE +.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds FORCE $(call if_changed_rule,vmlinux__) -.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds.s FORCE +.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds FORCE $(call if_changed_rule,vmlinux__) -.tmp_vmlinux3: $(vmlinux-objs) .tmp_kallsyms2.o arch/$(ARCH)/kernel/vmlinux.lds.s FORCE +.tmp_vmlinux3: $(vmlinux-objs) .tmp_kallsyms2.o arch/$(ARCH)/kernel/vmlinux.lds FORCE $(call if_changed_rule,vmlinux__) endif
@@ -603,13 +605,13 @@ $(rule_verify_kallsyms) endef -vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE +vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds FORCE $(call if_changed_rule,vmlinux) # The actual objects are generated when descending, # make sure no implicit rule kicks in -$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.s: $(vmlinux-dirs) ; +$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds: $(vmlinux-dirs) ; # Handle descending into subdirectories listed in $(vmlinux-dirs) # Preset locale variables to speed up the build process. Limit locale
@@ -667,7 +669,7 @@ # Leave this as default for preprocessing vmlinux.lds.S, which is now # done in arch/$(ARCH)/kernel/Makefile -export AFLAGS_vmlinux.lds.o += -P -C -U$(ARCH) +export PPFLAGS_vmlinux.o += -P -C -U$(ARCH) # Single targets # ---------------------------------------------------------------------------
@@ -1106,6 +1108,10 @@ $(NOSTDINC_FLAGS) $(CPPFLAGS) \ $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) +pp_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(AFLAGS_KERNEL) \ + $(NOSTDINC_FLAGS) $(CPPFLAGS) \ + $(modkern_aflags) $(EXTRA_PPFLAGS) $(PPFLAGS_$(*F).o) + quiet_cmd_as_o_S = AS $@ cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
arch/i386/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \ ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_i386.o \
scripts/Makefile.build +14 -0
@@ -186,6 +186,20 @@ %.lst: %.c FORCE $(call if_changed_dep,cc_lst_c) +# Linker scripts preprocessor (.lds.S -> .lds) +# --------------------------------------------------------------------------- + +modkern_ppflags := $(PPFLAGS_KERNEL) + +$(real-objs-m) : modkern_ppflags := $(PPFLAGS_MODULE) +$(real-objs-m:.o=.s): modkern_ppflags := $(PPFLAGS_MODULE) + +quiet_cmd_cpp_lds_S = LDS $@ + cmd_cpp_lds_S = $(CPP) $(pp_flags) -o $@ $< + +%.lds: %.lds.S FORCE + $(call if_changed_dep,cpp_lds_S) + # Compile assembler sources (.S) # ---------------------------------------------------------------------------
scripts/Makefile.lib +6 -0
@@ -139,6 +139,7 @@ _c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) _a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) +_pp_flags = $(PPFLAGS) $(EXTRA_PPFLAGS) $(PPFLAGS_$(*F).o) _hostc_flags = $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS_$(*F).o) _hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) $(HOSTCXXFLAGS_$(*F).o)
@@ -149,6 +150,7 @@ ifeq ($(KBUILD_SRC),) __c_flags = $(_c_flags) __a_flags = $(_a_flags) +__pp_flags = $(_pp_flags) __hostc_flags = $(_hostc_flags) __hostcxx_flags = $(_hostcxx_flags) else
@@ -164,6 +166,7 @@ # FIXME: Replace both with specific CFLAGS* statements in the makefiles __c_flags = $(call addtree,-I$(obj)) $(call flags,_c_flags) __a_flags = $(call flags,_a_flags) +__pp_flags = $(call flags,_pp_flags) __hostc_flags = -I$(obj) $(call flags,_hostc_flags) __hostcxx_flags = -I$(obj) $(call flags,_hostcxx_flags) endif
@@ -175,6 +178,9 @@ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ $(__a_flags) $(modkern_aflags) +pp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ + $(__pp_flags) $(modkern_ppflags) + hostc_flags = -Wp,-MD,$(depfile) $(__hostc_flags) hostcxx_flags = -Wp,-MD,$(depfile) $(__hostcxx_flags)
Signature · 2 lines
Dan Aloni [email protected]
Re: [PATCH] [#3 1/2] Generate vmlinux.lds instead of vmlinux.lds.s
Quoted 5 lines · Dan Aloni
Hello Sam,
Here's the first patch. Note that I had to choose PPFLAGS instead of CPPFLAGS because otherwise it would have collided with the other uses of CPPFLAGS.
That collision was intentional.
I have changed that to cppflags and added both your patches to my tree. The 2/2 missed a few *lds files which added also.
Thanks for your effort!
Sam
PATCH 1/1 [#3 2/2] Generate vmlinux.lds instead of vmlinux.lds.s
In reply to Sam RavnborgHello Sam,
This is for the other architectures. I haven't test-compiled it, though.
arch/alpha/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := head.o vmlinux.lds.s +extra-y := head.o vmlinux.lds EXTRA_AFLAGS := $(CFLAGS) EXTRA_CFLAGS := -Werror -Wno-sign-compare
arch/arm/Makefile +1 -1
@@ -9,7 +9,7 @@ LDFLAGS_vmlinux :=-p --no-undefined -X LDFLAGS_BLOB :=--format binary -AFLAGS_vmlinux.lds.o = -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR) +PPFLAGS_vmlinux.o = -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR) OBJCOPYFLAGS :=-O binary -R .note -R .comment -S GZFLAGS :=-9 #CFLAGS +=-pipe
arch/arm/kernel/Makefile +1 -1
@@ -26,7 +26,7 @@ head-y := head.o obj-$(CONFIG_DEBUG_LL) += debug.o -extra-y := $(head-y) init_task.o vmlinux.lds.s +extra-y := $(head-y) init_task.o vmlinux.lds # Spell out some dependencies that aren't automatically figured out $(obj)/entry-armv.o: $(obj)/entry-header.S include/asm-arm/constants.h
arch/arm26/Makefile +1 -1
@@ -9,7 +9,7 @@ LDFLAGS_vmlinux :=-p -X LDFLAGS_BLOB :=--format binary -AFLAGS_vmlinux.lds.o = -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR) +PPFLAGS_vmlinux.o = -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR) OBJCOPYFLAGS :=-O binary -R .note -R .comment -S GZFLAGS :=-9
arch/arm26/kernel/Makefile +1 -1
@@ -14,5 +14,5 @@ obj-$(CONFIG_FIQ) += fiq.o obj-$(CONFIG_MODULES) += armksyms.o -extra-y := init_task.o vmlinux.lds.s +extra-y := init_task.o vmlinux.lds
arch/cris/Makefile +1 -1
@@ -29,7 +29,7 @@ OBJCOPYFLAGS := -O binary -R .note -R .comment -S -AFLAGS_vmlinux.lds.o = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE) +PPFLAGS_vmlinux.o = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE) AFLAGS += -mlinux CFLAGS := $(CFLAGS) -mlinux -march=$(arch-y) -pipe
arch/cris/kernel/Makefile +1 -1
@@ -3,7 +3,7 @@ # Makefile for the linux kernel. # -extra-y := vmlinux.lds.s +extra-y := vmlinux.lds obj-y := process.o traps.o irq.o ptrace.o setup.o \ time.o sys_cris.o semaphore.o
arch/h8300/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := vmlinux.lds.s +extra-y := vmlinux.lds obj-y := process.o traps.o ptrace.o ints.o \ sys_h8300.o time.o semaphore.o signal.o \
arch/ia64/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \ irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o \
arch/m68k/kernel/Makefile +1 -1
@@ -7,7 +7,7 @@ else extra-y := sun3-head.o endif -extra-y += vmlinux.lds.s +extra-y += vmlinux.lds obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o \ sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o
arch/m68knommu/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for arch/m68knommu/kernel. # -extra-y := vmlinux.lds.s +extra-y := vmlinux.lds obj-y += dma.o entry.o init_task.o m68k_ksyms.o process.o ptrace.o semaphore.o \ setup.o signal.o syscalltable.o sys_m68k.o time.o traps.o
arch/mips/Makefile +1 -1
@@ -643,7 +643,7 @@ # none has been choosen above. # -AFLAGS_vmlinux.lds.o := \ +PPFLAGS_vmlinux.o := \ -D"LOADADDR=$(load-y)" \ -D"JIFFIES=$(JIFFIES)" \ -imacros $(srctree)/include/asm-$(ARCH)/sn/mapped_kernel.h
arch/mips/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the Linux/MIPS kernel. # -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \ ptrace.o reset.o semaphore.o setup.o signal.o syscall.o \
arch/parisc/kernel/Makefile +1 -1
@@ -4,7 +4,7 @@ head-y := head.o head-$(CONFIG_PARISC64) := head64.o -extra-y := init_task.o $(head-y) vmlinux.lds.s +extra-y := init_task.o $(head-y) vmlinux.lds AFLAGS_entry.o := -traditional AFLAGS_pacache.o := -traditional
arch/ppc/Makefile +1 -1
@@ -70,7 +70,7 @@ all: zImage -AFLAGS_vmlinux.lds.o := -Upowerpc +PPFLAGS_vmlinux.o := -Upowerpc # All the instructions talk about "make bzImage". bzImage: zImage
arch/ppc/kernel/Makefile +1 -1
@@ -9,7 +9,7 @@ extra-$(CONFIG_8xx) := head_8xx.o extra-$(CONFIG_6xx) += idle_6xx.o extra-$(CONFIG_POWER4) += idle_power4.o -extra-y += vmlinux.lds.s +extra-y += vmlinux.lds obj-y := entry.o traps.o irq.o idle.o time.o misc.o \ process.o signal.o ptrace.o align.o \
arch/ppc64/kernel/Makefile +1 -1
@@ -3,7 +3,7 @@ # EXTRA_CFLAGS += -mno-minimal-toc -extra-y := head.o vmlinux.lds.s +extra-y := head.o vmlinux.lds obj-y := setup.o entry.o traps.o irq.o idle.o dma.o \ time.o process.o signal.o syscalls.o misc.o ptrace.o \
arch/s390/kernel/Makefile +1 -1
@@ -10,7 +10,7 @@ extra-$(CONFIG_ARCH_S390_31) += head.o extra-$(CONFIG_ARCH_S390X) += head64.o -extra-y += init_task.o vmlinux.lds.s +extra-y += init_task.o vmlinux.lds obj-$(CONFIG_MODULES) += s390_ksyms.o module.o obj-$(CONFIG_SMP) += smp.o
arch/sh/Makefile +1 -1
@@ -122,7 +122,7 @@ boot := arch/sh/boot -AFLAGS_vmlinux.lds.o := -traditional +PPFLAGS_vmlinux.o := -traditional prepare: target_links
arch/sh/boot/compressed/Makefile +1 -1
@@ -22,7 +22,7 @@ CONFIG_BOOT_LINK_OFFSET ?= 0x00800000 IMAGE_OFFSET := $(shell printf "0x%8x" $$[0x80000000+$(CONFIG_MEMORY_START)+$(CONFIG_BOOT_LINK_OFFSET)]) -LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds.s +LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE $(call if_changed,ld)
arch/sh/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the Linux/SuperH kernel. # -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds obj-y := process.o signal.o entry.o traps.o irq.o \ ptrace.o setup.o time.o sys_sh.o semaphore.o \
arch/sparc/boot/Makefile +1 -1
@@ -19,7 +19,7 @@ BTOBJS := $(HEAD_Y) $(INIT_Y) BTLIBS := $(CORE_Y) $(LIBS_Y) $(DRIVERS_Y) $(NET_Y) -LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds.s $(BTOBJS) --start-group $(BTLIBS) --end-group $(kallsyms.o) +LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds $(BTOBJS) --start-group $(BTLIBS) --end-group $(kallsyms.o) # Actual linking $(obj)/image: $(obj)/btfix.o FORCE
arch/sparc/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds EXTRA_AFLAGS := -ansi
arch/sparc64/Makefile +1 -1
@@ -10,7 +10,7 @@ CHECK := $(CHECK) -D__sparc__=1 -D__sparc_v9__=1 -AFLAGS_vmlinux.lds.o += -Usparc +PPFLAGS_vmlinux.o += -Usparc CC := $(shell if $(CC) -m64 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo $(CC); else echo sparc64-linux-gcc; fi )
arch/sparc64/kernel/Makefile +1 -1
@@ -5,7 +5,7 @@ EXTRA_AFLAGS := -ansi EXTRA_CFLAGS := -Werror -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds obj-y := process.o setup.o cpu.o idprom.o \ traps.o devices.o auxio.o \
arch/um/Makefile +2 -2
@@ -98,12 +98,12 @@ CONFIG_KERNEL_STACK_ORDER ?= 2 STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] ) -AFLAGS_vmlinux.lds.o = -U$(SUBARCH) \ +PPFLAGS_vmlinux.o = -U$(SUBARCH) \ -DSTART=$$(($(TOP_ADDR) - $(SIZE))) -DELF_ARCH=$(ELF_ARCH) \ -DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE_TT) \ -DKERNEL_STACK_SIZE=$(STACK_SIZE) -AFLAGS_$(LD_SCRIPT-y:.s=).o = $(AFLAGS_vmlinux.lds.o) -P -C -Uum +PPFLAGS_$(LD_SCRIPT-y:.s=).o = $(PPFLAGS_vmlinux.o) -P -C -Uum LD_SCRIPT-y := $(ARCH_DIR)/$(LD_SCRIPT-y)
arch/um/kernel/Makefile +1 -1
@@ -3,7 +3,7 @@ # Licensed under the GPL # -extra-y := vmlinux.lds.s +extra-y := vmlinux.lds obj-y = checksum.o config.o exec_kern.o exitcode.o frame_kern.o frame.o \ helper.o init_task.o irq.o irq_user.o ksyms.o mem.o mem_user.o \
arch/v850/kernel/Makefile +1 -1
@@ -9,7 +9,7 @@ # for more details. # -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds obj-y += intv.o entry.o process.o syscalls.o time.o semaphore.o setup.o \ signal.o irq.o mach.o ptrace.o bug.o
arch/x86_64/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := head.o head64.o init_task.o vmlinux.lds.s +extra-y := head.o head64.o init_task.o vmlinux.lds EXTRA_AFLAGS := -traditional obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \
arch/x86_64/kernel/Makefile-HEAD +1 -1
@@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := head.o head64.o init_task.o vmlinux.lds.s +extra-y := head.o head64.o init_task.o vmlinux.lds EXTRA_AFLAGS := -traditional obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \
Signature · 2 lines
Dan Aloni [email protected]
Quoted 10 lines · Sam Ravnborg
Quoted 8 lines · Benno
The solution is fairly striaght forward -- just change the suffixes, the problem is exactly how to change them. I would propose changing it such that was stick with "
vmlinux.lds.S" and have it generate "vmlinux.lds"This would require the fewest changes to implement, just 1/ change %.s %.S rule to %.lds %.lds.S
2/ change the link flags from "-T vmlinux.lds.s" -> "-Tvmlinux.lds"
Quoted 5 lines
I agree with this approach, and see no defencies.
Care to send two patches.
One that do what you suggest for i386, and another that cover the rest of the architectures?
.. and the second patch:
arch/alpha/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := head.o vmlinux.lds.s +extra-y := head.o vmlinux.lds EXTRA_AFLAGS := $(CFLAGS) EXTRA_CFLAGS := -Werror -Wno-sign-compare
arch/arm/kernel/Makefile +1 -1
@@ -27,7 +27,7 @@ head-y := head.o obj-$(CONFIG_DEBUG_LL) += debug.o -extra-y := $(head-y) init_task.o vmlinux.lds.s +extra-y := $(head-y) init_task.o vmlinux.lds # Spell out some dependencies that aren't automatically figured out $(obj)/entry-armv.o: $(obj)/entry-header.S include/asm-arm/constants.h
arch/arm26/kernel/Makefile +1 -1
@@ -14,5 +14,5 @@ obj-$(CONFIG_FIQ) += fiq.o obj-$(CONFIG_MODULES) += armksyms.o -extra-y := init_task.o vmlinux.lds.s +extra-y := init_task.o vmlinux.lds
arch/cris/kernel/Makefile +1 -1
@@ -3,7 +3,7 @@ # Makefile for the linux kernel. # -extra-y := vmlinux.lds.s +extra-y := vmlinux.lds obj-y := process.o traps.o irq.o ptrace.o setup.o \ time.o sys_cris.o semaphore.o
arch/h8300/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := vmlinux.lds.s +extra-y := vmlinux.lds obj-y := process.o traps.o ptrace.o ints.o \ sys_h8300.o time.o semaphore.o signal.o \
arch/ia64/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \ irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o \
arch/m68k/kernel/Makefile +1 -1
@@ -7,7 +7,7 @@ else extra-y := sun3-head.o endif -extra-y += vmlinux.lds.s +extra-y += vmlinux.lds obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o \ sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o
arch/m68knommu/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for arch/m68knommu/kernel. # -extra-y := vmlinux.lds.s +extra-y := vmlinux.lds obj-y += dma.o entry.o init_task.o m68k_ksyms.o process.o ptrace.o semaphore.o \ setup.o signal.o syscalltable.o sys_m68k.o time.o traps.o
arch/mips/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the Linux/MIPS kernel. # -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \ ptrace.o reset.o semaphore.o setup.o signal.o syscall.o \
arch/parisc/kernel/Makefile +1 -1
@@ -4,7 +4,7 @@ head-y := head.o head-$(CONFIG_PARISC64) := head64.o -extra-y := init_task.o $(head-y) vmlinux.lds.s +extra-y := init_task.o $(head-y) vmlinux.lds AFLAGS_entry.o := -traditional AFLAGS_pacache.o := -traditional
arch/ppc/kernel/Makefile +1 -1
@@ -15,7 +15,7 @@ extra-$(CONFIG_8xx) := head_8xx.o extra-$(CONFIG_6xx) += idle_6xx.o extra-$(CONFIG_POWER4) += idle_power4.o -extra-y += vmlinux.lds.s +extra-y += vmlinux.lds obj-y := entry.o traps.o irq.o idle.o time.o misc.o \ process.o signal.o ptrace.o align.o \
arch/ppc64/kernel/Makefile +1 -1
@@ -3,7 +3,7 @@ # EXTRA_CFLAGS += -mno-minimal-toc -extra-y := head.o vmlinux.lds.s +extra-y := head.o vmlinux.lds obj-y := setup.o entry.o traps.o irq.o idle.o dma.o \ time.o process.o signal.o syscalls.o misc.o ptrace.o \
arch/s390/kernel/Makefile +1 -1
@@ -10,7 +10,7 @@ extra-$(CONFIG_ARCH_S390_31) += head.o extra-$(CONFIG_ARCH_S390X) += head64.o -extra-y += init_task.o vmlinux.lds.s +extra-y += init_task.o vmlinux.lds obj-$(CONFIG_MODULES) += s390_ksyms.o module.o obj-$(CONFIG_SMP) += smp.o
arch/sh/boot/compressed/Makefile +1 -1
@@ -18,7 +18,7 @@ # IMAGE_OFFSET := $(shell printf "0x%8x" $$[0x80000000+$(CONFIG_MEMORY_START)+$(CONFIG_BOOT_LINK_OFFSET)]) -LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds.s +LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE $(call if_changed,ld)
arch/sh/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the Linux/SuperH kernel. # -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds obj-y := process.o signal.o entry.o traps.o irq.o \ ptrace.o setup.o time.o sys_sh.o semaphore.o \
arch/sparc/boot/Makefile +1 -1
@@ -19,7 +19,7 @@ BTOBJS := $(HEAD_Y) $(INIT_Y) BTLIBS := $(CORE_Y) $(LIBS_Y) $(DRIVERS_Y) $(NET_Y) -LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds.s $(BTOBJS) --start-group $(BTLIBS) --end-group $(kallsyms.o) +LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds $(BTOBJS) --start-group $(BTLIBS) --end-group $(kallsyms.o) # Actual linking $(obj)/image: $(obj)/btfix.o FORCE
arch/sparc/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds EXTRA_AFLAGS := -ansi
arch/sparc64/kernel/Makefile +1 -1
@@ -5,7 +5,7 @@ EXTRA_AFLAGS := -ansi EXTRA_CFLAGS := -Werror -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds obj-y := process.o setup.o cpu.o idprom.o \ traps.o devices.o auxio.o \
arch/um/kernel/Makefile +1 -1
@@ -3,7 +3,7 @@ # Licensed under the GPL # -extra-y := vmlinux.lds.s +extra-y := vmlinux.lds obj-y = checksum.o config.o exec_kern.o exitcode.o frame_kern.o frame.o \ helper.o init_task.o irq.o irq_user.o ksyms.o mem.o mem_user.o \
arch/v850/kernel/Makefile +1 -1
@@ -9,7 +9,7 @@ # for more details. # -extra-y := head.o init_task.o vmlinux.lds.s +extra-y := head.o init_task.o vmlinux.lds obj-y += intv.o entry.o process.o syscalls.o time.o semaphore.o setup.o \ signal.o irq.o mach.o ptrace.o bug.o
arch/x86_64/kernel/Makefile +1 -1
@@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := head.o head64.o init_task.o vmlinux.lds.s +extra-y := head.o head64.o init_task.o vmlinux.lds EXTRA_AFLAGS := -traditional obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \
arch/x86_64/kernel/Makefile-HEAD +1 -1
@@ -2,7 +2,7 @@ # Makefile for the linux kernel. # -extra-y := head.o head64.o init_task.o vmlinux.lds.s +extra-y := head.o head64.o init_task.o vmlinux.lds EXTRA_AFLAGS := -traditional obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \
Signature · 2 lines
Dan Aloni [email protected]