Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to disable weak linking #46

Closed
wants to merge 1 commit into from

Conversation

lkundrak
Copy link
Contributor

It's rather fragile -- the .so files provide no ABI stability whatsoever
(unlike relying on SONAMEs). This also makes it cumbersome to intergate RPM
packaging as it effectively defeats the dependency generators as no .dynsym
entries are generated.

It's rather fragile -- the .so files provide no ABI stability whatsoever
(unlike relying on SONAMEs). This also makes it cumbersome to intergate RPM
packaging as it effectively defeats the dependency generators as no .dynsym
entries are generated.
@lkundrak
Copy link
Contributor Author

Also, this generates a couple of mismatch warnings for the NO_WEAK_LINK case.

It has aleady been wrong, but the dlopen() dance effectively defeated the compiler's type checking. :(

@Cloudef
Copy link
Owner

Cloudef commented Aug 18, 2015

Better solution would be to compile plugins and link against the plugins. I wanted to avoid this to keep the library itself simple though.

@robotanarchy
Copy link

I ran into the same issue while porting wlc to Void Linux.

My workaround: Before compiling, replace all "lib*.so" strings with their correct soname by resolving the links in /usr/lib in the build environment.

echo "Replacing dynamically loaded libraries with their sonames..."
while IFS= read -r i; do
    file="$(echo $i | cut -d ':' -f 1)"
    lib="$(echo $i | cut -d '"' -f 2)"
    [ -e "/usr/lib/$lib" ] || continue
    lib_soname="$(basename $(realpath /usr/lib/$lib))"
    echo "$file: $lib -> $lib_soname"
    sed --in-place "s/\"$lib\"/\"$lib_soname\"/g" "$file"
done < <(grep -r -E '"lib.+\.so"' --only-matching src)

As an alternative to the plugins architecture, how about putting the correct sonames with CMake in a generated header file and include that headerfile where necessary?

@Cloudef
Copy link
Owner

Cloudef commented Jan 22, 2016

285ec2d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants