You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An object can carry a .deplibs section (SHT_LLVM_DEPENDENT_LIBRARIES, type 0x6fff4c04): NUL-separated library specifiers that clang emits for #pragma comment(lib, "m") on ELF. ld.lld links them by default. reld references the section type nowhere, so a native link of such an object silently drops the dependency and then fails with an undefined symbol the user never asked to resolve by hand — or, worse, links against something else of the same name that happens to be on the line. #123 lists it as not referenced | honored by default.
Scope
While loading inputs, read every SHT_LLVM_DEPENDENT_LIBRARIES section and add each specifier as a library input, with lld's semantics: try the specifier as a path relative to the library search directories first, then as -l<spec>. Match lld's behaviour for duplicates and for a specifier that cannot be found (check lld's ELF/InputFiles.cpp / Driver.cpp handling of DependentLibraries and record what it does in the code).
Match lld's --no-dependent-libraries flag if it is cheap to add; otherwise note it as a follow-up.
args.rs, args/*.rs, bridge.rs and lib.rs are being changed by other sub-issues in flight; if this genuinely needs one of them, say so rather than editing it.
Acceptance
deplibs_are_linked: the fixture links natively without -lm and runs, and fails without this change.
Activity
feat(core): honor .deplibs (SHT_LLVM_DEPENDENT_LIBRARIES) natively (#180