Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a0cbb41

Browse files
committedNov 20, 2024··
Use all lib artifacts when checking symbols
Previously, we generated the defined and undefined symbol lists from different sets of `sysroot/lib` artifacts. This uses all static artifacts that are built, `*.a` and `*.o`, to increase coverage of the symbols wasi-libc is publishing.
1 parent 2ef2881 commit a0cbb41

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed
 

‎Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ install: finish
934934
$(SYSROOT_SHARE)/defined-symbols.txt: startup_files libc
935935
mkdir -p "$(SYSROOT_SHARE)"
936936
"$(NM)" --defined-only \
937-
$(SYSROOT_LIB)/libc.a $(SYSROOT_LIB)/libwasi-emulated-*.a $(SYSROOT_LIB)/*.o \
937+
$(SYSROOT_LIB)/*.a $(SYSROOT_LIB)/*.o \
938938
|grep ' [[:upper:]] ' \
939939
|sed 's/.* [[:upper:]] //' \
940940
|LC_ALL=C sort \
@@ -946,7 +946,7 @@ $(SYSROOT_SHARE)/undefined-symbols.txt: $(SYSROOT_SHARE)/defined-symbols.txt
946946
@# LLVM PR40497, which is fixed in 9.0, but not in 8.0.
947947
@# Ignore certain llvm builtin symbols such as those starting with __mul
948948
@# since these dependencies can vary between llvm versions.
949-
for undef_sym in $$("$(NM)" --undefined-only $(SYSROOT_LIB)/libc.a $(SYSROOT_LIB)/libc-*.a $(SYSROOT_LIB)/*.o |grep ' U ' |sed 's/.* U //' |LC_ALL=C sort |uniq); do \
949+
for undef_sym in $$("$(NM)" --undefined-only $(SYSROOT_LIB)/*.a $(SYSROOT_LIB)/*.o |grep ' U ' |sed 's/.* U //' |LC_ALL=C sort |uniq); do \
950950
grep -q '\<'$$undef_sym'\>' "$<" || echo $$undef_sym; \
951951
done | grep -E -v "^__mul|__memory_base|__indirect_function_table|__tls_base" > "$@"
952952

‎expected/wasm32-wasip1-threads/defined-symbols.txt

+8
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ __atexit_lockptr
2020
__c_dot_utf8
2121
__c_dot_utf8_locale
2222
__c_locale
23+
__c_longjmp
2324
__clock
2425
__clock_gettime
2526
__clock_nanosleep
@@ -402,6 +403,9 @@ __wasilibc_tell
402403
__wasilibc_unlinkat
403404
__wasilibc_utimens
404405
__wasm_call_dtors
406+
__wasm_longjmp
407+
__wasm_setjmp
408+
__wasm_setjmp_test
405409
__wcscoll_l
406410
__wcsftime_l
407411
__wcsxfrm_l
@@ -575,6 +579,10 @@ difftime
575579
dirfd
576580
dirname
577581
div
582+
dlclose
583+
dlerror
584+
dlopen
585+
dlsym
578586
dprintf
579587
drand48
580588
drem

‎expected/wasm32-wasip1/defined-symbols.txt

+8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ __assert_fail
1717
__c_dot_utf8
1818
__c_dot_utf8_locale
1919
__c_locale
20+
__c_longjmp
2021
__clock
2122
__clock_gettime
2223
__clock_nanosleep
@@ -373,6 +374,9 @@ __wasilibc_tell
373374
__wasilibc_unlinkat
374375
__wasilibc_utimens
375376
__wasm_call_dtors
377+
__wasm_longjmp
378+
__wasm_setjmp
379+
__wasm_setjmp_test
376380
__wcscoll_l
377381
__wcsftime_l
378382
__wcsxfrm_l
@@ -546,6 +550,10 @@ difftime
546550
dirfd
547551
dirname
548552
div
553+
dlclose
554+
dlerror
555+
dlopen
556+
dlsym
549557
dprintf
550558
drand48
551559
drem

‎expected/wasm32-wasip2/defined-symbols.txt

+8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ __assert_fail
1818
__c_dot_utf8
1919
__c_dot_utf8_locale
2020
__c_locale
21+
__c_longjmp
2122
__clock
2223
__clock_gettime
2324
__clock_nanosleep
@@ -389,6 +390,9 @@ __wasilibc_tell
389390
__wasilibc_unlinkat
390391
__wasilibc_utimens
391392
__wasm_call_dtors
393+
__wasm_longjmp
394+
__wasm_setjmp
395+
__wasm_setjmp_test
392396
__wcscoll_l
393397
__wcsftime_l
394398
__wcsxfrm_l
@@ -568,6 +572,10 @@ difftime
568572
dirfd
569573
dirname
570574
div
575+
dlclose
576+
dlerror
577+
dlopen
578+
dlsym
571579
dprintf
572580
drand48
573581
drem

0 commit comments

Comments
 (0)
Please sign in to comment.