From 5aa555e5bf3f973a273ec3ea33974cd620d31a44 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Thu, 3 Feb 2022 16:36:18 -0800 Subject: [PATCH] Ensure jemalloc is always linked with ruby binary Debian bullseye changed the linker defaults to use `--as-needed`, which breaks when `--enable-shared` and `--with-jemalloc` are used. In preparation for updating to bullseye, define `LDFLAGS` with `--no-as-needed` so that jemalloc will be properly used. This mirrors the CNG change in https://gitlab.com/gitlab-org/build/CNG/-/merge_requests/884. Relates to https://bugs.ruby-lang.org/issues/18409 --- scripts/install-ruby | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install-ruby b/scripts/install-ruby index b08ff9d..15dedb2 100755 --- a/scripts/install-ruby +++ b/scripts/install-ruby @@ -55,6 +55,8 @@ if [[ -d "/patches/ruby/$RUBY_VERSION" ]]; then fi # Compile +# This is needed for Ruby < 3.1 on Debian bullseye: https://bugs.ruby-lang.org/issues/18409 +export LDFLAGS="-Wl,--no-as-needed" cflags="-fno-omit-frame-pointer" ./configure --enable-shared --with-jemalloc --disable-install-doc --disable-install-rdoc --disable-install-capi make install -j $(nproc)