]> git.baikalelectronics.ru Git - kernel.git/commit
[kbuild] handle exports in lib-y objects reliably
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 15 Jan 2016 19:01:22 +0000 (14:01 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 8 Aug 2016 03:46:30 +0000 (23:46 -0400)
commit79a3dcdcab85b6e2301e2b552cb2d0fa039353ea
tree4f9f5e144b7b452f32d6d6132cad6d744f93a189
parentb482605f7939bd4035b2d11a7952dc3da5821c6d
[kbuild] handle exports in lib-y objects reliably

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>
arch/ia64/hp/sim/boot/Makefile
arch/ia64/lib/Makefile
scripts/Makefile.build