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 10/25/18 6:42 PM, Jarod Wilson wrote:
> 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}
> +

You could use:
%bcond_with static_libs
The code is simpler but deceiving as this means that "without" is the default.

>  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
>
Was looking into that and for some weird reason it fails on centos7:
+ /usr/bin/cmake -DCMAKE_C_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_Fortran_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DLIB_SUFFIX=64 -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_BINDIR:PATH=/usr/bin -DCMAKE_INSTALL_SBINDIR:PATH=/usr/sbin -DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib64 -DCMAKE_INSTALL_LIBEXECDIR:PATH=/usr/libexec -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=/var -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=/var/lib -DCMAKE_INSTALL_INCLUDEDIR:PATH=/usr/include -DCMAKE_INSTALL_INFODIR:PATH=/usr/share/info -DCMAKE_INSTALL_MANDIR:PATH=/usr/share/man -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc -DCMAKE_INSTALL_SYSTEMD_SERVICEDIR:PATH=/usr/lib/systemd/system -DCMAKE_INSTALL_INITDDIR:PATH=/etc/rc.d/init.d -DCMAKE_INSTALL_RUNDIR:PATH=/run
-DCMAKE_INSTALL_DOCDIR:PATH=/usr/share/doc/rdma-core-21.0 -DCMAKE_INSTALL_UDEV_RULESDIR:PATH=/usr/lib/udev/rules.d -DENABLE_STATIC=1 '%{EXTRA_CMAKE_FLAGS}'
CMake Error: The source directory "/home/nmorey/rpmbuild/BUILD/rdma-core-21.0/%{EXTRA_CMAKE_FLAGS}" does not exist.

Seems the RPM version is handling something badly..

Nicolas


Attachment: signature.asc
Description: OpenPGP digital signature


[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