Go to file
Yann E. MORIN 9cd084b54e package/systemd: fix build with -Ofast
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>
2022-11-13 22:00:52 +01:00
arch arch/Config.in.arm: drop support for iwmmxt architecture variant 2022-09-25 14:06:08 +02:00
board board/zynqmp/kria/kv260/uboot.fragment: remove unnecessary CONFIG_MULTI_DTB_FIT option 2022-11-13 21:57:21 +01:00
boot boot/arm-trusted-firmware: fix SSP disable in v2.2 2022-11-13 21:54:57 +01:00
configs configs/kontron_bl_imx8mm_defconfig: bump U-boot to 2022.10 2022-11-13 14:31:20 +01:00
docs Update for 2022.11-rc1 2022-11-03 16:50:49 +01:00
fs fs/cpio: don't fail systems without /dev/null 2022-11-01 21:44:49 +01:00
linux package/linux: don't leak host timezone into linux version string 2022-11-05 15:09:33 +01:00
package package/systemd: fix build with -Ofast 2022-11-13 22:00:52 +01:00
support support/testing/tests/package/test_gdb.py: drop version-specific tests 2022-11-03 23:08:10 +01:00
system package/systemd: add setting for systemd default.target 2022-05-02 22:58:44 +02:00
toolchain package/glibc: headers >= 5.4 needed on RISC-V 32-bit 2022-10-30 12:44:15 +01:00
utils utils/genrandconfig: handle a10disp 2022-10-31 13:20:03 +01:00
.clang-format
.defconfig
.flake8
.gitignore
.gitlab-ci.yml
.shellcheckrc utils/check-package: improve shellcheck reproducibility 2022-07-25 23:52:47 +02:00
CHANGES Update for 2022.11-rc1 2022-11-03 16:50:49 +01:00
Config.in Config.in: move toolchain menu before build options 2022-07-27 11:11:19 +02:00
Config.in.legacy package/libdcadec: remove package 2022-11-05 19:09:54 +01:00
COPYING
DEVELOPERS DEVELOPERS: drop entry related to inexisting directory 2022-11-11 22:58:42 +01:00
Makefile Update for 2022.11-rc1 2022-11-03 16:50:49 +01:00
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