Skip to content

Commit d269d7d

Browse files
authored
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]>
1 parent 10f294b commit d269d7d

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

Make.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,7 @@ ifeq (,$(findstring aarch64,$(ARCH)))
14701470
OSLIBS += -lgcc_s
14711471
endif
14721472

1473-
OSLIBS += -Wl,--export-dynamic -Wl,--undefined-version -Wl,--version-script=$(BUILDROOT)/src/julia.expmap \
1473+
OSLIBS += -Wl,--export-dynamic -Wl,--version-script=$(BUILDROOT)/src/julia.expmap \
14741474
$(NO_WHOLE_ARCHIVE)
14751475
endif
14761476

src/julia.expmap.in

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,41 @@
22
global:
33
pthread*;
44
__stack_chk_*;
5-
asprintf;
5+
asprintf*;
66
bitvector_*;
77
ios_*;
88
arraylist_*;
99
small_arraylist_*;
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)