[LU-7356] configure --disable-shared broken for server builds Created: 29/Oct/15 Updated: 05/Aug/17 Resolved: 05/Aug/17 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.8.0 |
| Fix Version/s: | Lustre 2.11.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | James A Simmons | Assignee: | Nathaniel Clark |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | patch | ||
| Issue Links: |
|
||||||||
| Epic/Theme: | build | ||||||||
| Severity: | 3 | ||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||
| Description |
|
While testing |
| Comments |
| Comment by Peter Jones [ 30/Oct/15 ] |
|
Nathaniel Could you please advise? Thanks Peter |
| Comment by James A Simmons [ 31/Oct/15 ] |
|
Just to make people aware the patch from lustresnmp_la_CFLAGS := -fPIC $(NET_SNMP_CFLAGS) Both -fPIC -shared are shared file options. Same problem exist in lustre/utils/Makefile.am: mount_osd_ldiskfs_la_LDFLAGS := -shared -export-dynamic -module -avoid-version |
| Comment by James A Simmons [ 01/Nov/15 ] |
|
Looking the the configuration the question is do we want to keep mount_osd_[zfs|ldisk]fs.so as dynamic plugins when --disable-shared is enabled or make the *.so files merge into mount_lustre like a true static file. |
| Comment by Nathaniel Clark [ 05/Nov/15 ] |
|
This will require changing how the build works for those plugins when disable-shared is used. It should be doable. It will also require a change in lustre/utils/mount_utils.c since we explicitly load the .so files. |
| Comment by James A Simmons [ 05/Nov/15 ] |
|
I wonder if ltdl library to make dlopen portal would be the solution for both static and dynamic loading for mount_utils.c? |
| Comment by Nathaniel Clark [ 11/Nov/15 ] |
|
I'm not sure it would. ZFS doesn't ship with .a files so the mount_osd_zfs.so would have to be dynamically linked to libzfs unless zfs was built with different options than default. |
| Comment by James A Simmons [ 11/Nov/15 ] |
|
In that case the best option would be to create a temporary *.a file and turn it into a |
| Comment by Nathaniel Clark [ 17/Nov/15 ] |
|
James, |
| Comment by John Fuchs-Chesney (Inactive) [ 03/Dec/15 ] |
|
James, Looks like we are not going to be able to progress this any further. If you have any new ideas you would like us to investigate, please let us know. Thanks, |
| Comment by James A Simmons [ 04/Dec/15 ] |
|
Please don't close this ticket. It is a real bug. What I like to recommend at this point is to do the reverse Nathaniel. We create a static library and if shared libraries are supported then convert it to a shared library. liblustreapi.so actually does this approach today. |
| Comment by Nathaniel Clark [ 04/Dec/15 ] |
|
James, libzfs.so is provided by the libzfs2-devel package from ZFS on Linux. A patch would need to be pushed upstream to have libzfs2-devel include static versions, then those would be need to used to build a statically linked version of mount_osd_zfs.so. But the end result would still be a .so file, just statically linked, because it's explicitly dlloaded by mount/mkfs/tunefs utils. Or am I still misunderstanding your view of this? ~ Nathaniel |
| Comment by James A Simmons [ 04/Dec/15 ] |
|
The --disable-shared flags only matter if you use libtool to build the zfs mount module code. Currently it doesn't build due to the build system using lib tool. I will play with it once I get home. |
| Comment by Gerrit Updater [ 13/Dec/15 ] |
|
James Simmons (uja.ornl@yahoo.com) uploaded a new patch: http://review.whamcloud.com/17576 |
| Comment by Gerrit Updater [ 14/Dec/15 ] |
|
James Simmons (uja.ornl@yahoo.com) uploaded a new patch: http://review.whamcloud.com/17581 |
| Comment by James A Simmons [ 14/Dec/15 ] |
|
Nathaniel I submitted two patches to handle this issue. The first patch makes the lustre SNMP and liblnetconfig to obey the configure --disable-shared --disable-static. That is straight forward and . The challenge is the mount plugins. The mount plugins are always built as dynamic using libtool but libtool always obeys the configure options. So if you do a configure --disable-shared this breaks the mount plugins build. The approach I took was to not use libtool with the mount plugins. First I build it as a static library then link it into a dynamic library type code. I broke the mount plugin changes out from the original patch since dlopen didn't like what I did so I'm doing something wrong but I feel it is a good starting point. |
| Comment by Nathaniel Clark [ 15/Dec/15 ] |
|
They look good. I updated the second to account some debug code in mount_utils.c. |
| Comment by Gerrit Updater [ 06/Jan/16 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/17576/ |
| Comment by James A Simmons [ 06/Jan/16 ] |
|
A patch is still needed to handle building the mount plugins when --disable-shared is set. |
| Comment by James A Simmons [ 25/Jan/16 ] |
|
Nathaniel did you ever make any progress on this? |
| Comment by James A Simmons [ 26/Jan/16 ] |
|
Looked at the patch with fresh eyes and I see the problem. I needed to link in libdl explicitly in the Makefile. Just tested it with --disabled-shared and normal configuration and it worked. |
| Comment by Nathaniel Clark [ 26/Jan/16 ] |
|
I reviewed patch and restarted autotest as you requested. |
| Comment by James A Simmons [ 26/Jan/16 ] |
|
Thank you. |
| Comment by Christopher Morrone [ 27/Jan/16 ] |
|
Must we do this? Do we really care that --disable-shared doesn't work? I would prefer that we stick with the simple cleaner libtool method unless there is a really, really, good reason to need a static build. |
| Comment by James A Simmons [ 27/Jan/16 ] |
|
Yes due to Oleg making this a requirement for the |
| Comment by Christopher Morrone [ 27/Jan/16 ] |
|
Ah, I see. Thanks for the explanation. |
| Comment by James A Simmons [ 21/Apr/17 ] |
|
Nathaniel I updated the patch. Easy work since it mostly was done. Now if you do a --disable-shared the mount plugins will be built into the utilities. This should make Oleg happy. |
| Comment by Gerrit Updater [ 05/Aug/17 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/17581/ |