Skip to content

Commit 0328204

Browse files
committed
ext: work around darwin symbol resolution changes in ruby 3.2
#87
1 parent 52b38be commit 0328204

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Dockerfile.mri.erb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,15 @@ RUN find /usr/local/rake-compiler/ruby -name rbconfig.rb | while read f ; do sed
190190
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
191191
<% end %>
192192

193+
# ruby-2.5 links to libcrypt, which isn't necessary for extensions
194+
RUN find /usr/local/rake-compiler/ruby -name rbconfig.rb | while read f ; do sed -i 's/-lcrypt//' $f ; done
195+
196+
<% if platform=~/darwin/ %>
197+
# ruby-3.2 on darwin links with `-bundle_loader`, see https://github.com/rake-compiler/rake-compiler-dock/issues/87
198+
RUN find /usr/local/rake-compiler/ruby/*/*/lib/ruby/3.2.0 -name rbconfig.rb | \
199+
while read f ; do sed -i 's/\["EXTDLDFLAGS"\] = "/&-Wl,-flat_namespace /' $f ; done
200+
<% end %>
201+
193202
##
194203
## Final adjustments
195204
##
@@ -218,9 +227,6 @@ RUN echo "export PATH=\$DEVTOOLSET_ROOTPATH/usr/bin:\$PATH" >> /etc/rubybashrc
218227
# Add prefixed versions of compiler tools
219228
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
220229

221-
# ruby-2.5 links to libcrypt, which isn't necessary for extensions
222-
RUN find /usr/local/rake-compiler/ruby -name rbconfig.rb | while read f ; do sed -i 's/-lcrypt//' $f ; done
223-
224230
# Use builtin functions of newer gcc to avoid linker issues on Musl based Linux
225231
COPY build/math_h.patch /root/
226232
RUN cd /usr/include/ && \

0 commit comments

Comments
 (0)