systemd does not build with -Ofast (at least with gcc-12), leading to build errors like: ../src/shared/condition.c: In function ‘condition_dump_list’: ../src/shared/condition.c:1227:33: error: ‘%s’ directive argument is null [-Werror=format-overflow=] 1227 | "%s\t%s: %s%s%s %s\n", | ^~ cc1: some warnings being treated as errors It is not really clear what the reason is, but it smells like a compiler error. Indeed, the failing format is passed to an fprintf, and the parameter corresponding to the failing %s directive is a call to a function which prototype is defined but the implementation only comes later in the same compilation unit, but is the result of macro expansion, which yields a function definition like: const char foo_to_string(foo_type i) { if (i < 0 || i >= (foo_type) ELEMENTSOF(foo_table)) return NULL; return foo_table[i] } (where ELEMENTSOF(x) is a macros arounf sizeof(x) to determine the number of elements in the array foo_table). However, in the failing case, foo_table is a static const array indexed with constants from an enum, and foo_to_string() is only ever called with variables that are only ever set to one of those enum values. Since -Ofast is also explicitly documented as breaking otehrwise conformant programs, we're not going to debug further the reason for the build failure. Instead, just revert to the best alternate optimisation level. We chose -O3, as -Ofast is based on -O3 with breaking optimisation flags. With -O3, the build succeeds. Fixes: http://autobuild.buildroot.org/results/3ffaa9b3ecacc6ac326be78196af1ad613f195ed/ (sparc64) http://autobuild.buildroot.org/results/3f6ae2e503dd1539e4240f344865da4881879204/ (arm) http://autobuild.buildroot.org/results/68c17056490d441c7f862349e9c7e471b4570162/ (ppc64) ... Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Norbert Lange <nolange79@gmail.com> Cc: Sen Hastings <sen@phobosdpl.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> |
||
---|---|---|
arch | ||
board | ||
boot | ||
configs | ||
docs | ||
fs | ||
linux | ||
package | ||
support | ||
system | ||
toolchain | ||
utils | ||
.clang-format | ||
.defconfig | ||
.flake8 | ||
.gitignore | ||
.gitlab-ci.yml | ||
.shellcheckrc | ||
CHANGES | ||
Config.in | ||
Config.in.legacy | ||
COPYING | ||
DEVELOPERS | ||
Makefile | ||
Makefile.legacy | ||
README |
Buildroot is a simple, efficient and easy-to-use tool to generate embedded Linux systems through cross-compilation. The documentation can be found in docs/manual. You can generate a text document with 'make manual-text' and read output/docs/manual/manual.text. Online documentation can be found at http://buildroot.org/docs.html To build and use the buildroot stuff, do the following: 1) run 'make menuconfig' 2) select the target architecture and the packages you wish to compile 3) run 'make' 4) wait while it compiles 5) find the kernel, bootloader, root filesystem, etc. in output/images You do not need to be root to build or run buildroot. Have fun! Buildroot comes with a basic configuration for a number of boards. Run 'make list-defconfigs' to view the list of provided configurations. Please feed suggestions, bug reports, insults, and bribes back to the buildroot mailing list: buildroot@buildroot.org You can also find us on #buildroot on OFTC IRC. If you would like to contribute patches, please read https://buildroot.org/manual.html#submitting-patches