<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/scripts/Makefile.spl, branch v2021.10-rc2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>build: remove the variable NM in gen_ll_addressable_symbols.sh</title>
<updated>2021-07-29T00:46:34+00:00</updated>
<author>
<name>Patrick Delaunay</name>
<email>patrick.delaunay@foss.st.com</email>
</author>
<published>2021-07-21T07:56:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ff7852d5442ab48c71cce69e19bac3d6a5183496'/>
<id>ff7852d5442ab48c71cce69e19bac3d6a5183496</id>
<content type='text'>
With LTO activated, the buildman tools failed with an error on my
configuration (Ubuntu 20.04, stm32mp15_trusted_defconfig) with the error:

../arm-linux-gnueabi/bin/nm:
	scripts/gen_ll_addressable_symbols.sh: file format not recognized

It seems the shell variable initialization NM=$(NM) is not correctly
interpreted when shell is started in the Makefile, but I have not this
issue when I compile the same target without buildman.

I don't found the root reason of the problem but I solve it by
providing $(NM) as script parameter instead using a shell variable.

The command executed is identical:

cmd_keep-syms-lto.c := NM=arm-none-linux-gnueabihf-gcc-nm \
u-boot/scripts/gen_ll_addressable_symbols.sh arch/arm/cpu/built-in.o \
.... net/built-in.o &gt;keep-syms-lto.c

cmd_keep-syms-lto.c := u-boot/scripts/gen_ll_addressable_symbols.sh \
arm-none-linux-gnueabihf-gcc-nm arch/arm/cpu/built-in.o \
... net/built-in.o &gt; keep-syms-lto.c

Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Patrick Delaunay &lt;patrick.delaunay@foss.st.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With LTO activated, the buildman tools failed with an error on my
configuration (Ubuntu 20.04, stm32mp15_trusted_defconfig) with the error:

../arm-linux-gnueabi/bin/nm:
	scripts/gen_ll_addressable_symbols.sh: file format not recognized

It seems the shell variable initialization NM=$(NM) is not correctly
interpreted when shell is started in the Makefile, but I have not this
issue when I compile the same target without buildman.

I don't found the root reason of the problem but I solve it by
providing $(NM) as script parameter instead using a shell variable.

The command executed is identical:

cmd_keep-syms-lto.c := NM=arm-none-linux-gnueabihf-gcc-nm \
u-boot/scripts/gen_ll_addressable_symbols.sh arch/arm/cpu/built-in.o \
.... net/built-in.o &gt;keep-syms-lto.c

cmd_keep-syms-lto.c := u-boot/scripts/gen_ll_addressable_symbols.sh \
arm-none-linux-gnueabihf-gcc-nm arch/arm/cpu/built-in.o \
... net/built-in.o &gt; keep-syms-lto.c

Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Patrick Delaunay &lt;patrick.delaunay@foss.st.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>build: link with --build-id=none</title>
<updated>2021-05-24T18:21:30+00:00</updated>
<author>
<name>Marek Behún</name>
<email>marek.behun@nic.cz</email>
</author>
<published>2021-05-20T11:24:04+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=da48bd9ee5768e9811e4fbbab964c7f9d64fce3d'/>
<id>da48bd9ee5768e9811e4fbbab964c7f9d64fce3d</id>
<content type='text'>
Some toolchains are compiled so that they pass a --build-id=something
parameter to the linker implicitly.

This causes U-Boot LTO linking to fail with something like:
  ld: section .note.gnu.build-id LMA ... overlaps section .text LMA ...
because U-Boot's link scripts do not currently handle .note.gnu.build-id
section.

Fix this by explicitly disabling build-id.

Signed-off-by: Marek Behún &lt;marek.behun@nic.cz&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some toolchains are compiled so that they pass a --build-id=something
parameter to the linker implicitly.

This causes U-Boot LTO linking to fail with something like:
  ld: section .note.gnu.build-id LMA ... overlaps section .text LMA ...
because U-Boot's link scripts do not currently handle .note.gnu.build-id
section.

Fix this by explicitly disabling build-id.

Signed-off-by: Marek Behún &lt;marek.behun@nic.cz&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>build: support building with Link Time Optimizations</title>
<updated>2021-05-24T18:21:30+00:00</updated>
<author>
<name>Marek Behún</name>
<email>marek.behun@nic.cz</email>
</author>
<published>2021-05-20T11:24:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c1094987d1dc4701646c5f3aa254e7a92a02d305'/>
<id>c1094987d1dc4701646c5f3aa254e7a92a02d305</id>
<content type='text'>
Add plumbing for building U-Boot with Link Time Optimizations.

When building with LTO, $(PLATFORM_LIBS) has to be in --whole-archive /
--no-whole-archive group, otherwise some functions declared in assembly
may not be resolved and linking may fail.

Note: clang may throw away linker list symbols it thinks are unused when
compiling with LTO. To force these symbols to be included, we refer to
them via the __ADDRESSABLE macro in a C file generated from compiled
built-in.o files before linking.

Signed-off-by: Marek Behún &lt;marek.behun@nic.cz&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add plumbing for building U-Boot with Link Time Optimizations.

When building with LTO, $(PLATFORM_LIBS) has to be in --whole-archive /
--no-whole-archive group, otherwise some functions declared in assembly
may not be resolved and linking may fail.

Note: clang may throw away linker list symbols it thinks are unused when
compiling with LTO. To force these symbols to be included, we refer to
them via the __ADDRESSABLE macro in a C file generated from compiled
built-in.o files before linking.

Signed-off-by: Marek Behún &lt;marek.behun@nic.cz&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>build: use thin archives instead of incremental linking</title>
<updated>2021-05-24T18:21:30+00:00</updated>
<author>
<name>Marek Behún</name>
<email>marek.behun@nic.cz</email>
</author>
<published>2021-05-20T11:24:02+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=958f2e57eff72b5156f7b08b9c1415fb7e12833d'/>
<id>958f2e57eff72b5156f7b08b9c1415fb7e12833d</id>
<content type='text'>
Currently we use incremental linking (ld -r) to link several object
files from one directory into one built-in.o object file containing the
linked code from that directory (and its subdirectories).

Linux has, some time ago, moved to thin archives instead.

Thin archives are archives (.a) that do not really contain the object
files, only references to them.

Using thin archives instead of incremental linking
- saves disk space
- apparently works better with dead code elimination
- makes things easier for LTO

The third point is the important one for us. With incremental linking
there are several options how to do LTO, and that would unnecessarily
complicate things.

We have to use the --whole-archive/--no-whole-archive linking option
instead of --start-group/--end-group, otherwise linking may fail because
of unresolved symbols, or the resulting binary will be unusable.

We also need to use the P flag for ar, otherwise final linking may fail.

Signed-off-by: Marek Behún &lt;marek.behun@nic.cz&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently we use incremental linking (ld -r) to link several object
files from one directory into one built-in.o object file containing the
linked code from that directory (and its subdirectories).

Linux has, some time ago, moved to thin archives instead.

Thin archives are archives (.a) that do not really contain the object
files, only references to them.

Using thin archives instead of incremental linking
- saves disk space
- apparently works better with dead code elimination
- makes things easier for LTO

The third point is the important one for us. With incremental linking
there are several options how to do LTO, and that would unnecessarily
complicate things.

We have to use the --whole-archive/--no-whole-archive linking option
instead of --start-group/--end-group, otherwise linking may fail because
of unresolved symbols, or the resulting binary will be unusable.

We also need to use the P flag for ar, otherwise final linking may fail.

Signed-off-by: Marek Behún &lt;marek.behun@nic.cz&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Makefile, Makefile.spl: cosmetic change</title>
<updated>2021-05-24T18:21:30+00:00</updated>
<author>
<name>Marek Behún</name>
<email>marek.behun@nic.cz</email>
</author>
<published>2021-05-20T11:24:01+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1445836ca70198471ee7b90ce691a6be2b9322d1'/>
<id>1445836ca70198471ee7b90ce691a6be2b9322d1</id>
<content type='text'>
Indent the linking commands so that they look cosmetically better.

Signed-off-by: Marek Behún &lt;marek.behun@nic.cz&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Indent the linking commands so that they look cosmetically better.

Signed-off-by: Marek Behún &lt;marek.behun@nic.cz&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for stack-protector</title>
<updated>2021-04-20T11:31:12+00:00</updated>
<author>
<name>Joel Peshkin</name>
<email>joel.peshkin@broadcom.com</email>
</author>
<published>2021-04-11T09:21:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4e9bce12432492aa7a7c2121d9fae1640606ace5'/>
<id>4e9bce12432492aa7a7c2121d9fae1640606ace5</id>
<content type='text'>
Add support for stack protector for UBOOT, SPL, and TPL
as well as new pytest for stackprotector

Signed-off-by: Joel Peshkin &lt;joel.peshkin@broadcom.com&gt;

Adjust UEFI build flags.
Signed-off-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add support for stack protector for UBOOT, SPL, and TPL
as well as new pytest for stackprotector

Signed-off-by: Joel Peshkin &lt;joel.peshkin@broadcom.com&gt;

Adjust UEFI build flags.
Signed-off-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Makefile: Remove old of-platdata files before regenerating</title>
<updated>2021-03-26T04:03:08+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2021-03-24T17:40:53+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=354d2324635cb77b7bf9a9ad80c4d48b7761c4f7'/>
<id>354d2324635cb77b7bf9a9ad80c4d48b7761c4f7</id>
<content type='text'>
Which files we generate depends on the setting of OF_PLATDATA_INST in the
build. This might change between builds, but the build directory may be
reused.

Leaving old files around is confusing and switching the OF_PLATDATA_INST
setting does not necessarily regenerate the files, e.g. if the devicetree
has not changed.

Remove all the files before regenerating new ones.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Which files we generate depends on the setting of OF_PLATDATA_INST in the
build. This might change between builds, but the build directory may be
reused.

Leaving old files around is confusing and switching the OF_PLATDATA_INST
setting does not necessarily regenerate the files, e.g. if the devicetree
has not changed.

Remove all the files before regenerating new ones.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Makefile: Use a variable for generated of-platdata headers</title>
<updated>2021-03-26T04:03:08+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2021-03-24T17:40:52+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=56b313d1b637815dd01463698cc722a27ae361e4'/>
<id>56b313d1b637815dd01463698cc722a27ae361e4</id>
<content type='text'>
There are actually two generated files but only one is currently mentioned
in the Makefile as a dependency. Put them both in a Makefile variable and
use that instead, to avoid inconsistency.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are actually two generated files but only one is currently mentioned
in the Makefile as a dependency. Put them both in a Makefile variable and
use that instead, to avoid inconsistency.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Makefile: Depend only on required of-platdata files</title>
<updated>2021-03-26T04:03:08+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2021-03-24T17:40:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=13d71152f1e1323e0a5caf3a78b7a457fff58257'/>
<id>13d71152f1e1323e0a5caf3a78b7a457fff58257</id>
<content type='text'>
When OF_PLATDATA_INST is enabled, we need dt-uclass.c and dt-device.c for
the build to work. When OF_PLATDATA_INST is not enabled, we only need
dt-plat.c

Update the Makefile rules to indicate this.

At present all files are generated and compiled regardless of which are
actually needed.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When OF_PLATDATA_INST is enabled, we need dt-uclass.c and dt-device.c for
the build to work. When OF_PLATDATA_INST is not enabled, we only need
dt-plat.c

Update the Makefile rules to indicate this.

At present all files are generated and compiled regardless of which are
actually needed.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Makefile: Avoid running dtoc every time</title>
<updated>2021-03-26T04:03:08+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2021-03-24T17:40:49+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6519da47411e90322c59e3fa4b41ff398ff0a688'/>
<id>6519da47411e90322c59e3fa4b41ff398ff0a688</id>
<content type='text'>
Since the dst_dir rule always runs, it causes a rebuild of the of-platdata
files even if not needed.

Create the directory inside the rule instead.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since the dst_dir rule always runs, it causes a rebuild of the of-platdata
files even if not needed.

Create the directory inside the rule instead.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
