Skip to content

Commit fc03ad1

Browse files
committed
add -lz to the libraries linked against by mkmf's TRY_LINK
which wasn't necessary on manylinux2014 but seems to be necessary on ubuntu:20.04 (but just for intel+gnu? weird.) to resolve this error building native extensions: LD_LIBRARY_PATH=.:/usr/local/rake-compiler/ruby/x86_64-linux-gnu/ruby-3.3.0-rc1/lib "x86_64-linux-gnu-gcc -o conftest -I/usr/local/rake-compiler/ruby/x86_64-linux-gnu/ruby-3.3.0-rc1/include/ruby-3.3.0+0/x86_64-linux-gnu -I/usr/local/rake-compiler/ruby/x86_64-linux-gnu/ruby-3.3.0-rc1/include/ruby-3.3.0+0/ruby/backward -I/usr/local/rake-compiler/ruby/x86_64-linux-gnu/ruby-3.3.0-rc1/include/ruby-3.3.0+0 -I../../../../ext/mri -O1 -fno-omit-frame-pointer -fno-fast-math -fstack-protector-strong -s -fPIC conftest.c -L. -L/usr/local/rake-compiler/ruby/x86_64-linux-gnu/ruby-3.3.0-rc1/lib -Wl,-rpath,/usr/local/rake-compiler/ruby/x86_64-linux-gnu/ruby-3.3.0-rc1/lib -L. -pipe -s -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -lruby-static -lpthread -lrt -ldl -lcrypt -Wl,-rpath,/usr/local/rake-compiler/ruby/x86_64-linux-gnu/ruby-3.3.0-rc1/lib -lruby -lm -lpthread -lc" /usr/bin/ld: /usr/local/rake-compiler/ruby/x86_64-linux-gnu/ruby-3.3.0-rc1/lib/libruby-static.a(addr2line.o): in function `fill_lines': addr2line.c:(.text+0x1bc0): undefined reference to `uncompress' collect2: error: ld returned 1 exit status
1 parent e236020 commit fc03ad1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Dockerfile.mri.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ RUN bash -c " \
147147
RUN find /usr/local/rake-compiler/ruby/*linux*/ -name libruby.so | xargs rm
148148
RUN find /usr/local/rake-compiler/ruby/*linux*/ -name libruby-static.a | while read f ; do cp $f `echo $f | sed s/-static//` ; done
149149
RUN find /usr/local/rake-compiler/ruby/*linux*/ -name libruby.a | while read f ; do ar t $f | xargs ar d $f ; done
150-
RUN find /usr/local/rake-compiler/ruby/*linux*/ -name mkmf.rb | while read f ; do sed -i ':a;N;$!ba;s/TRY_LINK = [^\n]*\n[^\n]*\n[^\n]*LOCAL_LIBS)/& -lruby-static -lpthread -lrt -ldl <% if platform =~ /x86/ %> -lcrypt <% end %>/' $f ; done
150+
RUN find /usr/local/rake-compiler/ruby/*linux*/ -name mkmf.rb | while read f ; do sed -i ':a;N;$!ba;s/TRY_LINK = [^\n]*\n[^\n]*\n[^\n]*LOCAL_LIBS)/& -lruby-static -lpthread -lrt -ldl <% if platform =~ /x86/ %> -lcrypt <% if platform !~ /musl/ %> -lz <% end %> <% end %>/' $f ; done
151151
<% end %>
152152

153153
<% if platform =~ /mingw/ %>

0 commit comments

Comments
 (0)