From d5d5b46090677ac501515a8801ee03cf249b08585b803e2ce754c23c689ada88 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 9 Sep 2017 22:19:09 +0000 Subject: [PATCH] Disable SIMD and propagation of SIMD flags into .pc file OBS-URL: https://build.opensuse.org/package/show/science/givaro?expand=0&rev=16 --- ...onfig-file-must-not-have-non-I-flags.patch | 39 +++++++++++++++++++ givaro.changes | 6 +++ givaro.spec | 7 ++-- 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 0001-pkgconfig-file-must-not-have-non-I-flags.patch diff --git a/0001-pkgconfig-file-must-not-have-non-I-flags.patch b/0001-pkgconfig-file-must-not-have-non-I-flags.patch new file mode 100644 index 0000000..316716e --- /dev/null +++ b/0001-pkgconfig-file-must-not-have-non-I-flags.patch @@ -0,0 +1,39 @@ +From 4775e15fe538e49237d267c677be1fe68929ab9d Mon Sep 17 00:00:00 2001 +From: Jan Engelhardt +Date: Sun, 10 Sep 2017 00:03:02 +0200 +Subject: [PATCH] pkgconfig file must not have non -I flags + +The Cflags directive in .pc files is really meant for the +preprocessor, not for the compiler. It must only contain -D and -I +flags. Otherwise, it forces flags on downstream programs that may not +want them. + +In case of the build.opensuse.org build farm, it has even led to +crashes as the machine that was randomly selected to build givaro had +SSE4, emitting -msse4.1 into Cflags, while the machine randomly +selected to build fflas-ffpack had only SSE2. That cannot work. + +"Cflags: -I/usr/include -fmessage-length=0 -grecord-gcc-switches -O2 +-Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables +-fasynchronous-unwind-tables -mmmx -mpopcnt -msse -msse2 -msse3 +-msse4.1 -msse4.2 -msse4a -mavx -mfma -mfma4 -mbmi -mfpmath=sse +-fabi-version=6" +--- + givaro.pc.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/givaro.pc.in b/givaro.pc.in +index 274d87e..6e837ff 100644 +--- a/givaro.pc.in ++++ b/givaro.pc.in +@@ -10,5 +10,5 @@ URL: http://givaro.forge.imag.fr + Version: @VERSION@ + Requires: + Libs: -L@libdir@ -lgivaro @LIBS@ +-Cflags: -I@includedir@ @CXXFLAGS@ ++Cflags: -I@includedir@ + \------------------------------------------------------- +\ No newline at end of file +-- +2.14.1 + diff --git a/givaro.changes b/givaro.changes index f53a688..aa759d6 100644 --- a/givaro.changes +++ b/givaro.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Sep 9 21:59:22 UTC 2017 - jengelh@inai.de + +- Add 0001-pkgconfig-file-must-not-have-non-I-flags.patch. +- Build with --disable-simd to get host-agnostic build results. + ------------------------------------------------------------------- Thu Oct 20 19:33:43 UTC 2016 - jengelh@inai.de diff --git a/givaro.spec b/givaro.spec index b955237..41f7dfd 100644 --- a/givaro.spec +++ b/givaro.spec @@ -1,7 +1,7 @@ # # spec file for package givaro # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -28,6 +28,7 @@ Url: http://givaro.forge.imag.fr/ #Git-Clone: https://github.com/linbox-team/givaro Source: https://github.com/linbox-team/givaro/archive/v%version.tar.gz Patch1: givaro-doc-no-build-time.patch +Patch2: 0001-pkgconfig-file-must-not-have-non-I-flags.patch # Old doxygen does not properly handle symlink recursion BuildRequires: doxygen >= 1.5.7.1 BuildRequires: fdupes @@ -105,12 +106,12 @@ the Givaro API. %prep %setup -q -%patch -P 1 -p1 +%patch -P 1 -P 2 -p1 %build autoreconf -fi %configure --disable-static --enable-doc --with-docdir="%_docdir/%name" \ - --enable-silent-rules + --enable-silent-rules --disable-simd chmod a+x givaro-config make %{?_smp_mflags}