<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/scripts/Makefile.build, branch v4.9.5</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.5</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.5'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2016-11-09T21:29:53Z</updated>
<entry>
<title>kbuild: be more careful about matching preprocessed asm ___EXPORT_SYMBOL</title>
<updated>2016-11-09T21:29:53Z</updated>
<author>
<name>Nicholas Piggin</name>
<email>npiggin@gmail.com</email>
</author>
<published>2016-11-09T04:34:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cc6acc11cad1eb1ae39707a3a6e4a97fafbeeabd'/>
<id>urn:sha1:cc6acc11cad1eb1ae39707a3a6e4a97fafbeeabd</id>
<content type='text'>
The CRC code for asm exports grabs the preprocessed asm, finds the
___EXPORT_SYMBOL and turns those into EXPORT_SYMBOL in a C program
that can be preprocessed and parsed to create the CRC signatures from
the type.

The existing regex matching and replacement is too strict, and doesn't
deal well with whitespace among other things. The line
" EXPORT_SYMBOL(sym)" in a .S file would not match due to initial
whitespace, for example, which resulted in x86's ___preempt_schedule
failing to get CRCs.

Reported-by: Philip Müller &lt;philm@manjaro.org&gt;
Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
</entry>
<entry>
<title>kbuild: modversions for EXPORT_SYMBOL() for asm</title>
<updated>2016-11-01T15:20:17Z</updated>
<author>
<name>Nicholas Piggin</name>
<email>npiggin@gmail.com</email>
</author>
<published>2016-11-01T01:46:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4efca4ed05cbdfd13ec3e8cb623fb77d6e4ab187'/>
<id>urn:sha1:4efca4ed05cbdfd13ec3e8cb623fb77d6e4ab187</id>
<content type='text'>
Allow architectures to create asm/asm-prototypes.h file that
provides C prototypes for exported asm functions, which enables
proper CRC versions to be generated for them.

Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
</entry>
<entry>
<title>kbuild: prevent lib-ksyms.o rebuilds</title>
<updated>2016-10-22T19:49:30Z</updated>
<author>
<name>Nicholas Piggin</name>
<email>npiggin@gmail.com</email>
</author>
<published>2016-10-20T14:13:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=989cea5c14be024e879c0055dc6d033680a52610'/>
<id>urn:sha1:989cea5c14be024e879c0055dc6d033680a52610</id>
<content type='text'>
Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Reported-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
Tested-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
</entry>
<entry>
<title>kbuild: allow architectures to use thin archives instead of ld -r</title>
<updated>2016-09-09T08:31:19Z</updated>
<author>
<name>Stephen Rothwell</name>
<email>sfr@canb.auug.org.au</email>
</author>
<published>2016-08-24T12:29:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a5967db9af51a84f5e181600954714a9e4c69f1f'/>
<id>urn:sha1:a5967db9af51a84f5e181600954714a9e4c69f1f</id>
<content type='text'>
ld -r is an incremental link used to create built-in.o files in build
subdirectories. It produces relocatable object files containing all
its input files, and these are are then pulled together and relocated
in the final link. Aside from the bloat, this constrains the final
link relocations, which has bitten large powerpc builds with
unresolvable relocations in the final link.

Alan Modra has recommended the kernel use thin archives for linking.
This is an alternative and means that the linker has more information
available to it when it links the kernel.

This patch enables a config option architectures can select, which
causes all built-in.o files to be built as thin archives. built-in.o
files in subdirectories do not get symbol table or index attached,
which improves speed and size. The final link pass creates a
built-in.o archive in the root output directory which includes the
symbol table and index. The linker then uses takes this file to link.

The --whole-archive linker option is required, because the linker now
has visibility to every individual object file, and it will otherwise
just completely avoid including those without external references
(consider a file with EXPORT_SYMBOL or initcall or hardware exceptions
as its only entry points). The traditional built works "by luck" as
built-in.o files are large enough that they're going to get external
references. However this optimisation is unpredictable for the kernel
(due to above external references), ineffective at culling unused, and
costly because the .o files have to be searched for references.
Superior alternatives for link-time culling should be used instead.

Build characteristics for inclink vs thinarc, on a small powerpc64le
pseries VM with a modest .config:

                                  inclink       thinarc
sizes
vmlinux                        15 618 680    15 625 028
sum of all built-in.o          56 091 808     1 054 334
sum excluding root built-in.o                   151 430

find -name built-in.o | xargs rm ; time make vmlinux
real                              22.772s       21.143s
user                              13.280s       13.430s
sys                                4.310s        2.750s

- Final kernel pulled in only about 6K more, which shows how
  ineffective the object file culling is.
- Build performance looks improved due to less pagecache activity.
  On IO constrained systems it could be a bigger win.
- Build size saving is significant.

Side note, the toochain understands archives, so there's some tricks,
$ ar t built-in.o          # list all files you linked with
$ size built-in.o          # and their sizes
$ objdump -d built-in.o    # disassembly (unrelocated) with filenames

Implementation by sfr, minor tweaks by npiggin.

Signed-off-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
</entry>
<entry>
<title>[kbuild] handle exports in lib-y objects reliably</title>
<updated>2016-08-08T03:46:30Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2016-01-15T19:01:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7f2084fa55e6cb61f61b4224d4a8bafaeee55f9f'/>
<id>urn:sha1:7f2084fa55e6cb61f61b4224d4a8bafaeee55f9f</id>
<content type='text'>
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 &lt;mmarek@suse.cz&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>Shared library support</title>
<updated>2016-06-07T20:57:10Z</updated>
<author>
<name>Emese Revfy</name>
<email>re.emese@gmail.com</email>
</author>
<published>2016-05-23T22:08:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=24403874316a7180d367e51d7f7e25d5de1f78dd'/>
<id>urn:sha1:24403874316a7180d367e51d7f7e25d5de1f78dd</id>
<content type='text'>
Infrastructure for building independent shared library targets.

Based on work created by the PaX Team.

Signed-off-by: Emese Revfy &lt;re.emese@gmail.com&gt;
Acked-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
</entry>
<entry>
<title>kbuild: rename cmd_as_s_S to cmd_cpp_s_S</title>
<updated>2016-04-20T08:49:09Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2016-04-08T02:24:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e0f41e52ddf5dc676577f974c9f0af77732f251a'/>
<id>urn:sha1:e0f41e52ddf5dc676577f974c9f0af77732f251a</id>
<content type='text'>
This command just preprocesses .S files into .s files, so cmd_cpp_s_S
seems more suitable.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
</entry>
<entry>
<title>kbuild: rename cmd_cc_i_c to cmd_cpp_i_c</title>
<updated>2016-04-20T08:48:19Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2016-04-08T02:24:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=23d43848708afd7aa9a2c8516a3f269a3e71be4f'/>
<id>urn:sha1:23d43848708afd7aa9a2c8516a3f269a3e71be4f</id>
<content type='text'>
This command just preprocesses .c files into .i files, so cmd_cpp_i_c
seems more suitable.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Acked-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
</entry>
<entry>
<title>kbuild: de-duplicate fixdep usage</title>
<updated>2016-03-29T20:30:56Z</updated>
<author>
<name>Nicolas Pitre</name>
<email>nicolas.pitre@linaro.org</email>
</author>
<published>2016-02-17T20:50:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e4aca45950050fc584e036bb1b266ce1264a6daf'/>
<id>urn:sha1:e4aca45950050fc584e036bb1b266ce1264a6daf</id>
<content type='text'>
The generation and postprocessing of automatic dependency rules is
duplicated in rule_cc_o_c, rule_as_o_S and if_changed_dep. Since
this is not a trivial one-liner action, it is now abstracted under
cmd_and_fixdep to simplify things and make future changes in this area
easier.

In the rule_cc_o_c and rule_as_o_S cases that means the order of some
commands has been altered, namely fixdep and related file manipulations
are executed earlier, but they didn't depend on those commands that now
execute later.

Signed-off-by: Nicolas Pitre &lt;nico@linaro.org&gt;
</content>
</entry>
<entry>
<title>kbuild: record needed exported symbols for modules</title>
<updated>2016-03-29T17:30:54Z</updated>
<author>
<name>Nicolas Pitre</name>
<email>nicolas.pitre@linaro.org</email>
</author>
<published>2016-01-21T22:07:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9895c03d48115c7783c0ef0a591447d53254ef84'/>
<id>urn:sha1:9895c03d48115c7783c0ef0a591447d53254ef84</id>
<content type='text'>
Kernel modules are partially linked object files with some undefined
symbols that are expected to be matched with EXPORT_SYMBOL() entries
from elsewhere.

Each .tmp_versions/*.mod file currently contains two line of text
separated by a newline character. The first line has the actual module
file name while the second line has a list of object files constituting
that module. Those files are parsed by modpost (scripts/mod/sumversion.c),
scripts/Makefile.modpost, scripts/Makefile.modsign, etc.  Only the
modpost utility cares about the second line while the others retrieve
only the first line.

Therefore we can add a third line to record the list of undefined symbols
aka required EXPORT_SYMBOL() entries for each module into that file
without breaking anything. Like for the second line, symbols are separated
by a blank and the list is terminated with a newline character.

To avoid needless build overhead, the undefined symbols extraction is
performed only when CONFIG_TRIM_UNUSED_KSYMS is selected.

Signed-off-by: Nicolas Pitre &lt;nico@linaro.org&gt;
Acked-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
</feed>
