Accepting request 976426 from home:mwilck:multipath

* add -U_FORTIFY_SOURCE to optflags to avoid compilation errors
    on old distros

OBS-URL: https://build.opensuse.org/request/show/976426
OBS-URL: https://build.opensuse.org/package/show/Base:System/multipath-tools?expand=0&rev=282
This commit is contained in:
Martin Wilck 2022-05-11 14:38:16 +00:00 committed by Git OBS Bridge
parent 9426f11ea0
commit 5ecd4f9894
3 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4c9a7cd248557d2ae9b62e74b04a1b942347f3750761c37a071a4b4caed91ba5
oid sha256:47c0707ceba924973547bf4a05eb518078c5af47613109503788e41294468c52
size 2685964

View File

@ -3,6 +3,8 @@ Wed May 11 12:54:27 UTC 2022 - Martin Wilck <mwilck@suse.com>
- Update to version 0.8.9+90+suse.71a70fb:
* support overriding -D_FORTIFY_SOURCE in OPTFLAGS
* add -U_FORTIFY_SOURCE to optflags to avoid compilation errors
on old distros
-------------------------------------------------------------------
Tue May 10 07:37:57 UTC 2022 - Martin Wilck <mwilck@suse.com>

View File

@ -18,6 +18,11 @@
%global _lto_cflags %{nil}
# multipath-tools auto-detects support for -D_FORTFY_SOURCE.
# This will lead to a compilation error if the distro overrides
# -D_FORTIFY_SOURCE in optflags, unless we precede it with -U
%global mp_optflags %(echo %{optflags} | sed 's/-D_FORTIFY_SOURCE=[0-9]/-U_FORTIFY_SOURCE &/')
# Whether to build libdmmp - default YES
%bcond_without libdmmp
@ -159,11 +164,11 @@ cp %{SOURCE5} .
%build
[ -n "$SOURCE_DATE_EPOCH" ] && export KBUILD_BUILD_TIMESTAMP=@$SOURCE_DATE_EPOCH
%{make_build} OPTFLAGS="%{optflags}" %{dirflags} %{makeflags}
%{make_build} OPTFLAGS="%{mp_optflags}" %{dirflags} %{makeflags}
%if 0%{?with_check} == 1
%check
%{make_build} OPTFLAGS="%{optflags}" test
%{make_build} OPTFLAGS="%{mp_optflags}" test
%endif
%install