Merge pull request #32335 from DaanDeMeyer/fix

mkosi: undefine FORTIFY_SOURCE instead of setting it zero
This commit is contained in:
Daan De Meyer
2024-04-18 15:02:51 +02:00
committed by GitHub
3 changed files with 5 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -ex
set -e
# shellcheck source=/dev/null
. /usr/lib/os-release
@@ -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,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=0"
CFLAGS="$CFLAGS -O0 -Wp,-U_FORTIFY_SOURCE"
OPTIONS=(
docs
!libtool

View File

@@ -31,8 +31,8 @@ DIST="$(rpm --eval %dist)"
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,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=0"
# TODO: Drop -U_FORTIFY_SOURCE when we switch to CentOS Stream 10.
EXTRA_CFLAGS="-O0 -Wp,-U_FORTIFY_SOURCE"
if ((WITH_DEBUG)); then
EXTRA_CFLAGS="$EXTRA_CFLAGS -ffile-prefix-map=../src=$SRCDEST"
fi

View File

@@ -37,7 +37,7 @@ ARCH="$(rpm --eval %_arch)"
SRCDEST="/usr/src/debug/systemd-$VERSION-${RELEASE}${DIST}.$ARCH"
# TODO: Enable this when the opensuse spec stops unconditionally setting FORTIFY_SOURCE=2.
# EXTRA_CFLAGS="-O0 -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=0"
# EXTRA_CFLAGS="-O0 -Wp,-U_FORTIFY_SOURCE"
EXTRA_CFLAGS=""
if ((WITH_DEBUG)); then
EXTRA_CFLAGS="$EXTRA_CFLAGS -ffile-prefix-map=../src=$SRCDEST"