Skip to content

Commit ebcb7e9

Browse files
Zentrikararslan
authored andcommitted
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 <[email protected]> (cherry picked from commit d269d7d)
1 parent 5595d20 commit ebcb7e9

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

src/julia.expmap.in

+19-19
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,41 @@
22
global:
33
pthread*;
44
__stack_chk_guard;
5-
asprintf;
5+
asprintf*;
66
bitvector_*;
77
ios_*;
88
arraylist_grow;
99
small_arraylist_grow;
1010
jl_*;
1111
ijl_*;
1212
_jl_mutex_*;
13-
rec_backtrace;
13+
rec_backtrace*;
1414
julia_*;
15-
libsupport_init;
16-
localtime_r;
17-
memhash;
18-
memhash32;
19-
memhash32_seed;
20-
memhash_seed;
21-
restore_signals;
15+
libsupport_init*;
16+
localtime_r*;
17+
memhash*;
18+
memhash32*;
19+
memhash32_seed*;
20+
memhash_seed*;
21+
restore_signals*;
2222
u8_*;
2323
uv_*;
24-
add_library_mapping;
24+
add_library_mapping*;
2525
utf8proc_*;
26-
jlbacktrace;
27-
jlbacktracet;
28-
_IO_stdin_used;
29-
_Z24jl_coverage_data_pointerN4llvm9StringRefEi;
30-
_Z22jl_coverage_alloc_lineN4llvm9StringRefEi;
31-
_Z22jl_malloc_data_pointerN4llvm9StringRefEi;
26+
jlbacktrace*;
27+
jlbacktracet*;
28+
_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 */
29+
_Z24jl_coverage_data_pointerN4llvm9StringRefEi*;
30+
_Z22jl_coverage_alloc_lineN4llvm9StringRefEi*;
31+
_Z22jl_malloc_data_pointerN4llvm9StringRefEi*;
3232
_jl_timing_*;
3333
LLVMExtra*;
3434
JLJIT*;
35-
llvmGetPassPluginInfo;
35+
llvmGetPassPluginInfo*;
3636

3737
/* freebsd */
38-
environ;
39-
__progname;
38+
environ*;
39+
__progname*;
4040

4141
local:
4242
*;

0 commit comments

Comments
 (0)