kaleb@redhat.com has uploaded this change for review.

View Change

build: (lib)ganesha_nfsd as a DSO

Build ganesha as a DSO, i.e. libganesha_nfsd.so.

Final (or is it?, addressing comments from all prior reviews.

The ganesha.nfsd daemon consists of just nfs_main:main() and is
linked with the DSO.

Then all the FSALs (except FSAL_PSEUDO and FSAL_MDCACHE*) are linked
with libganesha_nfsd to resolve functions in ganesha.nfsd itself.

This will be required if, e.g., Fedora, decides to require default
linking with '-z defs'. They tried to do it for F29 but retreated
when they found that too many applications broke. In the end this may
all be just an exercise in "truth and beauty." There are other use
cases envisioned where ganesha is embedded as a component as part
of other software components.

*FSAL_PSEUDO and FSAL_MDCACHE are special; they are included in the
DSO so should not need to be (and can't be) linked with the DSO.

Cmake OBJECT libraries are not actual libraries like .a static or .so
shared libs; they just compile the sources to .o files which are
collectively referenced with cmake's $<TARGET_OBJECTS:...>. As such
it is necessary to use set_target_properties(... COMPILE_FLAGS "-fPIC")
everywhere.

A few other things that could be done in the future are
1) link libganesha_nfsd.so with a .sym file to explicitly control which
symbols are exposed or visible to the outside world.
2) build with -flto (Link Time Optimization)
Annecdotes claim a 5-10% speed improvement is typical, and some
applications have seen as much as 45-50% boost. Of course we have to
do the experiment to see what we can really achieve.
3) don't link ganesha.nfsd with -bdynamic as it's no longer needed

Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Change-Id: Icf911663394a38e774884a658b2ddbb0e3e75bfa
---
M src/CMakeLists.txt
M src/FSAL/FSAL_GLUSTER/CMakeLists.txt
M src/FSAL/FSAL_GPFS/CMakeLists.txt
M src/FSAL/FSAL_MEM/CMakeLists.txt
M src/FSAL/FSAL_PROXY/CMakeLists.txt
M src/FSAL/FSAL_PSEUDO/CMakeLists.txt
M src/FSAL/FSAL_RGW/CMakeLists.txt
M src/FSAL/FSAL_VFS/CMakeLists.txt
M src/FSAL/FSAL_VFS/os/CMakeLists.txt
M src/FSAL/FSAL_VFS/panfs/CMakeLists.txt
M src/FSAL/FSAL_VFS/vfs/CMakeLists.txt
M src/FSAL/FSAL_VFS/xfs/CMakeLists.txt
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/CMakeLists.txt
M src/FSAL/Stackable_FSALs/FSAL_NULL/CMakeLists.txt
M src/MainNFSD/CMakeLists.txt
M src/Protocols/9P/CMakeLists.txt
M src/Protocols/CMakeLists.txt
M src/Protocols/NFS/CMakeLists.txt
M src/Protocols/NLM/CMakeLists.txt
M src/Protocols/RQUOTA/CMakeLists.txt
M src/Protocols/XDR/CMakeLists.txt
M src/RPCAL/CMakeLists.txt
M src/SAL/CMakeLists.txt
M src/avl/CMakeLists.txt
M src/cidr/CMakeLists.txt
M src/config_parsing/CMakeLists.txt
M src/dbus/CMakeLists.txt
M src/hashtable/CMakeLists.txt
M src/idmapper/CMakeLists.txt
M src/log/CMakeLists.txt
M src/nfs-ganesha.spec-in.cmake
M src/os/CMakeLists.txt
M src/support/CMakeLists.txt
M src/support/murmur3.c
M src/tools/CMakeLists.txt
35 files changed, 211 insertions(+), 161 deletions(-)

git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/82/449182/1

To view, visit change 449182. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: Icf911663394a38e774884a658b2ddbb0e3e75bfa
Gerrit-Change-Number: 449182
Gerrit-PatchSet: 1
Gerrit-Owner: kaleb@redhat.com
Gerrit-MessageType: newchange