diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-04-18 13:28:17 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-04-18 14:01:44 +0200 |
commit | 35c1ea4d69120ce091fb7386db98f7d13b20f9f2 (patch) | |
tree | e0d5abd4d48d6857b3910a06fa3f07d1937b1675 /mkosi.images/system | |
parent | mkosi: Undefine FORTIFY_SOURCE before setting it again (diff) | |
download | systemd-35c1ea4d69120ce091fb7386db98f7d13b20f9f2.tar.xz systemd-35c1ea4d69120ce091fb7386db98f7d13b20f9f2.zip |
mkosi: Setup --ffile-prefix-map= for opensuse as well
This doesn't actually work because the opensuse spec doesn't allow
adding extra build flags, but I'm working on fixing that, so let's
already set things up for later.
Diffstat (limited to 'mkosi.images/system')
-rwxr-xr-x | mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot b/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot index fe89611e36..6261be1990 100755 --- a/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot +++ b/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot @@ -29,6 +29,20 @@ tee --append /usr/lib/rpm/suse/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" + +# 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="" +if ((WITH_DEBUG)); then + EXTRA_CFLAGS="$EXTRA_CFLAGS -ffile-prefix-map=../src=$SRCDEST" +fi + build() { IFS= # TODO: Replace meson_build and meson_install overrides with "--undefine __meson_verbose" once @@ -49,15 +63,17 @@ build() { $( ((WITH_DEBUG)) || echo --define) \ $( ((WITH_DEBUG)) || echo "debug_package %{nil}") \ --define "vendor openSUSE" \ - --define "version_override $(cat meson.version)" \ - --define "release_override $(date "+%Y%m%d%H%M%S" --date "@$TS")" \ + --define "version_override $VERSION" \ + --define "release_override $RELEASE" \ --define "__check_files sh -c '$(rpm --eval %__check_files) | tee /tmp/unpackaged-files'" \ + --define "build_cflags $(rpm --eval %build_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}" \ --define "__os_install_post /usr/lib/rpm/brp-suse %{nil}" \ --define "__elf_exclude_path ^/usr/lib/systemd/tests/unit-tests/.*$" \ --define "__script_requires %{nil}" \ + --define "_find_debuginfo_dwz_opts %{nil}" \ --noclean \ "$@" \ "pkg/$ID/systemd.spec" |