emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.35k stars 3.25k forks source link

Has ldinfo.c been intentionally excluded from libc? #22159

Open allsey87 opened 2 days ago

allsey87 commented 2 days ago

Perhaps this is intentional, however, I noticed today that only a subset of the files under system/lib/libc/musl/src/ldso/ are being built here: tools/system_libs.py#L1248.

In particular, it seems that the lack of dlinfo.c in that list is the cause of the following link error when building rcutils:

error: undefined symbol: dlinfo (referenced by root reference (e.g. compiled C/C++ code))
warning: To disable errors for undefined symbols use `-sERROR_ON_UNDEFINED_SYMBOLS=0`
warning: _dlinfo may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
Error: Aborting compilation due to previous errors
sbc100 commented 23 hours ago

We don't currently support dlinfo I'm afraid.

It would need to be added to system/lib/libc/dynlink.c since we don't share dlopen code with musl.

The simplest thing to do is probably to add && !defined(__EMSCRIPTEN__) to this line https://github.com/ros2/rcutils/blob/rolling/src/shared_library.c#L130C1-L130C69