]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: Drop $OPTIMIZATION variable
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 1 Jun 2024 10:54:49 +0000 (12:54 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 4 Jun 2024 10:20:19 +0000 (12:20 +0200)
Let's instead just use $CFLAGS to override the optimization level.

.github/workflows/mkosi.yml
mkosi.images/system/mkosi.conf.d/10-arch/mkosi.build.chroot
mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot
mkosi.images/system/mkosi.conf.d/10-debian-ubuntu/mkosi.build.chroot
mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot

index 5cf9a0d7538ed010627342fe36fef8e99d3de5b9..a50798b2f146418a2cbe9fe3cbdf906ae0ebc09a 100644 (file)
@@ -128,7 +128,7 @@ jobs:
                 # Build debuginfo packages since we'll be publishing the packages as artifacts.
                 WITH_DEBUG=1
                 # Enabling optimizations significantly speeds up integration tests.
-                OPTIMIZATION=g
+                CFLAGS=-Og
                 SANITIZERS=${{ matrix.sanitizers }}
                 MESON_OPTIONS=--werror
                 LLVM=${{ matrix.llvm }}
index 9407c1e053d339a8f2957dcb9faaea4defbfbc4a..60b6444bfc16ec26900219ebe04712e56baa2927 100755 (executable)
@@ -24,7 +24,7 @@ ln --symbolic . "pkg/$ID/src"
 # shellcheck source=/dev/null
 . /etc/makepkg.conf
 
-MKOSI_CFLAGS="-O${OPTIMIZATION:-0} -Wp,-U_FORTIFY_SOURCE"
+MKOSI_CFLAGS="-Wp,-U_FORTIFY_SOURCE"
 if ((LLVM)); then
     # TODO: Remove -fno-sanitize-function when https://github.com/systemd/systemd/issues/29972 is fixed.
     MKOSI_CFLAGS="$MKOSI_CFLAGS -shared-libasan -fno-sanitize=function"
@@ -40,10 +40,10 @@ if ((WIPE)); then
     MKOSI_MESON_OPTIONS="$MKOSI_MESON_OPTIONS --wipe"
 fi
 
-# Override the default options. Disable FORTIFY_SOURCE because it doesn't work with O0. We specifically
-# disable "strip", "zipman" and "lto" as they slow down builds significantly. OPTIONS= cannot be overridden
-# on the makepkg command line so we append to /etc/makepkg.conf instead. The rootfs is overlaid with a
-# writable tmpfs during the build script so these changes don't end up in the image itself.
+# Override the default options. We specifically disable "strip", "zipman" and "lto" as they slow down builds
+# significantly. OPTIONS= cannot be overridden on the makepkg command line so we append to /etc/makepkg.conf
+# instead. The rootfs is overlaid with a writable tmpfs during the build script so these changes don't end up
+# in the image itself.
 tee --append /etc/makepkg.conf >/dev/null <<EOF
 export CC="$( ((LLVM)) && echo clang || echo gcc)"
 export CXX="$( ((LLVM)) && echo clang++ || echo g++)"
index d2ba46bb562ee75071acf7ba0aa88bb375dc5ffa..31069aa8b3d5402ee7149d899033015fec5a63bb 100755 (executable)
@@ -47,7 +47,7 @@ COMMON_MACRO_OVERRIDES=(
 )
 
 # TODO: Drop -U_FORTIFY_SOURCE when we switch to CentOS Stream 10.
-MKOSI_CFLAGS="-O${OPTIMIZATION:-0} -Wp,-U_FORTIFY_SOURCE"
+MKOSI_CFLAGS="-Wp,-U_FORTIFY_SOURCE"
 if ((WITH_DEBUG)); then
     MKOSI_CFLAGS="$MKOSI_CFLAGS -fdebug-prefix-map=../src=$SRCDEST"
 fi
index e36fb4887ceeb547a9dc019073806a7cb6303185..1b8fe586ca2009b7e71e1eec2f19c71a94de90fd 100755 (executable)
@@ -44,7 +44,7 @@ EOF
 cat debian/changelog >>debian/changelog.new
 mv debian/changelog.new debian/changelog
 
-MKOSI_CFLAGS="-O${OPTIMIZATION:-0}"
+MKOSI_CFLAGS=""
 if ((LLVM)); then
     # TODO: Remove -fno-sanitize-function when https://github.com/systemd/systemd/issues/29972 is fixed.
     MKOSI_CFLAGS="$MKOSI_CFLAGS -shared-libasan -fno-sanitize=function"
index 03bef7540085ee6ef35249f616ee81a968d68ddf..2af279d0572786155a195bbf925830c48a1503d8 100755 (executable)
@@ -42,7 +42,7 @@ DIST="$(rpm --eval %dist)"
 ARCH="$(rpm --eval %_arch)"
 SRCDEST="/usr/src/debug/systemd-$VERSION-${RELEASE}${DIST}.$ARCH"
 
-MKOSI_CFLAGS="-O${OPTIMIZATION:-0} -Wp,-U_FORTIFY_SOURCE"
+MKOSI_CFLAGS="-Wp,-U_FORTIFY_SOURCE"
 if ((WITH_DEBUG)); then
     MKOSI_CFLAGS="$MKOSI_CFLAGS -fdebug-prefix-map=../src=$SRCDEST"
 fi