From 2fff9987a6d150084a0940a1a0b037600e12c25d4e471059fa01a17d34865192 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 20 Aug 2019 12:15:17 +0000 Subject: [PATCH] Accepting request 723945 from home:michel_mno:branches:devel:libraries:c_c++ - Add libsodium_configure_cpuid_chg.patch and call autoconf to regenerate configure script with proper CPUID checking. Required at least for PowerPC and ARM now that LTO enabled. OBS-URL: https://build.opensuse.org/request/show/723945 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libsodium?expand=0&rev=74 --- libsodium.changes | 7 +++++++ libsodium.spec | 6 ++++-- libsodium_configure_cpuid_chg.patch | 28 ++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 libsodium_configure_cpuid_chg.patch diff --git a/libsodium.changes b/libsodium.changes index f3fd7b3..d46d072 100644 --- a/libsodium.changes +++ b/libsodium.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Aug 16 09:17:55 UTC 2019 - Michel Normand + +- Add libsodium_configure_cpuid_chg.patch and call autoconf + to regenerate configure script with proper CPUID checking. + Required at least for PowerPC and ARM now that LTO enabled. + ------------------------------------------------------------------- Sun Jun 16 10:04:32 UTC 2019 - ecsos@opensuse.org diff --git a/libsodium.spec b/libsodium.spec index fd2567e..2adbb62 100644 --- a/libsodium.spec +++ b/libsodium.spec @@ -29,7 +29,9 @@ Source0: https://download.libsodium.org/libsodium/releases/%{name}-%{vers Source1: https://download.libsodium.org/libsodium/releases/%{name}-%{version}.tar.gz.sig Source2: %{name}.keyring Source99: baselibs.conf +BuildRequires: libtool BuildRequires: pkgconfig +Patch1: libsodium_configure_cpuid_chg.patch %description NaCl (pronounced "salt") is a new easy-to-use high-speed software library @@ -62,10 +64,10 @@ to compile and develop applications that use libsodium. %prep %setup -q +%patch1 -p1 %build -# Do _NOT_ change CFLAGS -# See https://github.com/jedisct1/libsodium/issues/604 +autoreconf -fvi %configure \ --disable-static \ --disable-silent-rules diff --git a/libsodium_configure_cpuid_chg.patch b/libsodium_configure_cpuid_chg.patch new file mode 100644 index 0000000..d1f3b80 --- /dev/null +++ b/libsodium_configure_cpuid_chg.patch @@ -0,0 +1,28 @@ +From: Michel Normand +Subject: libsodium configure cpuid chg +Date: Fri, 16 Aug 2019 10:58:52 +0200 + +libsodium configure cpuid chg + +To avoid to have bad detection of cpuid when lto is enabled. +This should solve the old upstream issue#604 +https://github.com/jedisct1/libsodium/issues/604 + +Signed-off-by: Michel Normand +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: libsodium-1.0.18/configure.ac +=================================================================== +--- libsodium-1.0.18.orig/configure.ac ++++ libsodium-1.0.18/configure.ac +@@ -694,7 +694,7 @@ AC_SUBST(HAVE_TI_MODE_V) + HAVE_CPUID_V=0 + AS_IF([test "$enable_asm" != "no"],[ + AC_MSG_CHECKING(for cpuid instruction) +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[ + unsigned int cpu_info[4]; + __asm__ __volatile__ ("xchgl %%ebx, %k1; cpuid; xchgl %%ebx, %k1" : + "=a" (cpu_info[0]), "=&r" (cpu_info[1]),