Fix build for x86-64-v3

Backport of https://github.com/AcademySoftwareFoundation/openexr/pull/1507

Also, run all tests on i686, ppc64le, and x86_64 (including -v3), as
previous failures on those architectures were fixed in 3.1.10.
This commit is contained in:
Yaakov Selkowitz 2023-08-04 15:30:56 -04:00
parent 9ccccbab1f
commit c2153a3c37
2 changed files with 34 additions and 11 deletions

26
march-x86-64-v3.patch Normal file
View File

@ -0,0 +1,26 @@
Backport of https://github.com/AcademySoftwareFoundation/openexr/pull/1507
diff --git a/src/lib/OpenEXRCore/internal_cpuid.h b/src/lib/OpenEXRCore/internal_cpuid.h
index edfee0b8..8a2573b8 100644
--- a/src/lib/OpenEXRCore/internal_cpuid.h
+++ b/src/lib/OpenEXRCore/internal_cpuid.h
@@ -39,14 +39,15 @@ check_for_x86_simd (int* f16c, int* avx, int* sse2)
*f16c = 0;
# endif
-#elif OPENEXR_ENABLE_X86_SIMD_CHECK
-
+#elif defined(__AVX__) && defined(__F16C__)
// shortcut if everything is turned on / compiled in
-# if defined(__AVX__) && defined(__F16C__)
*f16c = 1;
*avx = 1;
*sse2 = 1;
-# elif defined(_MSC_VER) && defined(_WIN32)
+
+#elif OPENEXR_ENABLE_X86_SIMD_CHECK
+
+# if defined(_MSC_VER) && defined(_WIN32)
int regs[4], osxsave;
__cpuid (regs, 0);

View File

@ -3,7 +3,7 @@
Name: openexr Name: openexr
Version: 3.1.10 Version: 3.1.10
Release: 1%{?dist} Release: 2%{?dist}
Summary: Provides the specification and reference implementation of the EXR file format Summary: Provides the specification and reference implementation of the EXR file format
License: BSD-3-Clause License: BSD-3-Clause
@ -11,6 +11,8 @@ URL: https://www.openexr.com/
Source0: https://github.com/AcademySoftwareFoundation/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz Source0: https://github.com/AcademySoftwareFoundation/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: openexr-cstdint.patch Patch0: openexr-cstdint.patch
# https://github.com/AcademySoftwareFoundation/openexr/pull/1507
Patch1: march-x86-64-v3.patch
BuildRequires: cmake gcc gcc-c++ BuildRequires: cmake gcc gcc-c++
BuildRequires: boost-devel BuildRequires: boost-devel
@ -105,12 +107,7 @@ Summary: Development files for %{name}
%check %check
# Some tests fail on particular architectures # Some tests fail on particular architectures
%ifarch %{ix86} %ifarch aarch64
# https://github.com/AcademySoftwareFoundation/openexr/issues/1459 (fixed in 3.1.10)
# https://github.com/AcademySoftwareFoundation/openexr/issues/1460
EXCLUDE_REGEX='DWA[AB]Compression|CPUIdent'
%endif
%ifarch aarch64 ppc64le
# https://github.com/AcademySoftwareFoundation/openexr/issues/1460 # https://github.com/AcademySoftwareFoundation/openexr/issues/1460
EXCLUDE_REGEX='DWA[AB]Compression' EXCLUDE_REGEX='DWA[AB]Compression'
%endif %endif
@ -118,10 +115,6 @@ EXCLUDE_REGEX='DWA[AB]Compression'
# https://github.com/AcademySoftwareFoundation/openexr/issues/1175 # https://github.com/AcademySoftwareFoundation/openexr/issues/1175
EXCLUDE_REGEX='ReadDeep|DWA[AB]Compression|testCompression|Rgba|SampleImages|SharedFrameBuffer' EXCLUDE_REGEX='ReadDeep|DWA[AB]Compression|testCompression|Rgba|SampleImages|SharedFrameBuffer'
%endif %endif
%ifarch x86_64
# https://github.com/AcademySoftwareFoundation/openexr/issues/1456
EXCLUDE_REGEX='OptimizedInterleavePatterns'
%endif
%ctest --exclude-regex "$EXCLUDE_REGEX" %ctest --exclude-regex "$EXCLUDE_REGEX"
@ -158,6 +151,10 @@ EXCLUDE_REGEX='OptimizedInterleavePatterns'
%changelog %changelog
* Fri Aug 04 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 3.1.10-2
- Fix build for x86-64-v3
- Run all tests on i686, ppc64le, x86_64
* Fri Aug 04 2023 Richard Shaw <hobbes1069@gmail.com> - 3.1.10-1 * Fri Aug 04 2023 Richard Shaw <hobbes1069@gmail.com> - 3.1.10-1
- Update to 3.1.10. - Update to 3.1.10.