Skip to content

Conversation

alexezeder
Copy link
Contributor

@alexezeder alexezeder commented May 2, 2021

Fixes #75

Without this fix I have to have a derived image with:

RUN rm /etc/ld.so.conf.d/local-lib64.conf && sed -i '1s/^/\/usr\/local\/lib64\n/' /etc/ld.so.conf && ldconfig

which gives me the correct order of libstdc++:

$ ldconfig -p | grep libstdc++
        libstdc++.so.6 (libc6,AArch64) => /usr/local/lib64/libstdc++.so.6
        libstdc++.so.6 (libc6,AArch64) => /usr/lib/aarch64-linux-gnu/libstdc++.so.6
        libstdc++.so (libc6,AArch64) => /usr/local/lib64/libstdc++.so

# gcc installs .so files in /usr/local/lib64...
RUN set -ex; \
echo '/usr/local/lib64' > /etc/ld.so.conf.d/local-lib64.conf; \
sed -i '1s/^/\/usr\/local\/lib64\n/' /etc/ld.so.conf; \
Copy link
Member

@tianon tianon May 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoa, great catch -- however, I don't think we need to get quite this complicated. It should be enough for us to rename local-lib64.conf to something that sorts above aarch64 (and any other architecture string), so this should be enough:

Suggested change
sed -i '1s/^/\/usr\/local\/lib64\n/' /etc/ld.so.conf; \
echo '/usr/local/lib64' > /etc/ld.so.conf.d/000-local-lib64.conf; \

(This also made me realize this is probably broken completely on 32bit architectures like arm32v7, but I think that's something we should solve separately. 😄 32bit are not "broken" but are also not fine since arm- sorts above the filename that includes /usr/local/lib so we probably should get explicit there too for the same reason 😄)

by moving the GCC installs path config to a higher sorting filename (since /etc/ld.so.conf.d may contain architecture-specific *.conf files and these files are otherwise parsed first because of sorting)
@tianon
Copy link
Member

tianon commented May 3, 2021

Aha, https://bugs.debian.org/685706 is where I'd seen this before and couldn't find. 😄

@alexezeder
Copy link
Contributor Author

alexezeder commented May 4, 2021

Oh, you did this work for me 😉
Anyway it looks fine, hope there won't be any 000... architectures created soon...

@tianon tianon merged commit ccd1e4f into docker-library:master May 4, 2021
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request May 4, 2021
Changes:

- docker-library/gcc@ccd1e4f: Merge pull request docker-library/gcc#76 from alexezeder/fix/ldconfig
- docker-library/gcc@a5937a0: Fix ldconfig for GCC installs
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.

Wrong libstdc++.so.6 found on arm64

2 participants