summaryrefslogtreecommitdiffstats
path: root/mkosi.images
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-04-17 14:55:08 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-04-17 15:21:01 +0200
commit8e728c14ec802059bf6b586545c4e5241b64920a (patch)
treedd2fe7de6003968aceb15c4a45d47ab89a9bb302 /mkosi.images
parentMerge pull request #32302 from DaanDeMeyer/mkosi (diff)
downloadsystemd-8e728c14ec802059bf6b586545c4e5241b64920a.tar.xz
systemd-8e728c14ec802059bf6b586545c4e5241b64920a.zip
mkosi: Set up -ffile-prefix-map= correctly when building debuginfo packages
This makes sure that the debuginfo files contain source files pointing to the source files shipped by the debugsource package. Normally this should be done automatically by rpm invoking debugedit but for some unknown reason debugedit refuses to rewrite the source files in our binaries. Given that debugedit is completely undebugable (does not generate any logs at all, and its source code is ridiculously obtuse), let's set -ffile-prefix-map= when building instead which achieves the same effect.
Diffstat (limited to 'mkosi.images')
-rwxr-xr-xmkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot18
1 files changed, 15 insertions, 3 deletions
diff --git a/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot b/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot
index e2d20d4b87..bb6854c38f 100755
--- a/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot
+++ b/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot
@@ -24,6 +24,18 @@ tee --append /usr/lib/rpm/redhat/macros <<'EOF'
%{nil}
EOF
+VERSION="$(cat meson.version)"
+RELEASE="$(date "+%Y%m%d%H%M%S" --date "@$TS")"
+
+DIST="$(rpm --eval %dist)"
+ARCH="$(rpm --eval %_arch)"
+SRCDEST="/usr/src/debug/systemd-$VERSION-${RELEASE}${DIST}.$ARCH"
+
+EXTRA_CFLAGS="-Og"
+if ((WITH_DEBUG)); then
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -ffile-prefix-map=../src=$SRCDEST"
+fi
+
IFS=
# TODO: Replace meson_build and meson_install overrides with "--undefine __meson_verbose" once
# https://github.com/mesonbuild/meson/pull/12835 is available.
@@ -43,9 +55,9 @@ rpmbuild \
--define "_binary_payload w.ufdio" \
$( ((WITH_DEBUG)) || echo --define) \
$( ((WITH_DEBUG)) || echo "debug_package %{nil}") \
- --define "version_override $(cat meson.version)" \
- --define "release_override $(date "+%Y%m%d%H%M%S" --date "@$TS")" \
- --define "_distro_extra_cflags -Og" \
+ --define "version_override $VERSION" \
+ --define "release_override $RELEASE" \
+ --define "_distro_extra_cflags $EXTRA_CFLAGS" \
--define "meson_build %{shrink:%{__meson} compile -C %{_vpath_builddir} -j %{_smp_build_ncpus} %{nil}}" \
--define "meson_install %{shrink:DESTDIR=%{buildroot} %{__meson} install -C %{_vpath_builddir} --no-rebuild --quiet %{nil}}" \
--define "meson_extra_configure_options -D mode=developer -D b_sanitize=${SANITIZERS:-none}" \