-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Use of __pthread_get_minstack leads to unnecessarily strict libc6 versioned dependency on Debian #23628
Comments
Ah, this is annoying. Do you happen to know of a way that we can avoid the strict dependency while still calling (It is used as a weak symbol atm.) |
triage: I-nominated |
I guess one horrible solution would be to look up the symbol with #include <dlfcn.h>
#include <pthread.h>
#include <stdio.h>
#include <string.h>
int main()
{
pthread_attr_t attr;
pthread_attr_init(&attr);
memset(&attr, 0, sizeof(attr));
void *handle = dlopen(NULL, RTLD_LAZY);
size_t (*__pthread_get_minstack)(const pthread_attr_t *attr) =
dlsym(handle, "__pthread_get_minstack");
if (__pthread_get_minstack != NULL)
printf("%zd\n", __pthread_get_minstack(&attr));
dlclose(handle);
pthread_attr_destroy(&attr);
return 0;
} $ gcc -Wall minstack.c -ldl -lpthread -o minstack
$ ./minstack
24640
$ dpkg-shlibdeps minstack
dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory
$ cat debian/substvars
shlibs:Depends=libc6 (>= 2.4) |
andersk
added a commit
to andersk/rust
that referenced
this issue
Mar 23, 2015
Linking __pthread_get_minstack, even weakly, was causing Debian’s dpkg-shlibdeps to detect an unnecessarily strict versioned dependency on libc6. Closes rust-lang#23628. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
BTW, |
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Mar 23, 2015
Linking `__pthread_get_minstack`, even weakly, was causing Debian’s `dpkg-shlibdeps` to detect an unnecessarily strict versioned dependency on libc6. Closes rust-lang#23628.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Rust libraries gained a dependency on the private glibc symbol
__pthread_get_minstack
in #6233; it was reverted in #11331 and reinstated in #11885 (“Alright, let's merge this and then we can see how big the impact is.”). Here’s part of the impact that may not have been considered:The Debian package build system includes a tool
dpkg-shlibdeps
that scans all binaries and libraries to be included in a package to infer dependency information for shared libraries. Based on the symbol information in/var/lib/dpkg/info/libc6:amd64.symbols
, the use of__pthread_get_minstack@GLIBC_PRIVATE
is translated into a strict versioned dependency on the exact version of libc6 that the package was built against:What this means in practice is that a Debian package containing threaded Rust code built on one release of Debian or Ubuntu will not be installable on any other release. Trying to upgrade to a new release while such a package is installed will cause dependency errors.
(What caused me to notice this problem is that the
rust-nightly
package for Ubuntu 14.10 in ppa:hansjorg/rust is no longer installable on Ubuntu 15.04 after a libc6 upgrade.)The text was updated successfully, but these errors were encountered: