Skip to content

Set LD_LIBRARY_PATH on Linux for NIF shared library resolution#217

Merged
doawoo merged 1 commit into
burrito-elixir:mainfrom
dannote:fix/ld-library-path
Mar 11, 2026
Merged

Set LD_LIBRARY_PATH on Linux for NIF shared library resolution#217
doawoo merged 1 commit into
burrito-elixir:mainfrom
dannote:fix/ld-library-path

Conversation

@dannote

@dannote dannote commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

When using custom_erts with a glibc-linked ERTS (e.g. from builds.hex.pm), NIF .so files may depend on system shared libraries like libgcc_s.so.1. The BEAM process doesn't search standard system library paths by default, causing dlopen to fail with errors like:

Failed to load NIF library: 'Error loading shared library libgcc_s.so.1: No such file or directory'

This adds common system library paths to LD_LIBRARY_PATH on Linux so NIF shared objects can find their dependencies.

When using custom_erts with a glibc-linked ERTS (e.g. from
builds.hex.pm), NIF .so files may depend on system shared libraries
like libgcc_s.so.1. The BEAM process doesn't search standard system
library paths by default, causing dlopen to fail.

Add common system library paths to LD_LIBRARY_PATH so NIF shared
objects can find their dependencies.
@doawoo

doawoo commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

This all makes sense to me! I'll kick off CI tests, and merge after they pass

@doawoo
doawoo merged commit 8fa7eda into burrito-elixir:main Mar 11, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants