sgerrand / alpine-pkg-glibc

A glibc compatibility layer package for Alpine Linux
2.05k stars 280 forks source link

ldconfig -p fails #78

Closed mviereck closed 6 years ago

mviereck commented 6 years ago

Hello!

I found that /sbin/ldconfig -p and /sbin/ldconfig --print-cache fails in alpine with your glibc. In debian manpage I read:

-p, --print-cache
      Print the lists of directories and candidate libraries stored in the current cache.

Though, I am not sure if here is the right place to ask. Maybe I should rather ask at musl libc or at alpine developers.

Background: I try to install proprietary NVIDIA drivers in alpine docker images. They are based on glibc and closed source. I get two errors while installing nvidia driver, maybe building up on each other, maybe independent:

Illegal option -p
[...]
ERROR: Failed to execute `/sbin/ldconfig`: 

The installation succeeds otherwise. Executing glxinfo afterwards gives me:

Error relocating /usr/lib/libGLX.so.0: __strtok_r: symbol not found

Output of ldd libGLX.so.0:

/usr/lib # ls -l | grep GLX.so
lrwxrwxrwx    1 root     root            11 Apr 29 12:59 libGLX.so -> libGLX.so.0
-rwxr-xr-x    1 root     root         65168 Apr 29 12:59 libGLX.so.0
/usr/lib # ldd libGLX.so.0
    ldd (0x7f3306497000)
    libdl.so.2 => ldd (0x7f3306497000)
    libX11.so.6 => /usr/lib/libX11.so.6 (0x7f3305f44000)
    libXext.so.6 => /usr/lib/libXext.so.6 (0x7f3305d34000)
    libGLdispatch.so.0 => /usr/lib/libGLdispatch.so.0 (0x7f3305a66000)
    libc.so.6 => ldd (0x7f3306497000)
    libxcb.so.1 => /usr/lib/libxcb.so.1 (0x7f3305840000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0x7f330563d000)
    libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x7f3305437000)
    libbsd.so.0 => /usr/lib/libbsd.so.0 (0x7f3305225000)
Error relocating libGLX.so.0: __strtok_r: symbol not found

Dockerfile to reproduce:

FROM alpine

RUN apk add --no-cache mesa-demos mesa-dri-swrast wget ca-certificates &&\
    wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub &&\
    wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.27-r0/glibc-2.27-r0.apk &&\
    apk add glibc-2.27-r0.apk

RUN wget https://us.download.nvidia.com/XFree86/Linux-x86_64/390.48/NVIDIA-Linux-x86_64-390.48.run -O /NVIDIA.run

RUN echo -e '#!/bin/sh \n\
sh /NVIDIA.run  --accept-license --no-questions --ui=none --no-kernel-module\n\
glxinfo | grep OpenGL \n\
glxgears \n\
sh \n\
' > /start ; chmod +x /start

CMD /start

I also tried with frolvlad/alpine-glibc as image base, but with same result. Also I cheeky allowed option -p in /sbin/ldconfig. That avoids the first error message, but does not help.

I hope you can give me a hint what to try next. I am not experienced in library and libc handling.

sgerrand commented 6 years ago

The error message:

Error relocating libGLX.so.0: __strtok_r: symbol not found

relates to libgcc symbols which are not provided by this package.

As for /sbin/ldconfig–this executable is also provided by a different package. The glibc based version of ldconfig provided by this package lives in /usr/glibc-compat/sbin/.

Sorry that I can't provide any further help with what you're attempting to do.

mviereck commented 6 years ago

Thanks for your response!

Sorry that I can't provide any further help with what you're attempting to do.

No problem; alpine runs fine with free nouveau drivers.

I tried to also support closed source nvidia drivers where it is possible and not too hard to set up. But if they fail on musl libc systems it is NVIDIA corporations's failure not to provide the source.

Error relocating libGLX.so.0: __strtok_r: symbol not found

Just out of curiosity: will this symbol ever be provided, or is there a reason against it?

Though, I assume glibc based closed nvidia drivers will have further issues even if this specific symbol is supported. I would not spend too much effort in workarounds for proprietary software.