2008-01-30 15:32:30 +03:00
#
# linux/arch/x86/boot/compressed/Makefile
#
# create a compressed vmlinux image from the original vmlinux
#
2009-08-20 19:14:15 +04:00
targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma head_$( BITS) .o misc.o piggy.o
2008-01-30 15:32:30 +03:00
KBUILD_CFLAGS := -m$( BITS) -D__KERNEL__ $( LINUX_INCLUDE) -O2
KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
2009-04-02 04:35:00 +04:00
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
2008-01-30 15:32:30 +03: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__
2009-06-18 03:28:09 +04:00
GCOV_PROFILE := n
2008-01-30 15:32:30 +03:00
LDFLAGS := -m elf_$( UTS_MACHINE)
LDFLAGS_vmlinux := -T
2009-05-09 04:42:16 +04:00
hostprogs-y := mkpiggy
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-26 21:12:47 +04:00
$(obj)/vmlinux : $( obj ) /vmlinux .lds $( obj ) /head_ $( BITS ) .o $( obj ) /misc .o $( obj ) /piggy .o FORCE
2008-01-30 15:32:30 +03:00
$( call if_changed,ld)
@:
2008-02-13 23:54:58 +03:00
OBJCOPYFLAGS_vmlinux.bin := -R .comment -S
2008-01-30 15:32:30 +03:00
$(obj)/vmlinux.bin : vmlinux FORCE
$( call if_changed,objcopy)
2008-09-04 17:19:45 +04:00
targets += vmlinux.bin.all vmlinux.relocs relocs
2009-05-06 09:53:11 +04:00
hostprogs-$(CONFIG_X86_NEED_RELOCS) += relocs
2008-01-30 15:32:30 +03: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 09:53:11 +04:00
vmlinux.bin.all-$(CONFIG_X86_NEED_RELOCS) += $( obj) /vmlinux.relocs
2008-01-30 15:32:30 +03:00
2009-05-06 09:53:11 +04:00
$(obj)/vmlinux.bin.gz : $( vmlinux .bin .all -y ) FORCE
2008-01-30 15:32:30 +03:00
$( call if_changed,gzip)
2009-05-06 09:53:11 +04:00
$(obj)/vmlinux.bin.bz2 : $( vmlinux .bin .all -y ) FORCE
2009-01-05 00:46:17 +03:00
$( call if_changed,bzip2)
2009-05-06 09:53:11 +04:00
$(obj)/vmlinux.bin.lzma : $( vmlinux .bin .all -y ) FORCE
2009-01-05 00:46:17 +03:00
$( call if_changed,lzma)
2008-01-30 15:32:30 +03:00
2009-05-09 02:32:47 +04:00
suffix-$(CONFIG_KERNEL_GZIP) := gz
suffix-$(CONFIG_KERNEL_BZIP2) := bz2
suffix-$(CONFIG_KERNEL_LZMA) := lzma
2009-01-05 00:46:17 +03:00
2009-05-09 04:42:16 +04:00
quiet_cmd_mkpiggy = MKPIGGY $@
cmd_mkpiggy = $( obj) /mkpiggy $< > $@ || ( rm -f $@ ; false )
targets += piggy.S
$(obj)/piggy.S : $( obj ) /vmlinux .bin .$( suffix -y ) $( obj ) /mkpiggy FORCE
$( call if_changed,mkpiggy)