2008-01-30 20:32:30 +08:00
|
|
|
#
|
|
|
|
# linux/arch/x86/boot/compressed/Makefile
|
|
|
|
#
|
|
|
|
# create a compressed vmlinux image from the original vmlinux
|
|
|
|
#
|
|
|
|
|
2009-01-05 05:46:17 +08:00
|
|
|
targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma head_$(BITS).o misc.o piggy.o
|
2008-01-30 20:32:30 +08:00
|
|
|
|
|
|
|
KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2
|
|
|
|
KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
|
2009-04-02 08:35:00 +08:00
|
|
|
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
|
2008-01-30 20:32:30 +08:00
|
|
|
cflags-$(CONFIG_X86_64) := -mcmodel=small
|
|
|
|
KBUILD_CFLAGS += $(cflags-y)
|
|
|
|
KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
|
|
|
|
KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
|
|
|
|
|
|
|
|
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
|
|
|
|
|
|
|
|
LDFLAGS := -m elf_$(UTS_MACHINE)
|
|
|
|
LDFLAGS_vmlinux := -T
|
|
|
|
|
x86: unify arch/x86/boot/compressed/vmlinux_*.lds
Look at the:
diff -u arch/x86/boot/compressed/vmlinux_*.lds
output and realize that they're basially exactly the same except for
trivial naming differences, and the fact that the 64-bit version has a
"pgtable" thing.
So unify them.
There's some trivial cleanup there (make the output format a Kconfig thing
rather than doing #ifdef's for it, and unify both 32-bit and 64-bit BSS
end to "_ebss", where 32-bit used to use the traditional "_end"), but
other than that it's really very mindless and straigt conversion.
For example, I think we should aim to remove "startup_32" vs "startup_64",
and just call it "startup", and get rid of one more difference. I didn't
do that.
Also, notice the comment in the unified vmlinux.lds.S talks about
"head_64" and "startup_32" which is an odd and incorrect mix, but that was
actually what the old 64-bit only lds file had, so the confusion isn't
new, and now that mixing is arguably more accurate thanks to the
vmlinux.lds.S file being shared between the two cases ;)
[ Impact: cleanup, unification ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-27 01:12:47 +08:00
|
|
|
$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/piggy.o FORCE
|
2008-01-30 20:32:30 +08:00
|
|
|
$(call if_changed,ld)
|
|
|
|
@:
|
|
|
|
|
2008-02-14 04:54:58 +08:00
|
|
|
OBJCOPYFLAGS_vmlinux.bin := -R .comment -S
|
2008-01-30 20:32:30 +08:00
|
|
|
$(obj)/vmlinux.bin: vmlinux FORCE
|
|
|
|
$(call if_changed,objcopy)
|
|
|
|
|
|
|
|
|
2008-09-04 21:19:45 +08:00
|
|
|
targets += vmlinux.bin.all vmlinux.relocs relocs
|
2009-05-06 13:53:11 +08:00
|
|
|
hostprogs-$(CONFIG_X86_NEED_RELOCS) += relocs
|
2008-01-30 20:32:30 +08:00
|
|
|
|
|
|
|
quiet_cmd_relocs = RELOCS $@
|
|
|
|
cmd_relocs = $(obj)/relocs $< > $@;$(obj)/relocs --abs-relocs $<
|
|
|
|
$(obj)/vmlinux.relocs: vmlinux $(obj)/relocs FORCE
|
|
|
|
$(call if_changed,relocs)
|
|
|
|
|
|
|
|
vmlinux.bin.all-y := $(obj)/vmlinux.bin
|
2009-05-06 13:53:11 +08:00
|
|
|
vmlinux.bin.all-$(CONFIG_X86_NEED_RELOCS) += $(obj)/vmlinux.relocs
|
2008-01-30 20:32:30 +08:00
|
|
|
|
2009-05-06 13:53:11 +08:00
|
|
|
$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE
|
2008-01-30 20:32:30 +08:00
|
|
|
$(call if_changed,gzip)
|
2009-05-06 13:53:11 +08:00
|
|
|
$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE
|
2009-01-05 05:46:17 +08:00
|
|
|
$(call if_changed,bzip2)
|
2009-05-06 13:53:11 +08:00
|
|
|
$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
|
2009-01-05 05:46:17 +08:00
|
|
|
$(call if_changed,lzma)
|
2008-01-30 20:32:30 +08:00
|
|
|
|
2009-01-05 05:46:17 +08:00
|
|
|
suffix_$(CONFIG_KERNEL_GZIP) = gz
|
|
|
|
suffix_$(CONFIG_KERNEL_BZIP2) = bz2
|
|
|
|
suffix_$(CONFIG_KERNEL_LZMA) = lzma
|
|
|
|
|
2009-05-06 13:53:11 +08:00
|
|
|
LDFLAGS_piggy.o := -r --format binary --oformat $(CONFIG_OUTPUT_FORMAT) -T
|
2009-01-05 05:46:17 +08:00
|
|
|
$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix_y) FORCE
|
2008-01-30 20:32:30 +08:00
|
|
|
$(call if_changed,ld)
|