[Buildroot] [PATCH 1/1] package/systemd: disable with -Ofast

Thomas Petazzoni thomas.petazzoni at bootlin.com
Tue Feb 21 14:48:27 UTC 2023


Hello Fabrice,

On Tue, 21 Feb 2023 15:21:44 +0100
Fabrice Fontaine <fontaine.fabrice at gmail.com> wrote:

> systemd can't be built with -Ofast since version 252 and
> https://github.com/systemd/systemd/commit/60f97fee2d2f948c8e8963ea8ff767008cb93cae
> resulting in the following build failure since bump to version 252.4 in
> commit a2c823d1f548d5a0120d27d6c000603192360f7b:
> 
> ../output-1/build/systemd-252.4/meson.build:397:8: ERROR: Problem encountered: -Ofast, -ffast-math, or -ffinite-math-only is specified in c_args.
> 
> While at it, revert changes made by commit 9cd084b54e2223e49c37962b0cbefae7bea26ef5
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/8f41c4984b645851724e554c3162b83bc312bee7
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> ---
>  package/systemd/Config.in  | 1 +
>  package/systemd/systemd.mk | 5 -----
>  system/Config.in           | 4 ++++
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/package/systemd/Config.in b/package/systemd/Config.in
> index 9f4d933779..5bbdbb405f 100644
> --- a/package/systemd/Config.in
> +++ b/package/systemd/Config.in
> @@ -25,6 +25,7 @@ menuconfig BR2_PACKAGE_SYSTEMD
>  	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15
>  	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5
>  	depends on BR2_HOST_GCC_AT_LEAST_5 # host-systemd
> +	depends on !BR2_OPTIMIZE_FAST

I really dislike this.

> -SYSTEMD_CFLAGS = $(TARGET_CFLAGS)
> -ifeq ($(BR2_OPTIMIZE_FAST),y)
> -SYSTEMD_CFLAGS += -O3
> -endif

And this should work. It's really systemd that is stupid to look for
-Ofast in c_flags without seeing that -O3 later overrides it.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com



More information about the buildroot mailing list