Replace libltdl with POSIX dlopen for module loading#4
Open
Conversation
63ebb53 to
523a89b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor summary
libltdl(lt_dlopen and friends) with POSIXdlopenfrom <dlfcn.h> for module loadinglibltdlsubproject dependency from the build systemAC_CHECK_LIB([dl], [dlopen])to detect-ldlon platforms that need it (Linux)Changes
lt_dlopen/lt_dlsym/lt_dlerror/lt_dlclosewithdlopen/dlsym/dlerror/dlclose, removelt_dlinit()call<ltdl.h>with<dlfcn.h>LT_CONFIG_LTDL_DIR,LTDL_INIT, andLTDL_SUBDIRblock; addAC_CHECK_LIB([dl], [dlopen])@LTDL_SUBDIR@fromSUBDIRS, remove$(LIBLTDL)from link flags$(LTDLINCL), replace$(LIBLTDL)with-ldl$(LTDLINCL)Test plan
autoreconf -fiand./configurecomplete without errorsmake clean && make -j$(nproc)compiles successfullymake installand ircd-ratbox runsNote
dlopenis called withRTLD_LAZY, which defers symbol resolution until each symbol is first used. This matches the default behavior oflt_dlopen. The alternative isRTLD_NOW, which resolves all symbols at load time — this would cause module loading to fail immediately if any symbol is missing, but adds unnecessary startup cost since modules may not use all their symbols in every code path.Next steps
libltdl/directory from the repositorylibltdl/config/toconfig/and m4 macros fromlibltdl/m4/tom4/AC_CONFIG_AUX_DIRandAC_CONFIG_MACRO_DIRinconfigure.acto point to the new locationsautoreconf -fito regenerateconfigure,aclocal.m4,Makefile.in, andsetup.h.in