From ebcb7e9a4bf81078f053e64b3a1f8c95f72c7837 Mon Sep 17 00:00:00 2001 From: Zentrik Date: Wed, 11 Dec 2024 08:31:11 +0000 Subject: [PATCH 1/3] Fix undefined symbol error in version script (#55363) lld 17 and above by default error if symbols listed in the version script are undefined. Julia has a few of these, as some symbols are defined conditionally in Julia (e.g. based on OS), others perhaps have been removed from Julia and other seem to be defined in other libraries. Further the version script is used in linking three times, each time linking together different objects and so having different symbols defined. Adding `-Wl,--undefined-version` is not a great solution as passing that to ld < 2.40 errors and there doesn't seem to be a great way to check if a linker supports this flag. I don't know how to get around these errors for symbols like `_IO_stdin_used` which Julia doesn't define and it seems to matter whether or not they are exported, see https://libc-alpha.sourceware.narkive.com/SevIQmU3/io-stdin-used-stripped-by-version-scripts. So I've converted all undefined symbols into wildcards to work around the error. Fixes #50414, fixes #54533 and replaces #55319. --------- Co-authored-by: Zentrik (cherry picked from commit d269d7d375827a0279dc1fee7bb24c9418f06f03) --- src/julia.expmap.in | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/julia.expmap.in b/src/julia.expmap.in index 213d087fdc2ad..a9f5eb231aea0 100644 --- a/src/julia.expmap.in +++ b/src/julia.expmap.in @@ -2,7 +2,7 @@ global: pthread*; __stack_chk_guard; - asprintf; + asprintf*; bitvector_*; ios_*; arraylist_grow; @@ -10,33 +10,33 @@ jl_*; ijl_*; _jl_mutex_*; - rec_backtrace; + rec_backtrace*; julia_*; - libsupport_init; - localtime_r; - memhash; - memhash32; - memhash32_seed; - memhash_seed; - restore_signals; + libsupport_init*; + localtime_r*; + memhash*; + memhash32*; + memhash32_seed*; + memhash_seed*; + restore_signals*; u8_*; uv_*; - add_library_mapping; + add_library_mapping*; utf8proc_*; - jlbacktrace; - jlbacktracet; - _IO_stdin_used; - _Z24jl_coverage_data_pointerN4llvm9StringRefEi; - _Z22jl_coverage_alloc_lineN4llvm9StringRefEi; - _Z22jl_malloc_data_pointerN4llvm9StringRefEi; + jlbacktrace*; + jlbacktracet*; + _IO_stdin_used*; /* glibc expects this to be exported to detect which version of glibc is being used, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634261#109 for further details */ + _Z24jl_coverage_data_pointerN4llvm9StringRefEi*; + _Z22jl_coverage_alloc_lineN4llvm9StringRefEi*; + _Z22jl_malloc_data_pointerN4llvm9StringRefEi*; _jl_timing_*; LLVMExtra*; JLJIT*; - llvmGetPassPluginInfo; + llvmGetPassPluginInfo*; /* freebsd */ - environ; - __progname; + environ*; + __progname*; local: *; From 22183ef652fdb8778e69a6b9066865ce8104cc56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Tue, 15 Apr 2025 12:22:22 -0700 Subject: [PATCH 2/3] [src] Fix arraylist and small_arraylist symbols in expmap (Cherry-picked from PR #57874) --- src/julia.expmap.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/julia.expmap.in b/src/julia.expmap.in index a9f5eb231aea0..3190c0d5626e6 100644 --- a/src/julia.expmap.in +++ b/src/julia.expmap.in @@ -5,8 +5,8 @@ asprintf*; bitvector_*; ios_*; - arraylist_grow; - small_arraylist_grow; + arraylist_*; + small_arraylist_*; jl_*; ijl_*; _jl_mutex_*; From 678c448184bb081250a76f12d5e132e924e58691 Mon Sep 17 00:00:00 2001 From: Sebastien Marie Date: Tue, 15 Apr 2025 12:26:38 -0700 Subject: [PATCH 3/3] Fix `__stack_chk_guard` entry in version script (Cherry-picked from PR #53633) --- src/julia.expmap.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/julia.expmap.in b/src/julia.expmap.in index 3190c0d5626e6..b28a714e75f69 100644 --- a/src/julia.expmap.in +++ b/src/julia.expmap.in @@ -1,7 +1,7 @@ @JULIA_SHLIB_SYMBOL_VERSION@ { global: pthread*; - __stack_chk_guard; + __stack_chk_*; asprintf*; bitvector_*; ios_*;