Project

General

Profile

Actions

Misc #17174

closed

"Error relocating, symbol not found" error when compiling a native extension on Alpine with Ruby >=2.4

Added by Nakilon (Victor Maslov) about 4 years ago. Updated 8 months ago.

Status:
Feedback
Assignee:
-
[ruby-core:100022]
Tags:

Description

My native extension gem compiles fine with all versions of Ruby on macOS but only with Ruby 2.3 on Alpine. It throws various Error relocating, symbol not found when I require the .o file. Here I made a branch to reproduce it in Docker quickly.

git clone https://github.com/Nakilon/dhash-vips.git --branch alpine-compilation-issues alpine-compilation-issues && cd alpine-compilation-issues
# compiles and does not fail on require
docker build - -t temp-ruby2.3.8 --build-arg RUBY_VERSION=2.3.8 --build-arg ALPINE_VERSION=3.8 <Dockerfile

# Error relocating /dhash-vips/idhash.so: rb_deprecate_constant: symbol not found - /dhash-vips/idhash.so (LoadError)
docker build - -t temp-ruby2.4.10 --build-arg RUBY_VERSION=2.4.10 --build-arg ALPINE_VERSION=3.11 <Dockerfile

# Error relocating /dhash-vips/idhash.so: rb_int_modulo: symbol not found - /dhash-vips/idhash.so (LoadError)
docker build - -t temp-ruby2.5.8 --build-arg RUBY_VERSION=2.5.8 --build-arg ALPINE_VERSION=3.12 <Dockerfile

# Error relocating /dhash-vips/idhash.so: rb_int_pow: symbol not found - /dhash-vips/idhash.so (LoadError)
docker build - -t temp-ruby2.6.6 --build-arg RUBY_VERSION=2.6.6 --build-arg ALPINE_VERSION=3.12 <Dockerfile

I wanted to ask in the Mailing List but for some reason my email didn't reach it. Guy on Freenode recommended to post here.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0