Only ever build primary arch. Put tools under libexec.

This commit is contained in:
Mark Wielaard 2019-04-08 19:58:15 +02:00
parent c913a697a0
commit 4fb41b50de
2 changed files with 142 additions and 73 deletions

View File

@ -0,0 +1,117 @@
diff --git a/Makefile.all.am b/Makefile.all.am
index 3786e34..1befef5 100644
--- a/Makefile.all.am
+++ b/Makefile.all.am
@@ -50,20 +50,20 @@ inplace-noinst_DSYMS: build-noinst_DSYMS
done
# This is used by coregrind/Makefile.am and by <tool>/Makefile.am for doing
-# "make install". It copies $(noinst_PROGRAMS) into $prefix/lib/valgrind/.
+# "make install". It copies $(noinst_PROGRAMS) into $prefix/libexec/valgrind/.
# It needs to be depended on by an 'install-exec-local' rule.
install-noinst_PROGRAMS: $(noinst_PROGRAMS)
- $(mkinstalldirs) $(DESTDIR)$(pkglibdir); \
+ $(mkinstalldirs) $(DESTDIR)$(pkglibexecdir); \
for f in $(noinst_PROGRAMS); do \
- $(INSTALL_PROGRAM) $$f $(DESTDIR)$(pkglibdir); \
+ $(INSTALL_PROGRAM) $$f $(DESTDIR)$(pkglibexecdir); \
done
# This is used by coregrind/Makefile.am and by <tool>/Makefile.am for doing
-# "make uninstall". It removes $(noinst_PROGRAMS) from $prefix/lib/valgrind/.
+# "make uninstall". It removes $(noinst_PROGRAMS) from $prefix/libexec/valgrind/.
# It needs to be depended on by an 'uninstall-local' rule.
uninstall-noinst_PROGRAMS:
for f in $(noinst_PROGRAMS); do \
- rm -f $(DESTDIR)$(pkglibdir)/$$f; \
+ rm -f $(DESTDIR)$(pkglibexecdir)/$$f; \
done
# Similar to install-noinst_PROGRAMS.
@@ -71,15 +71,15 @@ uninstall-noinst_PROGRAMS:
# directories. XXX: not sure whether the resulting permissions will be
# correct when using 'cp -R'...
install-noinst_DSYMS: build-noinst_DSYMS
- $(mkinstalldirs) $(DESTDIR)$(pkglibdir); \
+ $(mkinstalldirs) $(DESTDIR)$(pkglibexecdir); \
for f in $(noinst_DSYMS); do \
- cp -R $$f.dSYM $(DESTDIR)$(pkglibdir); \
+ cp -R $$f.dSYM $(DESTDIR)$(pkglibexecdir); \
done
# Similar to uninstall-noinst_PROGRAMS.
uninstall-noinst_DSYMS:
for f in $(noinst_DSYMS); do \
- rm -f $(DESTDIR)$(pkglibdir)/$$f.dSYM; \
+ rm -f $(DESTDIR)$(pkglibexecdir)/$$f.dSYM; \
done
# This needs to be depended on by a 'clean-local' rule.
diff --git a/Makefile.am b/Makefile.am
index 242b38a..3b7c806 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -58,7 +58,7 @@ DEFAULT_SUPP_FILES = @DEFAULT_SUPP@
# default.supp, as it is built from the base .supp files at compile-time.
dist_noinst_DATA = $(SUPP_FILES)
-vglibdir = $(pkglibdir)
+vglibdir = $(pkglibexecdir)
vglib_DATA = default.supp
pkgconfigdir = $(libdir)/pkgconfig
diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am
index 94030fd..f09763a 100644
--- a/coregrind/Makefile.am
+++ b/coregrind/Makefile.am
@@ -11,12 +11,12 @@ include $(top_srcdir)/Makefile.all.am
AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@ += \
-I$(top_srcdir)/coregrind \
- -DVG_LIBDIR="\"$(pkglibdir)"\" \
+ -DVG_LIBDIR="\"$(pkglibexecdir)"\" \
-DVG_PLATFORM="\"@VGCONF_ARCH_PRI@-@VGCONF_OS@\""
if VGCONF_HAVE_PLATFORM_SEC
AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@ += \
-I$(top_srcdir)/coregrind \
- -DVG_LIBDIR="\"$(pkglibdir)"\" \
+ -DVG_LIBDIR="\"$(pkglibexecdir)"\" \
-DVG_PLATFORM="\"@VGCONF_ARCH_SEC@-@VGCONF_OS@\""
endif
@@ -714,7 +714,7 @@ GDBSERVER_XML_FILES = \
m_gdbserver/mips64-fpu.xml
# so as to make sure these get copied into the install tree
-vglibdir = $(pkglibdir)
+vglibdir = $(pkglibexecdir)
vglib_DATA = $(GDBSERVER_XML_FILES)
# so as to make sure these get copied into the tarball
diff --git a/mpi/Makefile.am b/mpi/Makefile.am
index 7ad9a25..471fee0 100644
--- a/mpi/Makefile.am
+++ b/mpi/Makefile.am
@@ -18,16 +18,18 @@ EXTRA_DIST = \
# libmpiwrap-<platform>.so
#----------------------------------------------------------------------------
-noinst_PROGRAMS =
+# These are really real libraries, so they should go to libdir, not libexec.
+mpidir = $(pkglibdir)
+mpi_PROGRAMS =
if BUILD_MPIWRAP_PRI
-noinst_PROGRAMS += libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so
+mpi_PROGRAMS += libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so
endif
if BUILD_MPIWRAP_SEC
-noinst_PROGRAMS += libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so
+mpi_PROGRAMS += libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so
endif
if VGCONF_OS_IS_DARWIN
-noinst_DSYMS = $(noinst_PROGRAMS)
+mpi_DSYMS = $(mpi_PROGRAMS)
endif

View File

@ -14,29 +14,6 @@ URL: http://www.valgrind.org/
%{?scl:%global is_scl 1} %{?scl:%global is_scl 1}
%{!?scl:%global is_scl 0} %{!?scl:%global is_scl 0}
# Only arches that are supported upstream as multilib and that the distro
# has multilib builds for should set build_multilib 1. In practice that
# is only x86_64 and ppc64 (but not in fedora 21 and later, and never
# for ppc64le or when building for scl).
%global build_multilib 0
%ifarch x86_64
%global build_multilib 1
%endif
%ifarch ppc64
%if %{is_scl}
%global build_multilib 0
%else
%if 0%{?rhel}
%global build_multilib 1
%endif
%if 0%{?fedora}
%global build_multilib (%fedora < 21)
%endif
%endif
%endif
# We never want the openmpi subpackage when building a software collecton. # We never want the openmpi subpackage when building a software collecton.
# We always want it for fedora. # We always want it for fedora.
# We only want it for older rhel. # We only want it for older rhel.
@ -184,11 +161,11 @@ Patch38: valgrind-3.14.0-ppc64-quotactl.patch
# SW#6399 glibc might implement gettid itself, rename to gettid_sys. # SW#6399 glibc might implement gettid itself, rename to gettid_sys.
Patch39: valgrind-3.14.0-gettid.patch Patch39: valgrind-3.14.0-gettid.patch
# We want all executables and libraries in libexec instead of lib
# so they are only available for valgrind usage itself and so the
# same directory is used independent of arch.
Patch40: valgrind-3.14.0-pkglibexecdir.patch
%if %{build_multilib}
# Ensure glibc{,-devel} is installed for both multilib arches
BuildRequires: /lib/libc.so.6 /usr/lib/libc.so /lib64/libc.so.6 /usr/lib64/libc.so
%endif
%if 0%{?fedora} >= 15 %if 0%{?fedora} >= 15
BuildRequires: glibc-devel >= 2.14 BuildRequires: glibc-devel >= 2.14
@ -239,41 +216,40 @@ ExclusiveArch: %{valgrind_arches}
%else %else
ExclusiveArch: %{ix86} x86_64 ppc ppc64 ppc64le s390x armv7hl aarch64 ExclusiveArch: %{ix86} x86_64 ppc ppc64 ppc64le s390x armv7hl aarch64
%endif %endif
# Define valarch, the architecture name that valgrind uses
# And only_arch, the configure option to only build for that arch.
%ifarch %{ix86} %ifarch %{ix86}
%define valarch x86 %define valarch x86
%define valsecarch %{nil} %define only_arch --enable-only32bit
%endif %endif
%ifarch x86_64 %ifarch x86_64
%define valarch amd64 %define valarch amd64
%define valsecarch x86 %define only_arch --enable-only64bit
%endif %endif
%ifarch ppc %ifarch ppc
%define valarch ppc32 %define valarch ppc32
%define valsecarch %{nil} %define only_arch --enable-only32bit
%endif %endif
%ifarch ppc64 %ifarch ppc64
%define valarch ppc64be %define valarch ppc64be
%if %{build_multilib} %define only_arch --enable-only64bit
%define valsecarch ppc32
%else
%define valsecarch %{nil}
%endif
%endif %endif
%ifarch ppc64le %ifarch ppc64le
%define valarch ppc64le %define valarch ppc64le
%define valsecarch %{nil} %define only_arch --enable-only64bit
%endif %endif
%ifarch s390x %ifarch s390x
%define valarch s390x %define valarch s390x
%define valsecarch %{nil} %define only_arch --enable-only64bit
%endif %endif
%ifarch armv7hl %ifarch armv7hl
%define valarch arm %define valarch arm
%define valsecarch %{nil} %define only_arch --enable-only32bit
%endif %endif
%ifarch aarch64 %ifarch aarch64
%define valarch arm64 %define valarch arm64
%define valsecarch %{nil} %define only_arch --enable-only64bit
%endif %endif
%description %description
@ -357,16 +333,10 @@ Valgrind User Manual for details.
%patch37 -p1 %patch37 -p1
%patch38 -p1 %patch38 -p1
%patch39 -p1 %patch39 -p1
%patch40 -p1
%build %build
CC=gcc CC=gcc
%if %{build_multilib}
# Ugly hack - libgcc 32-bit package might not be installed
mkdir -p shared/libgcc/32
ar r shared/libgcc/32/libgcc_s.a
ar r shared/libgcc/libgcc_s_32.a
CC="gcc -B `pwd`/shared/libgcc/"
%endif
# Some patches (might) touch Makefile.am or configure.ac files. # Some patches (might) touch Makefile.am or configure.ac files.
# Just always autoreconf so we don't need patches to prebuild files. # Just always autoreconf so we don't need patches to prebuild files.
@ -398,6 +368,7 @@ CC="gcc -B `pwd`/shared/libgcc/"
OPTFLAGS="`echo " %{optflags} " | sed 's/ -m\(64\|3[21]\) / /g;s/ -fexceptions / /g;s/ -fstack-protector\([-a-z]*\) / / g;s/ -Wp,-D_FORTIFY_SOURCE=2 / /g;s/ -O2 / /g;s/ -mcpu=\([a-z0-9]\+\) / /g;s/^ //;s/ $//'`" OPTFLAGS="`echo " %{optflags} " | sed 's/ -m\(64\|3[21]\) / /g;s/ -fexceptions / /g;s/ -fstack-protector\([-a-z]*\) / / g;s/ -Wp,-D_FORTIFY_SOURCE=2 / /g;s/ -O2 / /g;s/ -mcpu=\([a-z0-9]\+\) / /g;s/^ //;s/ $//'`"
%configure CC="$CC" CFLAGS="$OPTFLAGS" CXXFLAGS="$OPTFLAGS" \ %configure CC="$CC" CFLAGS="$OPTFLAGS" CXXFLAGS="$OPTFLAGS" \
--with-mpicc=%{mpiccpath} \ --with-mpicc=%{mpiccpath} \
%{only_arch} \
GDB=%{_bindir}/gdb GDB=%{_bindir}/gdb
make %{?_smp_mflags} make %{?_smp_mflags}
@ -440,18 +411,6 @@ ln -s ../openmpi/valgrind/libmpiwrap-%{valarch}-linux.so
popd popd
%endif %endif
%if "%{valsecarch}" != ""
pushd $RPM_BUILD_ROOT%{_libdir}/valgrind/
rm -f *-%{valsecarch}-* || :
for i in *-%{valarch}-*; do
j=`echo $i | sed 's/-%{valarch}-/-%{valsecarch}-/'`
ln -sf ../../lib/valgrind/$j $j
done
popd
%endif
rm -f $RPM_BUILD_ROOT%{_libdir}/valgrind/*.supp.in
%if %{build_tools_devel} %if %{build_tools_devel}
%ifarch %{ix86} x86_64 %ifarch %{ix86} x86_64
# To avoid multilib clashes in between i?86 and x86_64, # To avoid multilib clashes in between i?86 and x86_64,
@ -478,7 +437,7 @@ rm $RPM_BUILD_ROOT%{_libdir}/valgrind/*.a
# We don't want debuginfo generated for the vgpreload libraries. # We don't want debuginfo generated for the vgpreload libraries.
# Turn off execute bit so they aren't included in the debuginfo.list. # Turn off execute bit so they aren't included in the debuginfo.list.
# We'll turn the execute bit on again in %%files. # We'll turn the execute bit on again in %%files.
chmod 644 $RPM_BUILD_ROOT%{_libdir}/valgrind/vgpreload*-%{valarch}-*so chmod 644 $RPM_BUILD_ROOT%{_libexecdir}/valgrind/vgpreload*-%{valarch}-*so
%check %check
# Make sure some info about the system is in the build.log # Make sure some info about the system is in the build.log
@ -539,21 +498,13 @@ echo ===============END TESTING===============
%doc COPYING NEWS README_* %doc COPYING NEWS README_*
%doc docs/installed/html docs/installed/*.pdf %doc docs/installed/html docs/installed/*.pdf
%{_bindir}/* %{_bindir}/*
%dir %{_libdir}/valgrind %dir %{_libexecdir}/valgrind
# Install everything in the libdir except the .so and .a files. # Install everything in the libdir except the .so.
# The vgpreload so files might file mode adjustment (see below). # The vgpreload so files might need file mode adjustment.
# The libmpiwrap so files go in the valgrind-openmpi package. %{_libexecdir}/valgrind/*[^o]
# The .a archives go into the valgrind-devel package.
%{_libdir}/valgrind/*[^ao]
# Turn on executable bit again for vgpreload libraries. # Turn on executable bit again for vgpreload libraries.
# Was disabled in %%install to prevent debuginfo stripping. # Was disabled in %%install to prevent debuginfo stripping.
%attr(0755,root,root) %{_libdir}/valgrind/vgpreload*-%{valarch}-*so %attr(0755,root,root) %{_libexecdir}/valgrind/vgpreload*-%{valarch}-*so
# And install the symlinks to the secarch files if the exist.
# These are separate from the above because %%attr doesn't work
# on symlinks.
%if "%{valsecarch}" != ""
%{_libdir}/valgrind/vgpreload*-%{valsecarch}-*so
%endif
%{_mandir}/man1/* %{_mandir}/man1/*
%files devel %files devel
@ -597,6 +548,7 @@ fi
%changelog %changelog
* Mon Apr 8 2019 Mark Wielaard <mjw@fedoraproject.org> * Mon Apr 8 2019 Mark Wielaard <mjw@fedoraproject.org>
- Remove patches to prebuild files and always ./autogen.sh. - Remove patches to prebuild files and always ./autogen.sh.
- Only ever build primary arch. Put tools under libexec.
* Mon Mar 4 2019 Mark Wielaard <mjw@fedoraproject.org> - 3.14.0-16 * Mon Mar 4 2019 Mark Wielaard <mjw@fedoraproject.org> - 3.14.0-16
- Add valgrind-3.14.0-gettid.patch - Add valgrind-3.14.0-gettid.patch