diff --git a/bug-1184124-link-tests-as-PIE.patch b/bug-1184124-link-tests-as-PIE.patch new file mode 100644 index 0000000..3e9b8d9 --- /dev/null +++ b/bug-1184124-link-tests-as-PIE.patch @@ -0,0 +1,12 @@ +Index: LVM2.2.03.10/test/Makefile.in +=================================================================== +--- LVM2.2.03.10.orig/test/Makefile.in ++++ LVM2.2.03.10/test/Makefile.in +@@ -31,6 +31,7 @@ LVM_TEST_RESULTS ?= results + SOURCES = lib/not.c lib/harness.c lib/dmsecuretest.c + CXXSOURCES = lib/runner.cpp + CXXFLAGS += $(EXTRA_EXEC_CFLAGS) ++LDFLAGS += -pie + + CLEAN_DIRS += dbus/__pycache__ $(LVM_TEST_RESULTS) + ifneq (.,$(firstword $(srcdir))) diff --git a/lvm2.changes b/lvm2.changes index d5cf07d..e98d04a 100644 --- a/lvm2.changes +++ b/lvm2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue May 25 11:23:12 UTC 2021 - Wolfgang Frisch + +- Link test as position independent executable (bsc#1184124). + + bug-1184124-link-tests-as-PIE.patch + ------------------------------------------------------------------- Fri Apr 23 03:45:00 UTC 2021 - heming.zhao@suse.com diff --git a/lvm2.spec b/lvm2.spec index 93a7a58..f6c24d7 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -1,5 +1,5 @@ # -# spec file for package lvm2 +# spec file # # Copyright (c) 2021 SUSE LLC # @@ -26,8 +26,8 @@ %define thin_provisioning_version 0.7.0 %define _supportsanlock 0 %define dlm_version 4.0.9 -# from lvm2 version 2.03, suse obsoleted clvm, cmirrord, liblvm2app & liblvm2cmd. -# so the obseletes version is 2.03 +# from lvm2 version 2.03, suse obsoleted clvm, cmirrord, liblvm2app & liblvm2cmd. +# so the obseletes version is 2.03 %define lvm2_clvm_version 2.03 %define lvm2_cmirrord_version 2.03 %define liblvm2app2_2_version 2.03 @@ -79,6 +79,7 @@ Patch1007: bug-1184687_Add-nolvm-for-kernel-cmdline.patch # SUSE patches 2000+ for device mapper, udev rules Patch2001: bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch # SUSE patches 3000+ for test code +Patch3001: bug-1184124-link-tests-as-PIE.patch # SUSE patches 4000+ for lvm2.spec Patch4001: bug-1037309_Makefile-skip-compliling-daemons-lvmlockd-directory.patch # To detect modprobe during build @@ -90,7 +91,7 @@ BuildRequires: pkgconfig(libudev) Requires: device-mapper >= %{device_mapper_version} Requires: modutils Requires(post): coreutils -Requires(postun): coreutils +Requires(postun):coreutils Provides: lvm = %{version} Obsoletes: lvm2-cmirrord <= %{lvm2_cmirrord_version} %{?systemd_requires} @@ -138,6 +139,7 @@ Volume Manager. %patch1006 -p1 %patch1007 -p1 %patch2001 -p1 +%patch3001 -p1 %if !%{with lockd} %patch4001 -p1 @@ -479,6 +481,7 @@ LVM commands use lvmlockd to coordinate access to shared storage. %{_sbindir}/rclvm2-lvmlocking %else + %pre %service_add_pre blk-availability.service lvm2-monitor.service lvm2-lvmpolld.service lvm2-lvmpolld.socket