问题
The distribution glibc version is 2.11.3. I compiled the version 2.22 into /usr/glibc/.
Running make for a new curl version 7.46 I receive this errors:
/usr/glibc/lib/libpthread.so.0: undefined reference to `__mktemp@GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__tfind@GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__tdelete@GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__twalk@GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__call_tls_dtors@GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__madvise@GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `memcpy@GLIBC_2.14'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__getrlimit@GLIBC_PRIVATE'
/usr/glibc/lib/libresolv.so.2: undefined reference to `__sendmmsg@GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__ctype_init@GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__h_errno@GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__tsearch@GLIBC_PRIVATE'
/usr/glibc/lib/libpthread.so.0: undefined reference to `__libc_vfork@GLIBC_PRIVATE'
I am convinced it must be a problem because of the new glibc version but my linux knowledge is too weak to provide the correct path to the new glibc version.
What am I doing wrong? Thx!
回答1:
There were several issues:
glibc2.22 - distribution version is 2.11.3openssl1.0.2f - distribution version is 0.9.8j [from 2009!]curl7.46.0 - distribution version is 7.19.7libmemcachedwith activesaslversion from distribution
I am using all these libraries in my CUDA project and due the fact I wanted to update all these libraries to the newest version these steps were to do:
glibc: build into/usr/glibcopenssl: build into/usr/glibc/openssl-curl/. Before runexport $LDFLAGS=-L/usr/glibc/libcurl: run./configure --prefix=/usr/glibc/openssl-curl/ --with-ssl=/usr/glibc/openssl-curl/ --disable-ldap- very important:$LDFLAGSmust be empty when runningconfigurebecause the script adds the value to$LD_LIBRARY_PATHand due the version mismatch of the newglibcand the distribution version all programs crash withsegmentation fault. Beforemakerun againexport $LDFLAGS=-L/usr/glibc/lib.- For my project I had also to rebuild
libmemcachedwith the newglibcversion with this command:./configure --prefix=/usr/local/libmemcached --disable-sasl
In CUDA I have to set the path to the new libraries and now all works. It is also very important the linker options -Wl,--rpath=/usr/glibc/lib and -Wl,--dynamic-linker=/usr/glibc/lib/ld-linux-x86-64.so.2 are set in order the new glibc version is loaded.
For my linux system I must not add in /etc/ld.so.conf the path /usr/glibc/lib otherwise the whole system crashes.
来源:https://stackoverflow.com/questions/35096912/make-curl-with-different-glibc-version-unresolved-glibc-private