mbox series

[rdma-core,0/9] Build static libraries in rdma-core

Message ID 20181023205701.3729-1-jgg@ziepe.ca (mailing list archive)
Headers show
Series Build static libraries in rdma-core | expand

Message

Jason Gunthorpe Oct. 23, 2018, 8:56 p.m. UTC
From: Jason Gunthorpe <jgg@mellanox.com>

Restore static library support. Before rdma-core we did produce some
simplistic static libraries, and this was lost when things became more
complicated.

This version is a complete solution and provides a simple way for applications
to use the static libraries, including static providers, without having to
resort to strange linker options.

The man page libibverbs/man/ibv_get_device_list.3.md explains how the new
linking mechanism works, and the buildlib/sanitize_static_lib.py is an
exploration in why this is so hard.

Jason Gunthorpe (9):
  verbs: Move all dynamic driver opening code to dynamic_driver.c
  verbs: Do not include dynamic loading in static libraries
  Generate complete and sanitized static libraries
  pkg-config: If static libraries are enabled add Requires.private
  Add a travis test for static libraries
  verbs: Expose the struct verbs_device_ops for each provider to the
    linker
  verbs: Add RDMA_STATIC_PROVIDERS
  debian: Include static libraries in the build
  rpm: Include static libraries in the build

 CMakeLists.txt                          |   3 +
 buildlib/cbuild                         |   1 +
 buildlib/check-build                    | 174 +++++++++++++++
 buildlib/rdma_functions.cmake           |  94 +++++---
 buildlib/sanitize_static_lib.py         | 278 ++++++++++++++++++++++++
 buildlib/travis-build                   |   2 +-
 debian/control                          |   2 +
 debian/libibumad-dev.install            |   1 +
 debian/libibverbs-dev.install           |   4 +
 debian/librdmacm-dev.install            |   1 +
 debian/rules                            |   1 +
 libibverbs/CMakeLists.txt               |  31 ++-
 libibverbs/all_providers.c              |  53 +++++
 libibverbs/driver.h                     |  14 +-
 libibverbs/dynamic_driver.c             | 241 ++++++++++++++++++++
 libibverbs/ibverbs.h                    |   8 +
 libibverbs/init.c                       | 206 ------------------
 libibverbs/man/ibv_get_device_list.3.md |  20 ++
 libibverbs/static_driver.c              |  52 +++++
 libibverbs/verbs.h                      |  50 +++++
 providers/bnxt_re/main.c                |   2 +-
 providers/cxgb3/iwch.c                  |   2 +-
 providers/cxgb4/dev.c                   |   2 +-
 providers/hfi1verbs/hfiverbs.c          |   2 +-
 providers/hns/hns_roce_u.c              |   2 +-
 providers/i40iw/i40iw_umain.c           |   2 +-
 providers/ipathverbs/ipathverbs.c       |   2 +-
 providers/mlx4/mlx4.c                   |   2 +-
 providers/mlx5/mlx5.c                   |   2 +-
 providers/mthca/mthca.c                 |   2 +-
 providers/nes/nes_umain.c               |   2 +-
 providers/ocrdma/ocrdma_main.c          |   2 +-
 providers/qedr/qelr_main.c              |   2 +-
 providers/rxe/rxe.c                     |   2 +-
 providers/vmw_pvrdma/pvrdma_main.c      |   2 +-
 redhat/rdma-core.spec                   |   7 +
 suse/rdma-core.spec                     |   8 +
 37 files changed, 1022 insertions(+), 259 deletions(-)
 create mode 100644 buildlib/sanitize_static_lib.py
 create mode 100644 libibverbs/all_providers.c
 create mode 100644 libibverbs/dynamic_driver.c
 create mode 100644 libibverbs/static_driver.c

Comments

Jason Gunthorpe Nov. 2, 2018, 2:41 a.m. UTC | #1
On Tue, Oct 23, 2018 at 02:56:52PM -0600, Jason Gunthorpe wrote:
> From: Jason Gunthorpe <jgg@mellanox.com>
> 
> Restore static library support. Before rdma-core we did produce some
> simplistic static libraries, and this was lost when things became more
> complicated.
> 
> This version is a complete solution and provides a simple way for applications
> to use the static libraries, including static providers, without having to
> resort to strange linker options.
> 
> The man page libibverbs/man/ibv_get_device_list.3.md explains how the new
> linking mechanism works, and the buildlib/sanitize_static_lib.py is an
> exploration in why this is so hard.
> 
> Jason Gunthorpe (9):
>   verbs: Move all dynamic driver opening code to dynamic_driver.c
>   verbs: Do not include dynamic loading in static libraries
>   Generate complete and sanitized static libraries
>   pkg-config: If static libraries are enabled add Requires.private
>   Add a travis test for static libraries
>   verbs: Expose the struct verbs_device_ops for each provider to the
>     linker
>   verbs: Add RDMA_STATIC_PROVIDERS
>   debian: Include static libraries in the build
>   rpm: Include static libraries in the build

Merged

Jason