From: Christian Brabandt Date: Sun, 21 Jun 2026 12:34:15 +0000 (+0000) Subject: patch 9.2.0681: configure: -lruby added even for a dynamic ruby build X-Git-Tag: v9.2.0681^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6b4f97c7f60fe9e80908ceecdeb2f950356f820;p=thirdparty%2Fvim.git patch 9.2.0681: configure: -lruby added even for a dynamic ruby build Problem: configure: -lruby is added to the link flags even for a dynamic ruby build, creating a hard dependency on the Ruby library (Johannes Schindelin, after v9.2.0674). Solution: For a dynamic build filter out -l flags from librubyarg. related: #20558 Signed-off-by: Christian Brabandt --- diff --git a/src/auto/configure b/src/auto/configure index bcbeb525cc..a20eea1667 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -8613,6 +8613,12 @@ printf "%s\n" "$rubyhdrdir" >&6; } RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby_soname\\\" $RUBY_CFLAGS" RUBY_LIBS= + for arg in $librubyarg; do + case "$arg" in + -L*|-R*|-Wl,-R*|-Wl,-rpath*) RUBY_LIBS="$RUBY_LIBS $arg" ;; + esac + done + librubyarg= fi if test "X$librubyarg" != "X"; then RUBY_LIBS="$librubyarg $RUBY_LIBS" diff --git a/src/configure.ac b/src/configure.ac index bac2236988..710cb317fc 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -2162,6 +2162,16 @@ if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then AC_DEFINE(DYNAMIC_RUBY) RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby_soname\\\" $RUBY_CFLAGS" RUBY_LIBS= + dnl For dynamic Ruby keep only the library search path / runpath from + dnl librubyarg so the dlopen()ed library can be found at runtime, + dnl without adding -lruby and thus a hard dependency on the Ruby + dnl library, which would defeat dynamic loading. + for arg in $librubyarg; do + case "$arg" in + -L*|-R*|-Wl,-R*|-Wl,-rpath*) RUBY_LIBS="$RUBY_LIBS $arg" ;; + esac + done + librubyarg= fi if test "X$librubyarg" != "X"; then RUBY_LIBS="$librubyarg $RUBY_LIBS" diff --git a/src/version.c b/src/version.c index 484f7515a9..edf47e86b7 100644 --- a/src/version.c +++ b/src/version.c @@ -759,6 +759,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 681, /**/ 680, /**/