]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: Build with -flto=auto if available
authorJan Janssen <medhefgo@web.de>
Fri, 13 May 2022 12:25:32 +0000 (14:25 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sat, 21 May 2022 14:07:47 +0000 (15:07 +0100)
Without this, we may get the following warning with gcc-12:
    lto-wrapper: warning: using serial compilation of 2 LTRANS jobs

src/boot/efi/meson.build

index 299a01b9be7eac4e69d39c10e5d0c857c02a462e..e17669478f70abd24d9f2cb6d1dc5f5580f482bf 100644 (file)
@@ -223,7 +223,7 @@ if get_option('b_ndebug') == 'true' or (
         efi_cflags += ['-DNDEBUG']
 endif
 if get_option('b_lto')
-        efi_cflags += ['-flto']
+        efi_cflags += cc.has_argument('-flto=auto') ? ['-flto=auto'] : ['-flto']
 endif
 
 foreach arg : get_option('c_args')