Use -fno-semantic-interposition and more make macros

see https://github.com/SELinuxProject/selinux/blob/master/README.md

CFLAGS that are encouraged to be set when overriding are:

  -fno-semantic-interposition for gcc or compilers that do not do this.
This commit is contained in:
Petr Lautrbach 2020-07-21 19:48:47 +02:00
parent 1eee30d43f
commit 2b98f772a6
1 changed files with 7 additions and 11 deletions

View File

@ -1,5 +1,5 @@
%define ruby_inc %(pkg-config --cflags ruby)
%define libsepolver 3.1
%define libsepolver 3.1-2
Summary: SELinux library and simple utilities
Name: libselinux
@ -102,6 +102,7 @@ export DISABLE_RPM="y"
export USE_PCRE2="y"
%set_build_flags
CFLAGS="$CFLAGS -fno-semantic-interposition"
# To support building the Python wrapper against multiple Python runtimes
# Define a function, for how to perform a "build" of the python wrapper against
@ -110,13 +111,12 @@ BuildPythonWrapper() {
BinaryName=$1
# Perform the build from the upstream Makefile:
make \
%make_build \
PYTHON=$BinaryName \
LIBDIR="%{_libdir}" %{?_smp_mflags} \
LIBDIR="%{_libdir}" \
pywrap
}
make clean
%make_build LIBDIR="%{_libdir}" swigify
%make_build LIBDIR="%{_libdir}" all
@ -128,12 +128,6 @@ BuildPythonWrapper %{__python3}
InstallPythonWrapper() {
BinaryName=$1
make \
PYTHON=$BinaryName \
LIBDIR="%{_libdir}" %{?_smp_mflags} \
LIBSEPOLA="%{_libdir}/libsepol.a" \
pywrap
make \
PYTHON=$BinaryName \
DESTDIR="%{buildroot}" LIBDIR="%{_libdir}" \
@ -153,7 +147,8 @@ echo "d %{_rundir}/setrans 0755 root root" > %{buildroot}%{_tmpfilesdir}/libseli
InstallPythonWrapper %{__python3}
make DESTDIR="%{buildroot}" LIBDIR="%{_libdir}" SHLIBDIR="%{_libdir}" BINDIR="%{_bindir}" SBINDIR="%{_sbindir}" RUBYINSTALL=%{ruby_vendorarchdir} install install-rubywrap
%make_install LIBDIR="%{_libdir}" SHLIBDIR="%{_libdir}" BINDIR="%{_bindir}" SBINDIR="%{_sbindir}"
make DESTDIR="%{buildroot}" RUBYINSTALL=%{ruby_vendorarchdir} install-rubywrap
# Nuke the files we don't want to distribute
rm -f %{buildroot}%{_sbindir}/compute_*
@ -229,6 +224,7 @@ rm -f %{buildroot}%{_mandir}/man8/togglesebool*
* Mon Jul 13 2020 Tom Stellard <tstellar@redhat.com> - 3.1-2
- Use make macros
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
- Use -fno-semantic-interposition and more make macros
* Fri Jul 10 2020 Petr Lautrbach <plautrba@redhat.com> - 3.1-1
- SELinux userspace 3.1 release