From 52b38be766130adaa2107914c582e7181be53a31 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Mon, 2 Jan 2023 16:18:38 -0500 Subject: [PATCH 1/2] test: comment out the darwin workaround to demonstrate the failing test --- test/rcd_test/ext/mri/extconf.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/rcd_test/ext/mri/extconf.rb b/test/rcd_test/ext/mri/extconf.rb index c73570e4..88223dd8 100644 --- a/test/rcd_test/ext/mri/extconf.rb +++ b/test/rcd_test/ext/mri/extconf.rb @@ -79,13 +79,15 @@ ## ## This returns us to the symbol resolution we had in previous Rubies. It feels gross but may ## be a workaround for gem maintainers until we all figure out a better way to deal with this. - extdldflags = RbConfig::MAKEFILE_CONFIG["EXTDLDFLAGS"].split - if found = extdldflags.index("-bundle_loader") - removed_1 = extdldflags.delete_at(found) # flag - removed_2 = extdldflags.delete_at(found) # and its argument - puts "Removing '#{removed_1} #{removed_2}' from EXTDLDFLAGS" - end - RbConfig::MAKEFILE_CONFIG["EXTDLDFLAGS"] = extdldflags.join(" ") + # + # extdldflags = RbConfig::MAKEFILE_CONFIG["EXTDLDFLAGS"].split + # if found = extdldflags.index("-bundle_loader") + # removed_1 = extdldflags.delete_at(found) # flag + # removed_2 = extdldflags.delete_at(found) # and its argument + # puts "Removing '#{removed_1} #{removed_2}' from EXTDLDFLAGS" + # end + # RbConfig::MAKEFILE_CONFIG["EXTDLDFLAGS"] = extdldflags.join(" ") + # end end From 0328204a105e1a5aa2fcec0cf0071bde99cc06ac Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Mon, 2 Jan 2023 16:20:15 -0500 Subject: [PATCH 2/2] ext: work around darwin symbol resolution changes in ruby 3.2 https://github.com/rake-compiler/rake-compiler-dock/issues/87 --- Dockerfile.mri.erb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Dockerfile.mri.erb b/Dockerfile.mri.erb index f3c06543..9d5f4dda 100644 --- a/Dockerfile.mri.erb +++ b/Dockerfile.mri.erb @@ -190,6 +190,15 @@ RUN find /usr/local/rake-compiler/ruby -name rbconfig.rb | while read f ; do sed RUN find /usr/local/rake-compiler/ruby -name lib*-ruby*.dll.a | while read f ; do n=`echo $f | sed s/.dll//` ; mv $f $n ; done <% end %> +# ruby-2.5 links to libcrypt, which isn't necessary for extensions +RUN find /usr/local/rake-compiler/ruby -name rbconfig.rb | while read f ; do sed -i 's/-lcrypt//' $f ; done + +<% if platform=~/darwin/ %> +# ruby-3.2 on darwin links with `-bundle_loader`, see https://github.com/rake-compiler/rake-compiler-dock/issues/87 +RUN find /usr/local/rake-compiler/ruby/*/*/lib/ruby/3.2.0 -name rbconfig.rb | \ + while read f ; do sed -i 's/\["EXTDLDFLAGS"\] = "/&-Wl,-flat_namespace /' $f ; done +<% end %> + ## ## Final adjustments ## @@ -218,9 +227,6 @@ RUN echo "export PATH=\$DEVTOOLSET_ROOTPATH/usr/bin:\$PATH" >> /etc/rubybashrc # Add prefixed versions of compiler tools RUN for f in addr2line gcc gcov-tool ranlib ar dwp gcc-ranlib nm readelf as elfedit gcc-ar gprof objcopy size c++filt g++ gcov ld objdump strings cpp gcc-nm pkg-config strip ; do ln -sf $DEVTOOLSET_ROOTPATH/usr/bin/$f $DEVTOOLSET_ROOTPATH/usr/bin/<%= target %>-$f ; done -# ruby-2.5 links to libcrypt, which isn't necessary for extensions -RUN find /usr/local/rake-compiler/ruby -name rbconfig.rb | while read f ; do sed -i 's/-lcrypt//' $f ; done - # Use builtin functions of newer gcc to avoid linker issues on Musl based Linux COPY build/math_h.patch /root/ RUN cd /usr/include/ && \