Re: [PATCH rdma-core 9/9] rpm: Include static libraries in the build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2018-10-25 11:53 AM, Jason Gunthorpe wrote:
On Thu, Oct 25, 2018 at 05:31:46PM +0200, Nicolas Morey-Chaisemartin wrote:


On 10/25/18 4:18 PM, Jason Gunthorpe wrote:
On Thu, Oct 25, 2018 at 10:00:06AM -0400, Doug Ledford wrote:
On Wed, 2018-10-24 at 12:43 +0200, Nicolas Morey-Chaisemartin wrote:
On 10/23/18 10:57 PM, Jason Gunthorpe wrote:
From: Jason Gunthorpe <jgg@xxxxxxxxxxxx>

Now that we can produce them properly, add them.

Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>

SUSE packaging policy does not allow for static libraries (apart
from a few rare exceptions).  Thus, they shouldn't enable them
by default. I'm not against adding a RPM option to enable it if
needed.
Red Hat/Fedora have the same policy BTW.  As far as Red Hat is
concerned, it's all about making sure that security updates to
libraries actually make it into use and insecure, broken
libraries don't stay hanging around because they are statically
linked into something.
Some of the distros have asked for this, do you want to just drop the
patches enabling this in packaging and leave it up to the packagers
for now?

If people have asked for this on RPM based distro, let's add a flag
(disabled by default) for both RHEL and SUSE so any outside packager
( OFED ? ) can enable it very easily.

Sure, I've never used rpmbuild flags, can you give an quick example?

Something like this:

diff --git a/redhat/rdma-core.spec b/redhat/rdma-core.spec
index c281c5fa..19154ff5 100644
--- a/redhat/rdma-core.spec
+++ b/redhat/rdma-core.spec
@@ -11,6 +11,8 @@ License: GPLv2 or BSD
 Url: https://github.com/linux-rdma/rdma-core
 Source: rdma-core-%{version}.tgz

+%define with_static %{?_with_static: 1} %{?!_with_static: 0}
+
 BuildRequires: binutils
 BuildRequires: cmake >= 2.8.11
 BuildRequires: gcc
@@ -233,6 +235,9 @@ discover and use SCSI devices via the SCSI RDMA Protocol over InfiniBand.
          -DCMAKE_INSTALL_RUNDIR:PATH=%{_rundir} \
          -DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir}/%{name}-%{version} \
          -DCMAKE_INSTALL_UDEV_RULESDIR:PATH=%{_udevrulesdir} \
+%if %{with_static}
+        -DENABLE_STATIC=1 \
+%endif
          %{EXTRA_CMAKE_FLAGS}
 %make_jobs

@@ -352,6 +357,9 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh
 %dir %{_includedir}/rdma
 %{_includedir}/infiniband/*
 %{_includedir}/rdma/*
+%if %{with_static}
+%{_libdir}/lib*.a
+%endif
 %{_libdir}/lib*.so
 %{_libdir}/pkgconfig/*.pc
 %{_mandir}/man3/ibv_*

The junk at the top should allow you to do 'rpmbuild -bb --with static rdma-core.spec', but for simplicity, you could also simply %define with_static 0, and let people edit it to 1 to enable (which is probably better for a distro case).

--
Jarod Wilson
jarod@xxxxxxxxxx



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux