Collect the symbols exported by anything that goes into lib.a and add an empty object (lib-exports.o) with explicit undefs for each of those to obj-y. That allows to relax the rules regarding the use of exports in lib-* objects - right now an object with export can be in lib-* only if we are guaranteed that there always will be users in built-in parts of the tree, otherwise it needs to be in obj-*. As the result, we have an unholy mix of lib- and obj- in lib/Makefile and (especially) in arch/*/lib/Makefile. Moreover, a change in generic part of the kernel can lead to mysteriously missing exports on some configs. With this change we don't have to worry about that anymore. One side effect is that built-in.o now pulls everything with exports from the corresponding lib.a (if such exists). That's exactly what we want for linking vmlinux and fortunately it's almost the only thing built-in.o is used in. arch/ia64/hp/sim/boot/bootloader is the only exception and it's easy to get rid of now - just turn everything in arch/ia64/lib into lib-* and don't bother with arch/ia64/lib/built-in.o anymore. [AV: stylistic fix from Michal folded in] Acked-by: Michal Marek <mmarek@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
38 lines
958 B
Makefile
38 lines
958 B
Makefile
#
|
|
# ia64/boot/Makefile
|
|
#
|
|
# This file is subject to the terms and conditions of the GNU General Public
|
|
# License. See the file "COPYING" in the main directory of this archive
|
|
# for more details.
|
|
#
|
|
# Copyright (C) 1998, 2003 by David Mosberger-Tang <davidm@hpl.hp.com>
|
|
#
|
|
|
|
targets-$(CONFIG_IA64_HP_SIM) += bootloader
|
|
targets := vmlinux.bin vmlinux.gz $(targets-y)
|
|
|
|
quiet_cmd_cptotop = LN $@
|
|
cmd_cptotop = ln -f $< $@
|
|
|
|
vmlinux.gz: $(obj)/vmlinux.gz $(addprefix $(obj)/,$(targets-y))
|
|
$(call cmd,cptotop)
|
|
@echo ' Kernel: $@ is ready'
|
|
|
|
boot: bootloader
|
|
|
|
bootloader: $(obj)/bootloader
|
|
$(call cmd,cptotop)
|
|
|
|
$(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
|
|
$(call if_changed,gzip)
|
|
|
|
$(obj)/vmlinux.bin: vmlinux FORCE
|
|
$(call if_changed,objcopy)
|
|
|
|
|
|
LDFLAGS_bootloader = -static -T
|
|
|
|
$(obj)/bootloader: $(src)/bootloader.lds $(obj)/bootloader.o $(obj)/boot_head.o $(obj)/fw-emu.o \
|
|
lib/lib.a arch/ia64/lib/lib.a FORCE
|
|
$(call if_changed,ld)
|