doc: Update our clang documentation to reflect current status
PATCH 1/2 doc: Update our clang documentation to reflect current status
First, since this document was written the biggest challenges at the time are simply not applicable anymore. Second, we need to list the challenges which are preventing more platforms from being able to be built with Clang today. Next, we update the general wording to be host distribution agnostic. Finally, the section about xenguest_arm64 issues is not present anymore.
---
Cc: Mark Kettenis <[email protected]>
This does leave the FreeBSD section unchanged and should likely be looked at again by someone with a BSD build machine available.
--- doc/build/clang.rst | 85 +++++++++++---------------------------------- 1 file changed, 21 insertions(+), 64 deletions(-)
doc/build/clang.rst +21 -64
@@ -1,34 +1,27 @@ Building with Clang =================== -The biggest problem when trying to compile U-Boot with Clang is that almost all -archs rely on storing gd in a global register and the Clang 3.5 user manual -states: "Clang does not support global register variables; this is unlikely to -be implemented soon because it requires additional LLVM backend support." - -The ARM backend can be instructed not to use the r9 and x18 registers using --ffixed-r9 or -ffixed-x18 respectively. As global registers themselves are not -supported inline assembly is needed to get and set the r9 or x18 value. This -leads to larger code then strictly necessary, but at least works. - -Debian based ------------- - -Required packages can be installed via apt, e.g. - -.. code-block:: bash - - sudo apt-get install clang - -We make use of the CROSS_COMPILE variable to derive the build target which is -passed as the --target parameter to clang. - -The CROSS_COMPILE variable further determines the paths to other build -tools. As assembler we use the binary pointed to by '$(CROSS_COMPILE)as' -instead of the LLVM integrated assembler (IAS). - -Here is an example demonstrating building U-Boot for the Raspberry Pi 2 -using clang: +In general terms, U-Boot support building with Clang as the C compiler and +building and booting our "sandbox" target is part of CI. + +There are however some specific issues that need to be addressed to fully +support building with Clang on all targets. + +* Given the issue reported in https://github.com/llvm/llvm-project/issues/78778 + currently one has to configure the build first with GCC. +* Support for passing the correct flags along to `$(CPP)` needs to be + backported from the Linux Kernel. +* Support for using Clang as the linker is required to support the LTO feature + which some platforms require in order to create an appropriately small + binary. + +In general, when building with Clang we make use of the CROSS_COMPILE variable +to derive the build target which is passed as the --target parameter to clang. +The CROSS_COMPILE variable further determines the paths to other build tools. +As assembler we use the binary pointed to by '$(CROSS_COMPILE)as' instead of +the LLVM integrated assembler (IAS). After installing clang as per the +instructions for your specific distribution, in order to build for example the +Raspberry Pi 2 using clang: .. code-block:: bash
@@ -72,39 +65,3 @@ simplified with a simple wrapper script - saved as #!/bin/sh exec clang -target arm-freebsd-eabi --sysroot /usr/arm-freebsd "$@" - - -Known Issues ------------- - -When build U-boot for `xenguest_arm64_defconfig` target, it reports linkage -error: - -.. code-block:: bash - - aarch64-linux-gnu-ld.bfd: drivers/xen/hypervisor.o: in function `do_hypervisor_callback': - /home/leoy/Dev2/u-boot/drivers/xen/hypervisor.c:188: undefined reference to `__aarch64_swp8_acq_rel' - aarch64-linux-gnu-ld.bfd: drivers/xen/hypervisor.o: in function `synch_test_and_set_bit': - /home/leoy/Dev2/u-boot/./arch/arm/include/asm/xen/system.h:40: undefined reference to `__aarch64_ldset1_acq_rel' - aarch64-linux-gnu-ld.bfd: drivers/xen/hypervisor.o: in function `synch_test_and_clear_bit': - /home/leoy/Dev2/u-boot/./arch/arm/include/asm/xen/system.h:28: undefined reference to `__aarch64_ldclr1_acq_rel' - aarch64-linux-gnu-ld.bfd: drivers/xen/hypervisor.o: in function `synch_test_and_set_bit': - /home/leoy/Dev2/u-boot/./arch/arm/include/asm/xen/system.h:40: undefined reference to `__aarch64_ldset1_acq_rel' - aarch64-linux-gnu-ld.bfd: drivers/xen/hypervisor.o: in function `synch_test_and_clear_bit': - /home/leoy/Dev2/u-boot/./arch/arm/include/asm/xen/system.h:28: undefined reference to `__aarch64_ldclr1_acq_rel' - aarch64-linux-gnu-ld.bfd: drivers/xen/events.o: in function `synch_test_and_clear_bit': - /home/leoy/Dev2/u-boot/./arch/arm/include/asm/xen/system.h:28: undefined reference to `__aarch64_ldclr1_acq_rel' - aarch64-linux-gnu-ld.bfd: drivers/xen/events.o: in function `synch_test_and_set_bit': - /home/leoy/Dev2/u-boot/./arch/arm/include/asm/xen/system.h:40: undefined reference to `__aarch64_ldset1_acq_rel' - aarch64-linux-gnu-ld.bfd: drivers/xen/gnttab.o: in function `gnttab_end_access': - /home/leoy/Dev2/u-boot/drivers/xen/gnttab.c:109: undefined reference to `__aarch64_cas2_acq_rel' - Segmentation fault - -To fix the failure, we need to append option `-mno-outline-atomics` in Clang -command to not generate local calls to out-of-line atomic operations: - -.. code-block:: bash - - make HOSTCC=clang xenguest_arm64_defconfig - make HOSTCC=clang CROSS_COMPILE=aarch64-linux-gnu- \ - CC="clang -target aarch64-linux-gnueabi -mno-outline-atomics" -j8
Signature · 1 line
2.34.1
PATCH 2/2 doc: Rework the gcc section to reflect general build instructions
The first big issue is that the "gcc" file talked a lot about the general build requirements as well, but was titled in a gcc-centric manner. Solve this by renaming the file to compile.rst and more fully reflecting that it is general build instructions. Next, add a section about the prebuilt toolchains that are recommended (as they are the ones we use in CI), and update a few places to reference these vendor-neutral tools.
Next, we can include the reproducible builds section directly in the compile instructions rather than as a small standalone file.
Finally, we update the sandbox document to reflect both the name change as well as what is specifically required to build sandbox.
---
Cc: Heinrich Schuchardt <[email protected]>
---
doc/arch/sandbox/sandbox.rst | 5 ++-
doc/build/{gcc.rst => compile.rst} | 64 ++++++++++++++++++++++++++----
doc/build/index.rst | 3 +-
doc/build/reproducible.rst | 27 -------------
4 files changed, 61 insertions(+), 38 deletions(-)
rename doc/build/{gcc.rst => compile.rst} (73%)
delete mode 100644 doc/build/reproducible.rstdoc/arch/sandbox/sandbox.rst +3 -2
@@ -39,11 +39,12 @@ integers can only be built on 64-bit hosts. Note that standalone/API support is not available at present. - Prerequisites ------------- -Install the dependencies noted in :doc:`../../build/gcc`. +In addition to the normal dependencies shows in the :doc:`general build +instructions <../../build/compile>` to enable display support SDL2 libraries +need to be available. Basic Operation
doc/build/compile.rst renamed from doc/build/gcc.rst +57 -7
107 lines not on this page · raw message
doc/build/index.rst +1 -2
@@ -7,9 +7,8 @@ Build U-Boot :maxdepth: 2 source - gcc + compile clang - reproducible docker tools buildman
doc/build/reproducible.rst deleted +0 -27
@@ -1,27 +0,0 @@ -Reproducible builds -=================== - -In order to achieve reproducible builds, timestamps used in the U-Boot build -process have to be set to a fixed value. - -This is done using the SOURCE_DATE_EPOCH environment variable which specifies -the number of seconds since 1970-01-01T00:00:00Z. - -Example -------- - -To build the sandbox with 2023-01-01T00:00:00Z as timestamp we can use: - -.. code-block:: bash - - make sandbox_defconfig - SOURCE_DATE_EPOCH=1672531200 make - -This date is shown when we launch U-Boot: - -.. code-block:: console - - ./u-boot -T - U-Boot 2023.01 (Jan 01 2023 - 00:00:00 +0000) - -The same effect can be obtained with buildman using the `-r` flag.
Signature · 1 line
2.34.1
Re: [PATCH 2/2] doc: Rework the gcc section to reflect general build instructions
Am 15. Februar 2024 22:10:25 MEZ schrieb Tom Rini <[email protected]>:
Quoted 103 lines
The first big issue is that the "gcc" file talked a lot about the general build requirements as well, but was titled in a gcc-centric manner. Solve this by renaming the file to
compile.rstand more fully reflecting that it is general build instructions. Next, add a section about the prebuilt toolchains that are recommended (as they are the ones we use in CI), and update a few places to reference these vendor-neutral tools.Next, we can include the reproducible builds section directly in the compile instructions rather than as a small standalone file.
Finally, we update the sandbox document to reflect both the name change as well as what is specifically required to build sandbox.
Signed-off-by Tom Rini <[email protected]>---
Cc: Heinrich Schuchardt <[email protected]>
---doc/arch/sandbox/sandbox.rst | 5 ++- doc/build/{gcc.rst => compile.rst} | 64 ++++++++++++++++++++++++++---- doc/build/index.rst | 3 +- doc/build/reproducible.rst | 27 ------------- 4 files changed, 61 insertions(+), 38 deletions(-)rename
doc/build/{gcc.rst=>compile.rst} (73%)
delete mode 100644doc/build/reproducible.rstdoc/arch/sandbox/sandbox.rst +0
-0@@ -39,11 +39,12 @@ integers can only be built on 64-bit hosts.Note that standalone/API support is not available at present.
-
Prerequisites
-------------doc/arch/sandbox/sandbox.rst +3
-1-Install the dependencies noted in :doc:`../../build/gcc`. +In addition to the normal dependencies shows in the :doc:`general build +instructions <../../build/compile>` to enable display support SDL2 libraries +need to be available.Basic Operation
doc/build/compile.rst renamed from doc/build/gcc.rst +2
-2@@ -1,11 +1,19 @@ -Building with GCC -================= +Building U-Boot +===============Dependencies
------------doc/build/compile.rst renamed from doc/build/gcc.rst +10
-2-For building U-Boot you need a GCC compiler for your host platform. If you -are not building on the target platform you further need a GCC cross compiler. +For building U-Boot you need the general build tools such as `make` and a C +compiler for your host platform. Next, if you are not building on the same +architecture as the target platform you further need a C cross compiler. +Furthermore, some target platforms require additional host tools to be present +and their package names may vary slightly dependinng on the naming scheme used +by a particular host OS. + +In general, GCC should be used for both the host and target C compiler. Using +:doc:`clang <clang>` is supported but please see the documented issues for it as +well.Debian based
~~~~~~~~~~~~doc/build/compile.rst renamed from doc/build/gcc.rst +11
-0@@ -69,6 +77,17 @@ Depending on the build target further packages may be needed: * riscv64 S-mode targets: opensbi * some arm64 targets: arm-trusted-firmware +Prebuilt +~~~~~~~~ + +Another option, which the project uses for CI for example, is to use a prebuilt +toolchain. For the most part, we use the latest `kernel.org`_ prebuit binaries, +but there are a few architectures that require their own specific toolchains +still. + +In general, examples found within the documentation here refer to the tools +found here and exceptions will be noted where relevant. +Prerequisites
-------------doc/build/compile.rst renamed from doc/build/gcc.rst +1
-1@@ -112,11 +131,11 @@ command line or export it beforehand. CROSS_COMPILE=<compiler-prefix> make -Assuming cross compiling on Debian for ARMv8 this would be +Assuming cross compiling for ARMv8 this would be.. code-block:: bash
doc/build/compile.rst command line or export it beforehand. · line 138
Quoted 2 lines
doc/build/compile.rst renamed from doc/build/gcc.rst +1
-1- CROSS_COMPILE=aarch64-linux-gnu- make + CROSS_COMPILE=aarch64-linux- make
GCC uses triples to specify the architecture. With the suggested change building will fail on many distros, e.g. in our CI image.
doc/build/compile.rst You can speed up compilation by parallelization using the -j parameter, e.g. · line 153
Quoted 9 lines
Build parameters
~~~~~~~~~~~~~~~~doc/build/compile.rst renamed from doc/build/gcc.rst +0
-0@@ -131,13 +150,40 @@ You can speed up compilation by parallelization using the -j parameter, e.g... code-block:: bash
doc/build/compile.rst renamed from doc/build/gcc.rst +1
-1- CROSS_COMPILE=aarch64-linux-gnu- make -j$(nproc) + CROSS_COMPILE=aarch64-linux- make -j$(nproc)
ditto
Best regards
Heinrich
Quoted 99 lines
Further important build parameters are
* O=<dir> - generate all output files in directory <dir>, including .config
* V=1 - verbose builddoc/build/compile.rst renamed from doc/build/gcc.rst +27
-0+ +Reproducible builds +~~~~~~~~~~~~~~~~~~~ + +In order to achieve reproducible builds, timestamps used in the U-Boot build +process have to be set to a fixed value. + +This is done using the SOURCE_DATE_EPOCH environment variable which specifies +the number of seconds since 1970-01-01T00:00:00Z. + + +To build the sandbox with 2023-01-01T00:00:00Z as timestamp we can use: + +.. code-block:: bash + + make sandbox_defconfig + SOURCE_DATE_EPOCH=1672531200 make + +This date is shown when we launch U-Boot: + +.. code-block:: console + + ./u-boot -T + U-Boot 2023.01 (Jan 01 2023 - 00:00:00 +0000) + +The same effect can be obtained with buildman using the `-r` flag. +Devicetree compiler
~~~~~~~~~~~~~~~~~~~doc/build/compile.rst renamed from doc/build/gcc.rst +2
-0@@ -176,6 +222,8 @@ builds during development, you can disable it by setting `NO_LTO` to `1`. NO_LTO=1 make +Note that not all platforms which enable LTO support disabling it however. +Other build targets
~~~~~~~~~~~~~~~~~~~doc/build/compile.rst renamed from doc/build/gcc.rst +0
-0@@ -195,3 +243,5 @@ InstallationThe process for installing U-Boot on the target device is device specific. Please, refer to the board specific documentation :doc:
../board/index.doc/build/compile.rst renamed from doc/build/gcc.rst +2
-0+ +.. _`kernel.org`: https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/doc/build/index.rst +1
-2@@ -7,9 +7,8 @@ Build U-Boot :maxdepth: 2 source - gcc + compile clang - reproducible docker tools buildmandoc/build/reproducible.rst deleted +0
-27@@ -1,27 +0,0 @@ -Reproducible builds -=================== - -In order to achieve reproducible builds, timestamps used in the U-Boot build -process have to be set to a fixed value. - -This is done using the SOURCE_DATE_EPOCH environment variable which specifies -the number of seconds since 1970-01-01T00:00:00Z. - -Example -------- - -To build the sandbox with 2023-01-01T00:00:00Z as timestamp we can use: - -.. code-block:: bash - - make sandbox_defconfig - SOURCE_DATE_EPOCH=1672531200 make - -This date is shown when we launch U-Boot: - -.. code-block:: console - - ./u-boot -T - U-Boot 2023.01 (Jan 01 2023 - 00:00:00 +0000) - -The same effect can be obtained with buildman using the `-r` flag.
Re: [PATCH 2/2] doc: Rework the gcc section to reflect general build instructions
Quoted 104 lines · Heinrich Schuchardt
Am 15. Februar 2024 22:10:25 MEZ schrieb Tom Rini <[email protected]>:
Quoted 101 lines
The first big issue is that the "gcc" file talked a lot about the general build requirements as well, but was titled in a gcc-centric manner. Solve this by renaming the file to
compile.rstand more fully reflecting that it is general build instructions. Next, add a section about the prebuilt toolchains that are recommended (as they are the ones we use in CI), and update a few places to reference these vendor-neutral tools.Next, we can include the reproducible builds section directly in the compile instructions rather than as a small standalone file.
Finally, we update the sandbox document to reflect both the name change as well as what is specifically required to build sandbox.
Signed-off-by Tom Rini <[email protected]>---
Cc: Heinrich Schuchardt <[email protected]>
---doc/arch/sandbox/sandbox.rst | 5 ++- doc/build/{gcc.rst => compile.rst} | 64 ++++++++++++++++++++++++++---- doc/build/index.rst | 3 +- doc/build/reproducible.rst | 27 ------------- 4 files changed, 61 insertions(+), 38 deletions(-)rename
doc/build/{gcc.rst=>compile.rst} (73%)
delete mode 100644doc/build/reproducible.rstdoc/arch/sandbox/sandbox.rst +0
-0@@ -39,11 +39,12 @@ integers can only be built on 64-bit hosts.Note that standalone/API support is not available at present.
-
Prerequisites
-------------doc/arch/sandbox/sandbox.rst +3
-1-Install the dependencies noted in :doc:`../../build/gcc`. +In addition to the normal dependencies shows in the :doc:`general build +instructions <../../build/compile>` to enable display support SDL2 libraries +need to be available.Basic Operation
doc/build/compile.rst renamed from doc/build/gcc.rst +2
-2@@ -1,11 +1,19 @@ -Building with GCC -================= +Building U-Boot +===============Dependencies
------------doc/build/compile.rst renamed from doc/build/gcc.rst +10
-2-For building U-Boot you need a GCC compiler for your host platform. If you -are not building on the target platform you further need a GCC cross compiler. +For building U-Boot you need the general build tools such as `make` and a C +compiler for your host platform. Next, if you are not building on the same +architecture as the target platform you further need a C cross compiler. +Furthermore, some target platforms require additional host tools to be present +and their package names may vary slightly dependinng on the naming scheme used +by a particular host OS. + +In general, GCC should be used for both the host and target C compiler. Using +:doc:`clang <clang>` is supported but please see the documented issues for it as +well.Debian based
~~~~~~~~~~~~doc/build/compile.rst renamed from doc/build/gcc.rst +11
-0@@ -69,6 +77,17 @@ Depending on the build target further packages may be needed: * riscv64 S-mode targets: opensbi * some arm64 targets: arm-trusted-firmware +Prebuilt +~~~~~~~~ + +Another option, which the project uses for CI for example, is to use a prebuilt +toolchain. For the most part, we use the latest `kernel.org`_ prebuit binaries, +but there are a few architectures that require their own specific toolchains +still. + +In general, examples found within the documentation here refer to the tools +found here and exceptions will be noted where relevant. +Prerequisites
-------------doc/build/compile.rst renamed from doc/build/gcc.rst +1
-1@@ -112,11 +131,11 @@ command line or export it beforehand. CROSS_COMPILE=<compiler-prefix> make -Assuming cross compiling on Debian for ARMv8 this would be +Assuming cross compiling for ARMv8 this would be
Quoted 8 lines
doc/build/compile.rst command line or export it beforehand. · line 138
Quoted 4 lines
.. code-block:: bash
doc/build/compile.rst renamed from doc/build/gcc.rst +1
-1- CROSS_COMPILE=aarch64-linux-gnu- make + CROSS_COMPILE=aarch64-linux- makeGCC uses triples to specify the architecture. With the suggested change building will fail on many distros, e.g. in our CI image.
But this is what the kernel.org compiler is called, and for consistency we should reference the reference compiler in our docs. I'm wanting to follow up and change everyone to use consistent names.
Signature · 1 line
Tom
Re: [PATCH 2/2] doc: Rework the gcc section to reflect general build instructions
Am 15. Februar 2024 22:28:24 MEZ schrieb Tom Rini <[email protected]>:
Quoted 112 lines · Heinrich Schuchardt
Quoted 111 lines
Am 15. Februar 2024 22:10:25 MEZ schrieb Tom Rini <[email protected]>:
Quoted 103 lines
The first big issue is that the "gcc" file talked a lot about the general build requirements as well, but was titled in a gcc-centric manner. Solve this by renaming the file to
compile.rstand more fully reflecting that it is general build instructions. Next, add a section about the prebuilt toolchains that are recommended (as they are the ones we use in CI), and update a few places to reference these vendor-neutral tools.Next, we can include the reproducible builds section directly in the compile instructions rather than as a small standalone file.
Finally, we update the sandbox document to reflect both the name change as well as what is specifically required to build sandbox.
Signed-off-by Tom Rini <[email protected]>---
Cc: Heinrich Schuchardt <[email protected]>
---doc/arch/sandbox/sandbox.rst | 5 ++- doc/build/{gcc.rst => compile.rst} | 64 ++++++++++++++++++++++++++---- doc/build/index.rst | 3 +- doc/build/reproducible.rst | 27 ------------- 4 files changed, 61 insertions(+), 38 deletions(-)rename
doc/build/{gcc.rst=>compile.rst} (73%)
delete mode 100644doc/build/reproducible.rstdoc/arch/sandbox/sandbox.rst +0
-0@@ -39,11 +39,12 @@ integers can only be built on 64-bit hosts.Note that standalone/API support is not available at present.
-
Prerequisites
-------------doc/arch/sandbox/sandbox.rst +3
-1-Install the dependencies noted in :doc:`../../build/gcc`. +In addition to the normal dependencies shows in the :doc:`general build +instructions <../../build/compile>` to enable display support SDL2 libraries +need to be available.Basic Operation
doc/build/compile.rst renamed from doc/build/gcc.rst +2
-2@@ -1,11 +1,19 @@ -Building with GCC -================= +Building U-Boot +===============Dependencies
------------doc/build/compile.rst renamed from doc/build/gcc.rst +10
-2-For building U-Boot you need a GCC compiler for your host platform. If you -are not building on the target platform you further need a GCC cross compiler. +For building U-Boot you need the general build tools such as `make` and a C +compiler for your host platform. Next, if you are not building on the same +architecture as the target platform you further need a C cross compiler. +Furthermore, some target platforms require additional host tools to be present +and their package names may vary slightly dependinng on the naming scheme used +by a particular host OS. + +In general, GCC should be used for both the host and target C compiler. Using +:doc:`clang <clang>` is supported but please see the documented issues for it as +well.Debian based
~~~~~~~~~~~~doc/build/compile.rst renamed from doc/build/gcc.rst +11
-0@@ -69,6 +77,17 @@ Depending on the build target further packages may be needed: * riscv64 S-mode targets: opensbi * some arm64 targets: arm-trusted-firmware +Prebuilt +~~~~~~~~ + +Another option, which the project uses for CI for example, is to use a prebuilt +toolchain. For the most part, we use the latest `kernel.org`_ prebuit binaries, +but there are a few architectures that require their own specific toolchains +still. + +In general, examples found within the documentation here refer to the tools +found here and exceptions will be noted where relevant. +Prerequisites
-------------doc/build/compile.rst renamed from doc/build/gcc.rst +1
-1@@ -112,11 +131,11 @@ command line or export it beforehand. CROSS_COMPILE=<compiler-prefix> make -Assuming cross compiling on Debian for ARMv8 this would be +Assuming cross compiling for ARMv8 this would be.. code-block:: bash
doc/build/compile.rst command line or export it beforehand. · line 138
Quoted 2 lines
doc/build/compile.rst renamed from doc/build/gcc.rst +1
-1- CROSS_COMPILE=aarch64-linux-gnu- make + CROSS_COMPILE=aarch64-linux- makeGCC uses triples to specify the architecture. With the suggested change building will fail on many distros, e.g. in our CI image.
Quoted 6 lines
Quoted 1 line
But this is what the kernel.org compiler is called, and for consistency we should reference the reference compiler in our docs. I'm wanting to follow up and change everyone to use consistent names.
Please, do not asume that Linux distros will change.
Users will and should use the tools provided by their distros. Side loading foreign binaries is a secutity risc which should be avoided.
I cannot see what is inconsistent about sticking to triples.
Best regards
Heinrich
Re: [PATCH 2/2] doc: Rework the gcc section to reflect general build instructions
Quoted 122 lines · Heinrich Schuchardt
Am 15. Februar 2024 22:28:24 MEZ schrieb Tom Rini <[email protected]>:
Quoted 112 lines · Heinrich Schuchardt
Quoted 111 lines
Am 15. Februar 2024 22:10:25 MEZ schrieb Tom Rini <[email protected]>:
Quoted 103 lines
The first big issue is that the "gcc" file talked a lot about the general build requirements as well, but was titled in a gcc-centric manner. Solve this by renaming the file to
compile.rstand more fully reflecting that it is general build instructions. Next, add a section about the prebuilt toolchains that are recommended (as they are the ones we use in CI), and update a few places to reference these vendor-neutral tools.Next, we can include the reproducible builds section directly in the compile instructions rather than as a small standalone file.
Finally, we update the sandbox document to reflect both the name change as well as what is specifically required to build sandbox.
Signed-off-by Tom Rini <[email protected]>---
Cc: Heinrich Schuchardt <[email protected]>
---doc/arch/sandbox/sandbox.rst | 5 ++- doc/build/{gcc.rst => compile.rst} | 64 ++++++++++++++++++++++++++---- doc/build/index.rst | 3 +- doc/build/reproducible.rst | 27 ------------- 4 files changed, 61 insertions(+), 38 deletions(-)rename
doc/build/{gcc.rst=>compile.rst} (73%)
delete mode 100644doc/build/reproducible.rstdoc/arch/sandbox/sandbox.rst +0
-0@@ -39,11 +39,12 @@ integers can only be built on 64-bit hosts.Note that standalone/API support is not available at present.
-
Prerequisites
-------------doc/arch/sandbox/sandbox.rst +3
-1-Install the dependencies noted in :doc:`../../build/gcc`. +In addition to the normal dependencies shows in the :doc:`general build +instructions <../../build/compile>` to enable display support SDL2 libraries +need to be available.Basic Operation
doc/build/compile.rst renamed from doc/build/gcc.rst +2
-2@@ -1,11 +1,19 @@ -Building with GCC -================= +Building U-Boot +===============Dependencies
------------doc/build/compile.rst renamed from doc/build/gcc.rst +10
-2-For building U-Boot you need a GCC compiler for your host platform. If you -are not building on the target platform you further need a GCC cross compiler. +For building U-Boot you need the general build tools such as `make` and a C +compiler for your host platform. Next, if you are not building on the same +architecture as the target platform you further need a C cross compiler. +Furthermore, some target platforms require additional host tools to be present +and their package names may vary slightly dependinng on the naming scheme used +by a particular host OS. + +In general, GCC should be used for both the host and target C compiler. Using +:doc:`clang <clang>` is supported but please see the documented issues for it as +well.Debian based
~~~~~~~~~~~~doc/build/compile.rst renamed from doc/build/gcc.rst +11
-0@@ -69,6 +77,17 @@ Depending on the build target further packages may be needed: * riscv64 S-mode targets: opensbi * some arm64 targets: arm-trusted-firmware +Prebuilt +~~~~~~~~ + +Another option, which the project uses for CI for example, is to use a prebuilt +toolchain. For the most part, we use the latest `kernel.org`_ prebuit binaries, +but there are a few architectures that require their own specific toolchains +still. + +In general, examples found within the documentation here refer to the tools +found here and exceptions will be noted where relevant. +Prerequisites
-------------doc/build/compile.rst renamed from doc/build/gcc.rst +1
-1@@ -112,11 +131,11 @@ command line or export it beforehand. CROSS_COMPILE=<compiler-prefix> make -Assuming cross compiling on Debian for ARMv8 this would be +Assuming cross compiling for ARMv8 this would be.. code-block:: bash
doc/build/compile.rst command line or export it beforehand. · line 138
Quoted 2 lines
doc/build/compile.rst renamed from doc/build/gcc.rst +1
-1- CROSS_COMPILE=aarch64-linux-gnu- make + CROSS_COMPILE=aarch64-linux- makeGCC uses triples to specify the architecture. With the suggested change building will fail on many distros, e.g. in our CI image.
Quoted 6 lines
Quoted 1 line
But this is what the kernel.org compiler is called, and for consistency we should reference the reference compiler in our docs. I'm wanting to follow up and change everyone to use consistent names.
Quoted 5 lines
Please, do not asume that Linux distros will change.
Users will and should use the tools provided by their distros. Side loading foreign binaries is a secutity risc which should be avoided.
I cannot see what is inconsistent about sticking to triples.
We need to be consistent within our docs, and we aren't today. And "-gnu" isn't a required suffix for aarch64 linux toolchains as not all distributions do that. I'd be open to wording suggesting that users install tools recommended by their vendors, but that still won't give us consistent names due to "aarch64-poky-linux-" being what other vendor tools will be.
Signature · 1 line
Tom
Re: [PATCH 2/2] doc: Rework the gcc section to reflect general build instructions
Am 15. Februar 2024 23:00:32 MEZ schrieb Tom Rini <[email protected]>:
Quoted 127 lines · Heinrich Schuchardt
Quoted 126 lines
Am 15. Februar 2024 22:28:24 MEZ schrieb Tom Rini <[email protected]>:
Quoted 112 lines · Heinrich Schuchardt
Quoted 111 lines
Am 15. Februar 2024 22:10:25 MEZ schrieb Tom Rini <[email protected]>:
Quoted 103 lines
The first big issue is that the "gcc" file talked a lot about the general build requirements as well, but was titled in a gcc-centric manner. Solve this by renaming the file to
compile.rstand more fully reflecting that it is general build instructions. Next, add a section about the prebuilt toolchains that are recommended (as they are the ones we use in CI), and update a few places to reference these vendor-neutral tools.Next, we can include the reproducible builds section directly in the compile instructions rather than as a small standalone file.
Finally, we update the sandbox document to reflect both the name change as well as what is specifically required to build sandbox.
Signed-off-by Tom Rini <[email protected]>---
Cc: Heinrich Schuchardt <[email protected]>
---doc/arch/sandbox/sandbox.rst | 5 ++- doc/build/{gcc.rst => compile.rst} | 64 ++++++++++++++++++++++++++---- doc/build/index.rst | 3 +- doc/build/reproducible.rst | 27 ------------- 4 files changed, 61 insertions(+), 38 deletions(-)rename
doc/build/{gcc.rst=>compile.rst} (73%)
delete mode 100644doc/build/reproducible.rstdoc/arch/sandbox/sandbox.rst +0
-0@@ -39,11 +39,12 @@ integers can only be built on 64-bit hosts.Note that standalone/API support is not available at present.
-
Prerequisites
-------------doc/arch/sandbox/sandbox.rst +3
-1-Install the dependencies noted in :doc:`../../build/gcc`. +In addition to the normal dependencies shows in the :doc:`general build +instructions <../../build/compile>` to enable display support SDL2 libraries +need to be available.Basic Operation
doc/build/compile.rst renamed from doc/build/gcc.rst +2
-2@@ -1,11 +1,19 @@ -Building with GCC -================= +Building U-Boot +===============Dependencies
------------doc/build/compile.rst renamed from doc/build/gcc.rst +10
-2-For building U-Boot you need a GCC compiler for your host platform. If you -are not building on the target platform you further need a GCC cross compiler. +For building U-Boot you need the general build tools such as `make` and a C +compiler for your host platform. Next, if you are not building on the same +architecture as the target platform you further need a C cross compiler. +Furthermore, some target platforms require additional host tools to be present +and their package names may vary slightly dependinng on the naming scheme used +by a particular host OS. + +In general, GCC should be used for both the host and target C compiler. Using +:doc:`clang <clang>` is supported but please see the documented issues for it as +well.Debian based
~~~~~~~~~~~~doc/build/compile.rst renamed from doc/build/gcc.rst +11
-0@@ -69,6 +77,17 @@ Depending on the build target further packages may be needed: * riscv64 S-mode targets: opensbi * some arm64 targets: arm-trusted-firmware +Prebuilt +~~~~~~~~ + +Another option, which the project uses for CI for example, is to use a prebuilt +toolchain. For the most part, we use the latest `kernel.org`_ prebuit binaries, +but there are a few architectures that require their own specific toolchains +still. + +In general, examples found within the documentation here refer to the tools +found here and exceptions will be noted where relevant. +Prerequisites
-------------doc/build/compile.rst renamed from doc/build/gcc.rst +1
-1@@ -112,11 +131,11 @@ command line or export it beforehand. CROSS_COMPILE=<compiler-prefix> make -Assuming cross compiling on Debian for ARMv8 this would be +Assuming cross compiling for ARMv8 this would be.. code-block:: bash
doc/build/compile.rst command line or export it beforehand. · line 138
Quoted 2 lines
doc/build/compile.rst renamed from doc/build/gcc.rst +1
-1- CROSS_COMPILE=aarch64-linux-gnu- make + CROSS_COMPILE=aarch64-linux- makeGCC uses triples to specify the architecture. With the suggested change building will fail on many distros, e.g. in our CI image.
Quoted 6 lines
Quoted 1 line
But this is what the kernel.org compiler is called, and for consistency we should reference the reference compiler in our docs. I'm wanting to follow up and change everyone to use consistent names.
Please, do not asume that Linux distros will change.
Users will and should use the tools provided by their distros. Side loading foreign binaries is a secutity risc which should be avoided.
Quoted 9 lines
Quoted 1 line
I cannot see what is inconsistent about sticking to triples.
We need to be consistent within our docs, and we aren't today. And "-gnu" isn't a required suffix for aarch64 linux toolchains as not all distributions do that. I'd be open to wording suggesting that users install tools recommended by their vendors, but that still won't give us consistent names due to "aarch64-poky-linux-" being what other vendor tools will be.
On which operating systems will CROSS_COMPILE=aarch64-linux- work for the distro tools?
On which will CROSS_COMPILE=aarch64-linux-gnu- work?
Best regards
Heinrich
Re: [PATCH 2/2] doc: Rework the gcc section to reflect general build instructions
Quoted 140 lines · Heinrich Schuchardt
Am 15. Februar 2024 23:00:32 MEZ schrieb Tom Rini <[email protected]>:
Quoted 127 lines · Heinrich Schuchardt
Quoted 126 lines
Am 15. Februar 2024 22:28:24 MEZ schrieb Tom Rini <[email protected]>:
Quoted 112 lines · Heinrich Schuchardt
Quoted 111 lines
Am 15. Februar 2024 22:10:25 MEZ schrieb Tom Rini <[email protected]>:
Quoted 103 lines
The first big issue is that the "gcc" file talked a lot about the general build requirements as well, but was titled in a gcc-centric manner. Solve this by renaming the file to
compile.rstand more fully reflecting that it is general build instructions. Next, add a section about the prebuilt toolchains that are recommended (as they are the ones we use in CI), and update a few places to reference these vendor-neutral tools.Next, we can include the reproducible builds section directly in the compile instructions rather than as a small standalone file.
Finally, we update the sandbox document to reflect both the name change as well as what is specifically required to build sandbox.
Signed-off-by Tom Rini <[email protected]>---
Cc: Heinrich Schuchardt <[email protected]>
---doc/arch/sandbox/sandbox.rst | 5 ++- doc/build/{gcc.rst => compile.rst} | 64 ++++++++++++++++++++++++++---- doc/build/index.rst | 3 +- doc/build/reproducible.rst | 27 ------------- 4 files changed, 61 insertions(+), 38 deletions(-)rename
doc/build/{gcc.rst=>compile.rst} (73%)
delete mode 100644doc/build/reproducible.rstdoc/arch/sandbox/sandbox.rst +0
-0@@ -39,11 +39,12 @@ integers can only be built on 64-bit hosts.Note that standalone/API support is not available at present.
-
Prerequisites
-------------doc/arch/sandbox/sandbox.rst +3
-1-Install the dependencies noted in :doc:`../../build/gcc`. +In addition to the normal dependencies shows in the :doc:`general build +instructions <../../build/compile>` to enable display support SDL2 libraries +need to be available.Basic Operation
doc/build/compile.rst renamed from doc/build/gcc.rst +2
-2@@ -1,11 +1,19 @@ -Building with GCC -================= +Building U-Boot +===============Dependencies
------------doc/build/compile.rst renamed from doc/build/gcc.rst +10
-2-For building U-Boot you need a GCC compiler for your host platform. If you -are not building on the target platform you further need a GCC cross compiler. +For building U-Boot you need the general build tools such as `make` and a C +compiler for your host platform. Next, if you are not building on the same +architecture as the target platform you further need a C cross compiler. +Furthermore, some target platforms require additional host tools to be present +and their package names may vary slightly dependinng on the naming scheme used +by a particular host OS. + +In general, GCC should be used for both the host and target C compiler. Using +:doc:`clang <clang>` is supported but please see the documented issues for it as +well.Debian based
~~~~~~~~~~~~doc/build/compile.rst renamed from doc/build/gcc.rst +11
-0@@ -69,6 +77,17 @@ Depending on the build target further packages may be needed: * riscv64 S-mode targets: opensbi * some arm64 targets: arm-trusted-firmware +Prebuilt +~~~~~~~~ + +Another option, which the project uses for CI for example, is to use a prebuilt +toolchain. For the most part, we use the latest `kernel.org`_ prebuit binaries, +but there are a few architectures that require their own specific toolchains +still. + +In general, examples found within the documentation here refer to the tools +found here and exceptions will be noted where relevant. +Prerequisites
-------------doc/build/compile.rst renamed from doc/build/gcc.rst +1
-1@@ -112,11 +131,11 @@ command line or export it beforehand. CROSS_COMPILE=<compiler-prefix> make -Assuming cross compiling on Debian for ARMv8 this would be +Assuming cross compiling for ARMv8 this would be.. code-block:: bash
doc/build/compile.rst command line or export it beforehand. · line 138
Quoted 2 lines
doc/build/compile.rst renamed from doc/build/gcc.rst +1
-1- CROSS_COMPILE=aarch64-linux-gnu- make + CROSS_COMPILE=aarch64-linux- makeGCC uses triples to specify the architecture. With the suggested change building will fail on many distros, e.g. in our CI image.
Quoted 6 lines
Quoted 1 line
But this is what the kernel.org compiler is called, and for consistency we should reference the reference compiler in our docs. I'm wanting to follow up and change everyone to use consistent names.
Please, do not asume that Linux distros will change.
Users will and should use the tools provided by their distros. Side loading foreign binaries is a secutity risc which should be avoided.
Quoted 9 lines
Quoted 1 line
I cannot see what is inconsistent about sticking to triples.
We need to be consistent within our docs, and we aren't today. And "-gnu" isn't a required suffix for aarch64 linux toolchains as not all distributions do that. I'd be open to wording suggesting that users install tools recommended by their vendors, but that still won't give us consistent names due to "aarch64-poky-linux-" being what other vendor tools will be.
Quoted 3 lines
On which operating systems will CROSS_COMPILE=aarch64-linux- work for the distro tools?
On which will CROSS_COMPILE=aarch64-linux-gnu- work?
Should we document what we test? We don't test distribution tools because then we would have to test some number of distributions. And distro tools can be too old. I guess the biggest problem is that I see distro tools as a fall back option and you see kernel.org prebuilt toolchains as a fallback option.
Signature · 1 line
Tom
Re: [PATCH 2/2] doc: Rework the gcc section to reflect general build instructions
Quoted 106 lines · Tom Rini
Quoted 105 lines · Heinrich Schuchardt
Am 15. Februar 2024 23:00:32 MEZ schrieb Tom Rini <[email protected]>:
Quoted 102 lines · Heinrich Schuchardt
Quoted 101 lines
Am 15. Februar 2024 22:28:24 MEZ schrieb Tom Rini <[email protected]>:
Quoted 98 lines · Heinrich Schuchardt
Quoted 97 lines
Am 15. Februar 2024 22:10:25 MEZ schrieb Tom Rini <[email protected]>:
Quoted 94 lines
The first big issue is that the "gcc" file talked a lot about the general build requirements as well, but was titled in a gcc-centric manner. Solve this by renaming the file to
compile.rstand more fully reflecting that it is general build instructions. Next, add a section about the prebuilt toolchains that are recommended (as they are the ones we use in CI), and update a few places to reference these vendor-neutral tools.Next, we can include the reproducible builds section directly in the compile instructions rather than as a small standalone file.
Finally, we update the sandbox document to reflect both the name change as well as what is specifically required to build sandbox.
Signed-off-by Tom Rini <[email protected]>---
Cc: Heinrich Schuchardt <[email protected]>
---doc/arch/sandbox/sandbox.rst | 5 ++- doc/build/{gcc.rst => compile.rst} | 64 ++++++++++++++++++++++++++---- doc/build/index.rst | 3 +- doc/build/reproducible.rst | 27 ------------- 4 files changed, 61 insertions(+), 38 deletions(-)rename
doc/build/{gcc.rst=>compile.rst} (73%)
delete mode 100644doc/build/reproducible.rstdoc/arch/sandbox/sandbox.rst +0
-0@@ -39,11 +39,12 @@ integers can only be built on 64-bit hosts.Note that standalone/API support is not available at present.
-
Prerequisites
-------------doc/arch/sandbox/sandbox.rst +3
-1-Install the dependencies noted in :doc:`../../build/gcc`. +In addition to the normal dependencies shows in the :doc:`general build +instructions <../../build/compile>` to enable display support SDL2 libraries +need to be available.Basic Operation
doc/build/compile.rst renamed from doc/build/gcc.rst +2
-2@@ -1,11 +1,19 @@ -Building with GCC -================= +Building U-Boot +===============Dependencies
------------doc/build/compile.rst renamed from doc/build/gcc.rst +10
-2-For building U-Boot you need a GCC compiler for your host platform. If you -are not building on the target platform you further need a GCC cross compiler. +For building U-Boot you need the general build tools such as `make` and a C +compiler for your host platform. Next, if you are not building on the same +architecture as the target platform you further need a C cross compiler. +Furthermore, some target platforms require additional host tools to be present +and their package names may vary slightly dependinng on the naming scheme used +by a particular host OS. + +In general, GCC should be used for both the host and target C compiler. Using +:doc:`clang <clang>` is supported but please see the documented issues for it as +well.Debian based
~~~~~~~~~~~~doc/build/compile.rst renamed from doc/build/gcc.rst +11
-0@@ -69,6 +77,17 @@ Depending on the build target further packages may be needed: * riscv64 S-mode targets: opensbi * some arm64 targets: arm-trusted-firmware +Prebuilt +~~~~~~~~ + +Another option, which the project uses for CI for example, is to use a prebuilt +toolchain. For the most part, we use the latest `kernel.org`_ prebuit binaries, +but there are a few architectures that require their own specific toolchains +still. + +In general, examples found within the documentation here refer to the tools +found here and exceptions will be noted where relevant. +Prerequisites
-------------
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
doc/build/compile.rst command line or export it beforehand. · line 134
Quoted 6 lines
doc/build/compile.rst renamed from doc/build/gcc.rst +1
-1@@ -112,11 +131,11 @@ command line or export it beforehand. CROSS_COMPILE=<compiler-prefix> make -Assuming cross compiling on Debian for ARMv8 this would be +Assuming cross compiling for ARMv8 this would be
Referring to Debian the CROSS_COMPILE value was correct.
After the change we have some value that is wrong for many or even most distros.
Please, drop this change.
Best regards
Heinrich
Quoted 39 lines
Quoted 29 lines
Quoted 19 lines
Quoted 19 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
.. code-block:: bash
doc/build/compile.rst renamed from doc/build/gcc.rst +1
-1- CROSS_COMPILE=aarch64-linux-gnu- make + CROSS_COMPILE=aarch64-linux- makeQuoted 8 lines
Quoted 3 lines
GCC uses triples to specify the architecture. With the suggested change building will fail on many distros, e.g. in our CI image.
But this is what the kernel.org compiler is called, and for consistency we should reference the reference compiler in our docs. I'm wanting to follow up and change everyone to use consistent names.
Please, do not asume that Linux distros will change.
Users will and should use the tools provided by their distros. Side loading foreign binaries is a secutity risc which should be avoided.
Quoted 9 lines
Quoted 1 line
I cannot see what is inconsistent about sticking to triples.
We need to be consistent within our docs, and we aren't today. And "-gnu" isn't a required suffix for aarch64 linux toolchains as not all distributions do that. I'd be open to wording suggesting that users install tools recommended by their vendors, but that still won't give us consistent names due to "aarch64-poky-linux-" being what other vendor tools will be.
Quoted 3 lines
On which operating systems will CROSS_COMPILE=aarch64-linux- work for the distro tools?
On which will CROSS_COMPILE=aarch64-linux-gnu- work?
Should we document what we test? We don't test distribution tools because then we would have to test some number of distributions. And distro tools can be too old. I guess the biggest problem is that I see distro tools as a fall back option and you see kernel.org prebuilt toolchains as a fallback option.
Re: [PATCH 2/2] doc: Rework the gcc section to reflect general build instructions
Quoted 117 lines · Heinrich Schuchardt
Quoted 106 lines · Tom Rini
Quoted 105 lines · Heinrich Schuchardt
Am 15. Februar 2024 23:00:32 MEZ schrieb Tom Rini <[email protected]>:
Quoted 102 lines · Heinrich Schuchardt
Quoted 101 lines
Am 15. Februar 2024 22:28:24 MEZ schrieb Tom Rini <[email protected]>:
Quoted 98 lines · Heinrich Schuchardt
Quoted 97 lines
Am 15. Februar 2024 22:10:25 MEZ schrieb Tom Rini <[email protected]>:
Quoted 94 lines
The first big issue is that the "gcc" file talked a lot about the general build requirements as well, but was titled in a gcc-centric manner. Solve this by renaming the file to
compile.rstand more fully reflecting that it is general build instructions. Next, add a section about the prebuilt toolchains that are recommended (as they are the ones we use in CI), and update a few places to reference these vendor-neutral tools.Next, we can include the reproducible builds section directly in the compile instructions rather than as a small standalone file.
Finally, we update the sandbox document to reflect both the name change as well as what is specifically required to build sandbox.
Signed-off-by Tom Rini <[email protected]>---
Cc: Heinrich Schuchardt <[email protected]>
---doc/arch/sandbox/sandbox.rst | 5 ++- doc/build/{gcc.rst => compile.rst} | 64 ++++++++++++++++++++++++++---- doc/build/index.rst | 3 +- doc/build/reproducible.rst | 27 ------------- 4 files changed, 61 insertions(+), 38 deletions(-)rename
doc/build/{gcc.rst=>compile.rst} (73%)
delete mode 100644doc/build/reproducible.rstdoc/arch/sandbox/sandbox.rst +0
-0@@ -39,11 +39,12 @@ integers can only be built on 64-bit hosts.Note that standalone/API support is not available at present.
-
Prerequisites
-------------doc/arch/sandbox/sandbox.rst +3
-1-Install the dependencies noted in :doc:`../../build/gcc`. +In addition to the normal dependencies shows in the :doc:`general build +instructions <../../build/compile>` to enable display support SDL2 libraries +need to be available.Basic Operation
doc/build/compile.rst renamed from doc/build/gcc.rst +2
-2@@ -1,11 +1,19 @@ -Building with GCC -================= +Building U-Boot +===============Dependencies
------------doc/build/compile.rst renamed from doc/build/gcc.rst +10
-2-For building U-Boot you need a GCC compiler for your host platform. If you -are not building on the target platform you further need a GCC cross compiler. +For building U-Boot you need the general build tools such as `make` and a C +compiler for your host platform. Next, if you are not building on the same +architecture as the target platform you further need a C cross compiler. +Furthermore, some target platforms require additional host tools to be present +and their package names may vary slightly dependinng on the naming scheme used +by a particular host OS. + +In general, GCC should be used for both the host and target C compiler. Using +:doc:`clang <clang>` is supported but please see the documented issues for it as +well.Debian based
~~~~~~~~~~~~doc/build/compile.rst renamed from doc/build/gcc.rst +11
-0@@ -69,6 +77,17 @@ Depending on the build target further packages may be needed: * riscv64 S-mode targets: opensbi * some arm64 targets: arm-trusted-firmware +Prebuilt +~~~~~~~~ + +Another option, which the project uses for CI for example, is to use a prebuilt +toolchain. For the most part, we use the latest `kernel.org`_ prebuit binaries, +but there are a few architectures that require their own specific toolchains +still. + +In general, examples found within the documentation here refer to the tools +found here and exceptions will be noted where relevant. +Prerequisites
-------------Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
doc/build/compile.rst command line or export it beforehand. · line 134
Quoted 6 lines
doc/build/compile.rst renamed from doc/build/gcc.rst +1
-1@@ -112,11 +131,11 @@ command line or export it beforehand. CROSS_COMPILE=<compiler-prefix> make -Assuming cross compiling on Debian for ARMv8 this would be +Assuming cross compiling for ARMv8 this would beReferring to Debian the
CROSS_COMPILEvalue was correct.
Quoted 4 lines
After the change we have some value that is wrong for many or even most distros.
Please, drop this change.
One of the reasons for this series is to lay the groundwork to make everything consistent, which we are not today:
$ git grep -l CROSS_COMPILE=aarch64-poky-linux- doc/ | wc -l 7 $ git grep -l CROSS_COMPILE=aarch64-linux-gnu doc/ | wc -l 34 $ git grep -l CROSS_COMPILE=aarch64-none-elf doc/ | wc -l 39
So yes, I dropped "Debian" from the text in order to be distribution-agnostic and then changed to the prefix used by the toolchain we test, which very annoyingly, is the one that doesn't put "gnu" in the suffix as it's not required (if it was OpenEmbedded wouldn't be ignoring it).
Since I'm not sure we even can build the world on a distribution toolchain due to age of the toolchain (for the cases where there is a toolchain, but that is the most common case at least), I don't want to encourage that as the first choice.
Signature · 1 line
Tom
Re: [PATCH 2/2] doc: Rework the gcc section to reflect general build instructions
In reply to Tom RiniQuoted 32 lines · Tom Rini
The first big issue is that the "gcc" file talked a lot about the general build requirements as well, but was titled in a gcc-centric manner. Solve this by renaming the file to
compile.rstand more fully reflecting that it is general build instructions. Next, add a section about the prebuilt toolchains that are recommended (as they are the ones we use in CI), and update a few places to reference these vendor-neutral tools.Next, we can include the reproducible builds section directly in the compile instructions rather than as a small standalone file.
Finally, we update the sandbox document to reflect both the name change as well as what is specifically required to build sandbox.
Signed-off-by Tom Rini <[email protected]>---
Cc: Heinrich Schuchardt <[email protected]>--- doc/arch/sandbox/sandbox.rst | 5 ++- doc/build/{gcc.rst => compile.rst} | 64 ++++++++++++++++++++++++++---- doc/build/index.rst | 3 +- doc/build/reproducible.rst | 27 ------------- 4 files changed, 61 insertions(+), 38 deletions(-) rename doc/build/{gcc.rst => compile.rst} (73%) delete mode 100644 doc/build/reproducible.rstdoc/arch/sandbox/sandbox.rst +0
-0@@ -39,11 +39,12 @@ integers can only be built on 64-bit hosts.
doc/arch/sandbox/sandbox.rst integers can only be built on 64-bit hosts. · line 47
Quoted 10 lines
doc/arch/sandbox/sandbox.rst +3
-2Note that standalone/API support is not available at present. - Prerequisites ------------- -Install the dependencies noted in :doc:`../../build/gcc`. +In addition to the normal dependencies shows in the :doc:`general build +instructions <../../build/compile>` to enable display support SDL2 libraries +need to be available.
I find this a little unclear. Perhaps:
To enable display support, SDL2 libraries need to be available in addition to the normal dependencies shown in the :doc:general build instructions <../../build/compile>.
Quoted 16 lines
doc/arch/sandbox/sandbox.rst +0
-0Basic Operationdoc/build/compile.rst renamed from doc/build/gcc.rst +2
-2@@ -1,11 +1,19 @@ -Building with GCC -================= +Building U-Boot +===============
doc/build/compile.rst line 11
Quoted 10 lines
doc/build/compile.rst renamed from doc/build/gcc.rst +5
-2Dependencies ------------ -For building U-Boot you need a GCC compiler for your host platform. If you -are not building on the target platform you further need a GCC cross compiler. +For building U-Boot you need the general build tools such as `make` and a C +compiler for your host platform. Next, if you are not building on the same +architecture as the target platform you further need a C cross compiler. +Furthermore, some target platforms require additional host tools to be present +and their package names may vary slightly dependinng on the naming scheme used
s/dependinng/depending/
Thanks,
Signature · 1 line
Paul Barker
Re: [PATCH 2/2] doc: Rework the gcc section to reflect general build instructions
Quoted 46 lines · Paul Barker
Quoted 32 lines · Tom Rini
The first big issue is that the "gcc" file talked a lot about the general build requirements as well, but was titled in a gcc-centric manner. Solve this by renaming the file to
compile.rstand more fully reflecting that it is general build instructions. Next, add a section about the prebuilt toolchains that are recommended (as they are the ones we use in CI), and update a few places to reference these vendor-neutral tools.Next, we can include the reproducible builds section directly in the compile instructions rather than as a small standalone file.
Finally, we update the sandbox document to reflect both the name change as well as what is specifically required to build sandbox.
Signed-off-by Tom Rini <[email protected]>---
Cc: Heinrich Schuchardt <[email protected]>--- doc/arch/sandbox/sandbox.rst | 5 ++- doc/build/{gcc.rst => compile.rst} | 64 ++++++++++++++++++++++++++---- doc/build/index.rst | 3 +- doc/build/reproducible.rst | 27 ------------- 4 files changed, 61 insertions(+), 38 deletions(-) rename doc/build/{gcc.rst => compile.rst} (73%) delete mode 100644 doc/build/reproducible.rstdoc/arch/sandbox/sandbox.rst +0
-0@@ -39,11 +39,12 @@ integers can only be built on 64-bit hosts.doc/arch/sandbox/sandbox.rst integers can only be built on 64-bit hosts. · line 47
Quoted 10 lines
doc/arch/sandbox/sandbox.rst +3
-2Note that standalone/API support is not available at present. - Prerequisites ------------- -Install the dependencies noted in :doc:`../../build/gcc`. +In addition to the normal dependencies shows in the :doc:`general build +instructions <../../build/compile>` to enable display support SDL2 libraries +need to be available.I find this a little unclear. Perhaps:
Quoted 3 lines
To enable display support, SDL2 libraries need to be available in addition to the normal dependencies shown in the :doc:
general build instructions <../../build/compile>.
The issue is that SDL2 is required by default, so I'll try and reword this a bit more still, thanks.
Signature · 1 line
Tom
Quoted 43 lines · Tom Rini
First, since this document was written the biggest challenges at the time are simply not applicable anymore. Second, we need to list the challenges which are preventing more platforms from being able to be built with Clang today. Next, we update the general wording to be host distribution agnostic. Finally, the section about
xenguest_arm64issues is not present anymore.Signed-off-by Tom Rini <[email protected]>---
Cc: Mark Kettenis <[email protected]>
This does leave the FreeBSD section unchanged and should likely be looked at again by someone with a BSD build machine available.--- doc/build/clang.rst | 85 +++++++++++---------------------------------- 1 file changed, 21 insertions(+), 64 deletions(-)doc/build/clang.rst +0
-19@@ -1,34 +1,27 @@ Building with Clang =================== -The biggest problem when trying to compile U-Boot with Clang is that almost all -archs rely on storing gd in a global register and the Clang 3.5 user manual -states: "Clang does not support global register variables; this is unlikely to -be implemented soon because it requires additional LLVM backend support." - -The ARM backend can be instructed not to use the r9 and x18 registers using --ffixed-r9 or -ffixed-x18 respectively. As global registers themselves are not -supported inline assembly is needed to get and set the r9 or x18 value. This -leads to larger code then strictly necessary, but at least works. - -Debian based ------------- - -Required packages can be installed via apt, e.g. - -.. code-block:: bash - - sudo apt-get install clang -
doc/build/clang.rst line 4
Quoted 10 lines
doc/build/clang.rst +1
-9-We make use of the CROSS_COMPILE variable to derive the build target which is -passed as the --target parameter to clang. - -The CROSS_COMPILE variable further determines the paths to other build -tools. As assembler we use the binary pointed to by '$(CROSS_COMPILE)as' -instead of the LLVM integrated assembler (IAS). - -Here is an example demonstrating building U-Boot for the Raspberry Pi 2 -using clang: +In general terms, U-Boot support building with Clang as the C compiler and
s/support/supports/
doc/build/clang.rst line 5
Quoted 1 line
doc/build/clang.rst +1
-0+building and booting our "sandbox" target is part of CI.
Are you saying that building the sandbox target with Clang then booting it is part of CI? I think this sentence needs re-wording to make it a little clearer.
Thanks,
Signature · 1 line
Paul Barker
Quoted 57 lines · Paul Barker
Quoted 43 lines · Tom Rini
First, since this document was written the biggest challenges at the time are simply not applicable anymore. Second, we need to list the challenges which are preventing more platforms from being able to be built with Clang today. Next, we update the general wording to be host distribution agnostic. Finally, the section about
xenguest_arm64issues is not present anymore.Signed-off-by Tom Rini <[email protected]>---
Cc: Mark Kettenis <[email protected]>
This does leave the FreeBSD section unchanged and should likely be looked at again by someone with a BSD build machine available.--- doc/build/clang.rst | 85 +++++++++++---------------------------------- 1 file changed, 21 insertions(+), 64 deletions(-)doc/build/clang.rst +0
-19@@ -1,34 +1,27 @@ Building with Clang =================== -The biggest problem when trying to compile U-Boot with Clang is that almost all -archs rely on storing gd in a global register and the Clang 3.5 user manual -states: "Clang does not support global register variables; this is unlikely to -be implemented soon because it requires additional LLVM backend support." - -The ARM backend can be instructed not to use the r9 and x18 registers using --ffixed-r9 or -ffixed-x18 respectively. As global registers themselves are not -supported inline assembly is needed to get and set the r9 or x18 value. This -leads to larger code then strictly necessary, but at least works. - -Debian based ------------- - -Required packages can be installed via apt, e.g. - -.. code-block:: bash - - sudo apt-get install clang -doc/build/clang.rst line 4
Quoted 10 lines
doc/build/clang.rst +1
-9-We make use of the CROSS_COMPILE variable to derive the build target which is -passed as the --target parameter to clang. - -The CROSS_COMPILE variable further determines the paths to other build -tools. As assembler we use the binary pointed to by '$(CROSS_COMPILE)as' -instead of the LLVM integrated assembler (IAS). - -Here is an example demonstrating building U-Boot for the Raspberry Pi 2 -using clang: +In general terms, U-Boot support building with Clang as the C compiler ands/support/supports/
Quoted 5 lines
doc/build/clang.rst line 5
Quoted 1 line
doc/build/clang.rst +1
-0+building and booting our "sandbox" target is part of CI.Are you saying that building the sandbox target with Clang then booting it is part of CI? I think this sentence needs re-wording to make it a little clearer.
It is so I'll reword this a bit more then, thanks.
Signature · 1 line
Tom