From 54b5bd526b6a0e6f92680e95f028c18f6860d148 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 4 Feb 2019 14:16:30 -0800 Subject: [PATCH] Fix shared library loading preference on non-x86 architectures (especially those like aarch64 which sort lexicographically ahead of "libc.conf") See https://bugs.debian.org/685706 for the upstream bug report --- 3.7-rc/ubuntu/Dockerfile | 3 +++ 3.7/ubuntu/Dockerfile | 3 +++ 3.8-rc/ubuntu/Dockerfile | 3 +++ Dockerfile-ubuntu.template | 3 +++ 4 files changed, 12 insertions(+) diff --git a/3.7-rc/ubuntu/Dockerfile b/3.7-rc/ubuntu/Dockerfile index 5c61709..d9f06d4 100644 --- a/3.7-rc/ubuntu/Dockerfile +++ b/3.7-rc/ubuntu/Dockerfile @@ -80,6 +80,9 @@ RUN set -eux; \ make install_sw install_ssldirs; \ cd ..; \ rm -rf "$OPENSSL_PATH"*; \ +# this is included in "/etc/ld.so.conf.d/libc.conf", but on arm64, it gets overshadowed by "/etc/ld.so.conf.d/aarch64-linux-gnu.conf" (vs "/etc/ld.so.conf.d/x86_64-linux-gnu.conf") so the precedence isn't correct -- we install our own file to overcome that and ensure any .so files in /usr/local/lib (especially OpenSSL's libssl.so) are preferred appropriately regardless of the target architecture +# see https://bugs.debian.org/685706 + echo '/usr/local/lib' > /etc/ld.so.conf.d/000-openssl-libc.conf; \ ldconfig; \ # use Debian's CA certificates rmdir "$OPENSSL_CONFIG_DIR/certs" "$OPENSSL_CONFIG_DIR/private"; \ diff --git a/3.7/ubuntu/Dockerfile b/3.7/ubuntu/Dockerfile index 5903c2f..5177b8e 100644 --- a/3.7/ubuntu/Dockerfile +++ b/3.7/ubuntu/Dockerfile @@ -80,6 +80,9 @@ RUN set -eux; \ make install_sw install_ssldirs; \ cd ..; \ rm -rf "$OPENSSL_PATH"*; \ +# this is included in "/etc/ld.so.conf.d/libc.conf", but on arm64, it gets overshadowed by "/etc/ld.so.conf.d/aarch64-linux-gnu.conf" (vs "/etc/ld.so.conf.d/x86_64-linux-gnu.conf") so the precedence isn't correct -- we install our own file to overcome that and ensure any .so files in /usr/local/lib (especially OpenSSL's libssl.so) are preferred appropriately regardless of the target architecture +# see https://bugs.debian.org/685706 + echo '/usr/local/lib' > /etc/ld.so.conf.d/000-openssl-libc.conf; \ ldconfig; \ # use Debian's CA certificates rmdir "$OPENSSL_CONFIG_DIR/certs" "$OPENSSL_CONFIG_DIR/private"; \ diff --git a/3.8-rc/ubuntu/Dockerfile b/3.8-rc/ubuntu/Dockerfile index d469091..48f24b4 100644 --- a/3.8-rc/ubuntu/Dockerfile +++ b/3.8-rc/ubuntu/Dockerfile @@ -80,6 +80,9 @@ RUN set -eux; \ make install_sw install_ssldirs; \ cd ..; \ rm -rf "$OPENSSL_PATH"*; \ +# this is included in "/etc/ld.so.conf.d/libc.conf", but on arm64, it gets overshadowed by "/etc/ld.so.conf.d/aarch64-linux-gnu.conf" (vs "/etc/ld.so.conf.d/x86_64-linux-gnu.conf") so the precedence isn't correct -- we install our own file to overcome that and ensure any .so files in /usr/local/lib (especially OpenSSL's libssl.so) are preferred appropriately regardless of the target architecture +# see https://bugs.debian.org/685706 + echo '/usr/local/lib' > /etc/ld.so.conf.d/000-openssl-libc.conf; \ ldconfig; \ # use Debian's CA certificates rmdir "$OPENSSL_CONFIG_DIR/certs" "$OPENSSL_CONFIG_DIR/private"; \ diff --git a/Dockerfile-ubuntu.template b/Dockerfile-ubuntu.template index 6292ebb..9094b4f 100644 --- a/Dockerfile-ubuntu.template +++ b/Dockerfile-ubuntu.template @@ -80,6 +80,9 @@ RUN set -eux; \ make install_sw install_ssldirs; \ cd ..; \ rm -rf "$OPENSSL_PATH"*; \ +# this is included in "/etc/ld.so.conf.d/libc.conf", but on arm64, it gets overshadowed by "/etc/ld.so.conf.d/aarch64-linux-gnu.conf" (vs "/etc/ld.so.conf.d/x86_64-linux-gnu.conf") so the precedence isn't correct -- we install our own file to overcome that and ensure any .so files in /usr/local/lib (especially OpenSSL's libssl.so) are preferred appropriately regardless of the target architecture +# see https://bugs.debian.org/685706 + echo '/usr/local/lib' > /etc/ld.so.conf.d/000-openssl-libc.conf; \ ldconfig; \ # use Debian's CA certificates rmdir "$OPENSSL_CONFIG_DIR/certs" "$OPENSSL_CONFIG_DIR/private"; \