mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
mkosi: Switch to O0 and disable FORTIFY_SOURCE
-Og still causes a lot of "<optimized out>" in GDB so let's use -O0 instead and disable FORTIFY_SOURCE as it doesn't work without optimizations enabled.
This commit is contained in:
@@ -20,12 +20,12 @@ mount --mkdir --rbind "$PWD/pkg/$ID" "pkg/$ID/src/"
|
||||
# shellcheck source=/dev/null
|
||||
. /etc/makepkg.conf
|
||||
|
||||
# Override the default options. Use -Og because -O0 doesn't work with FORTIFY_SOURCE. 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. 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.
|
||||
tee --append /etc/makepkg.conf >/dev/null <<EOF
|
||||
CFLAGS="$CFLAGS -Og"
|
||||
CFLAGS="$CFLAGS -O0 -Wp,-D_FORTIFY_SOURCE=0"
|
||||
OPTIONS=(
|
||||
docs
|
||||
!libtool
|
||||
|
||||
@@ -31,7 +31,8 @@ DIST="$(rpm --eval %dist)"
|
||||
ARCH="$(rpm --eval %_arch)"
|
||||
SRCDEST="/usr/src/debug/systemd-$VERSION-${RELEASE}${DIST}.$ARCH"
|
||||
|
||||
EXTRA_CFLAGS="-Og"
|
||||
# TODO: Drop -D_FORTIFY_SOURCE when we switch to CentOS Stream 10.
|
||||
EXTRA_CFLAGS="-O0 -Wp,-D_FORTIFY_SOURCE=0"
|
||||
if ((WITH_DEBUG)); then
|
||||
EXTRA_CFLAGS="$EXTRA_CFLAGS -ffile-prefix-map=../src=$SRCDEST"
|
||||
fi
|
||||
@@ -71,6 +72,7 @@ rpmbuild \
|
||||
--define "__elf_exclude_path ^/usr/lib/systemd/tests/unit-tests/.*$" \
|
||||
--define "__script_requires %{nil}" \
|
||||
--define "_find_debuginfo_dwz_opts %{nil}" \
|
||||
--define "_fortify_level 0" \
|
||||
--undefine _lto_cflags \
|
||||
--noclean \
|
||||
"pkg/$ID/systemd.spec"
|
||||
|
||||
@@ -46,15 +46,15 @@ build() {
|
||||
$( ((WITH_TESTS)) || echo nocheck) \
|
||||
$( ((WITH_DOCS)) || echo nodoc) \
|
||||
$( ((WITH_DEBUG)) || echo nostrip) \
|
||||
terse
|
||||
terse \
|
||||
optimize=-lto \
|
||||
noopt \
|
||||
" \
|
||||
DEB_BUILD_PROFILES="\
|
||||
$( ((WITH_TESTS)) || echo nocheck) \
|
||||
$( ((WITH_DOCS)) || echo nodoc) \
|
||||
pkg.systemd.upstream \
|
||||
" \
|
||||
DEB_CFLAGS_APPEND="-Og" \
|
||||
DPKG_FORCE="unsafe-io" \
|
||||
DPKG_DEB_COMPRESSOR_TYPE="none" \
|
||||
DH_MISSING="--fail-missing" \
|
||||
|
||||
Reference in New Issue
Block a user