julia icon indicating copy to clipboard operation
julia copied to clipboard

Broken linkerscript, julia fails to link with modern lld versions

Open LebedevRI opened this issue 1 year ago • 2 comments

Building v1.10.3 with

$ ld -v
Debian LLD 18.1.6 (compatible with GNU linkers)

fails:

ld: error: version script assignment of 'JL_LIBJULIA_1.10' to symbol '__stack_chk_guard' failed: symbol not defined
ld: error: version script assignment of 'JL_LIBJULIA_1.10' to symbol 'asprintf' failed: symbol not defined
ld: error: version script assignment of 'JL_LIBJULIA_1.10' to symbol 'rec_backtrace' failed: symbol not defined
ld: error: version script assignment of 'JL_LIBJULIA_1.10' to symbol 'localtime_r' failed: symbol not defined
ld: error: version script assignment of 'JL_LIBJULIA_1.10' to symbol 'restore_signals' failed: symbol not defined
ld: error: version script assignment of 'JL_LIBJULIA_1.10' to symbol 'add_library_mapping' failed: symbol not defined
ld: error: version script assignment of 'JL_LIBJULIA_1.10' to symbol 'jlbacktrace' failed: symbol not defined
ld: error: version script assignment of 'JL_LIBJULIA_1.10' to symbol 'jlbacktracet' failed: symbol not defined
ld: error: version script assignment of 'JL_LIBJULIA_1.10' to symbol '_Z24jl_coverage_data_pointerN4llvm9StringRefEi' failed: symbol not defined
ld: error: version script assignment of 'JL_LIBJULIA_1.10' to symbol '_Z22jl_coverage_alloc_lineN4llvm9StringRefEi' failed: symbol not defined
ld: error: version script assignment of 'JL_LIBJULIA_1.10' to symbol '_Z22jl_malloc_data_pointerN4llvm9StringRefEi' failed: symbol not defined
ld: error: version script assignment of 'JL_LIBJULIA_1.10' to symbol 'llvmGetPassPluginInfo' failed: symbol not defined
ld: error: version script assignment of 'JL_LIBJULIA_1.10' to symbol 'environ' failed: symbol not defined
ld: error: version script assignment of 'JL_LIBJULIA_1.10' to symbol '__progname' failed: symbol not defined

LebedevRI avatar May 21 '24 14:05 LebedevRI

https://reviews.llvm.org/D135402 This was a very contentious change to lld, but I think there might be a workaround we could do like https://github.com/llvm/llvm-project/commit/fef73b81e9a742c4db61ded747c801e3717dae78, which just defines empty versions of those symbols.

gbaraldi avatar May 21 '24 14:05 gbaraldi

Locally, this workarounds the problem for me:

> cat Make.user
CFLAGS=-Wl,--undefined-version
CXXFLAGS=$(CFLAGS)

LebedevRI avatar May 21 '24 14:05 LebedevRI