]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: Undefine FORTIFY_SOURCE before setting it again
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 18 Apr 2024 12:00:30 +0000 (14:00 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 18 Apr 2024 12:01:06 +0000 (14:01 +0200)
Otherwise we get warnings from gcc.

mkosi.images/system/mkosi.conf.d/10-arch/mkosi.build.chroot
mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot

index 8eebd62b047badf0887d99aed42217ef8287aaa3..13d4ebeb1889b873cb18b02e2e40319c849db9a3 100755 (executable)
@@ -25,7 +25,7 @@ mount --mkdir --rbind "$PWD/pkg/$ID" "pkg/$ID/src/"
 # 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
-CFLAGS="$CFLAGS -O0 -Wp,-D_FORTIFY_SOURCE=0"
+CFLAGS="$CFLAGS -O0 -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=0"
 OPTIONS=(
     docs
     !libtool
index 0cba71bf7a7231ac60c5f6b654a8015f7825385e..46a509b33021565733a7c1b74bcaa8fe0ece228d 100755 (executable)
@@ -32,7 +32,7 @@ ARCH="$(rpm --eval %_arch)"
 SRCDEST="/usr/src/debug/systemd-$VERSION-${RELEASE}${DIST}.$ARCH"
 
 # TODO: Drop -D_FORTIFY_SOURCE when we switch to CentOS Stream 10.
-EXTRA_CFLAGS="-O0 -Wp,-D_FORTIFY_SOURCE=0"
+EXTRA_CFLAGS="-O0 -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=0"
 if ((WITH_DEBUG)); then
     EXTRA_CFLAGS="$EXTRA_CFLAGS -ffile-prefix-map=../src=$SRCDEST"
 fi