Disable amd64 assembly on non-intel architectures
All builds would include an .S file which contains a pre-processor directive that makes the file effectively empty on non-amd64 architectures. Objects built from assembly get an executable stack by default. The file has a stanza to make the stack non-executable, but on non-amd64 architectures this stanza is skipped together with the rest of the file. Nevertheless, it seems that even the empty file causes an executable stack to be created. To avoid the issue, do a build with the assembler file explicitly skipped.
This commit is contained in:
parent
c821aeb744
commit
9ea2179ffc
17
zstd.spec
17
zstd.spec
@ -4,10 +4,12 @@
|
|||||||
%else
|
%else
|
||||||
%ifarch %{ix86} x86_64
|
%ifarch %{ix86} x86_64
|
||||||
%bcond_without pzstd
|
%bcond_without pzstd
|
||||||
|
%bcond_without asm
|
||||||
%else
|
%else
|
||||||
# aarch64 and armv7hl at least currently segfault
|
# aarch64 and armv7hl at least currently segfault
|
||||||
# in ThreadPool test for the pzstd util
|
# in ThreadPool test for the pzstd util
|
||||||
%bcond_with pzstd
|
%bcond_with pzstd
|
||||||
|
%bcond_with asm
|
||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -22,11 +24,12 @@ Source0: https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{n
|
|||||||
|
|
||||||
Patch1: pzstd.1.patch
|
Patch1: pzstd.1.patch
|
||||||
|
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
BuildRequires: gcc gtest-devel
|
BuildRequires: gcc gtest-devel
|
||||||
%if %{with pzstd}
|
%if %{with pzstd}
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
%endif
|
%endif
|
||||||
|
BuildRequires: execstack
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Zstd, short for Zstandard, is a fast lossless compression algorithm,
|
Zstd, short for Zstandard, is a fast lossless compression algorithm,
|
||||||
@ -62,14 +65,16 @@ find -name .gitignore -delete
|
|||||||
%build
|
%build
|
||||||
export CFLAGS="$RPM_OPT_FLAGS"
|
export CFLAGS="$RPM_OPT_FLAGS"
|
||||||
export LDFLAGS="$RPM_LD_FLAGS"
|
export LDFLAGS="$RPM_LD_FLAGS"
|
||||||
%make_build -C lib lib-mt
|
%make_build -C lib lib-mt %{!?with_asm:ZSTD_NO_ASM=1}
|
||||||
%make_build -C programs
|
%make_build -C programs %{!?with_asm:ZSTD_NO_ASM=1}
|
||||||
%if %{with pzstd}
|
%if %{with pzstd}
|
||||||
export CXXFLAGS="$RPM_OPT_FLAGS"
|
export CXXFLAGS="$RPM_OPT_FLAGS"
|
||||||
%make_build -C contrib/pzstd
|
%make_build -C contrib/pzstd %{!?with_asm:ZSTD_NO_ASM=1}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%check
|
%check
|
||||||
|
execstack lib/libzstd.so.1
|
||||||
|
|
||||||
export CFLAGS="$RPM_OPT_FLAGS"
|
export CFLAGS="$RPM_OPT_FLAGS"
|
||||||
export LDFLAGS="$RPM_LD_FLAGS"
|
export LDFLAGS="$RPM_LD_FLAGS"
|
||||||
make -C tests test-zstd
|
make -C tests test-zstd
|
||||||
@ -121,6 +126,10 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1
|
|||||||
%ldconfig_scriptlets -n lib%{name}
|
%ldconfig_scriptlets -n lib%{name}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Dec 28 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.5.1-1
|
||||||
|
- Disable amd64 assembly on non-intel architectures (#2035802):
|
||||||
|
this should avoid the issue where an executable stack is created.
|
||||||
|
|
||||||
* Wed Dec 22 2021 Pádraig Brady <P@draigBrady.com> - 1.5.1-1
|
* Wed Dec 22 2021 Pádraig Brady <P@draigBrady.com> - 1.5.1-1
|
||||||
- Latest upstream
|
- Latest upstream
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user