Part of startup dynamic-linking epic (Path A: crt0 self-linker).
Goal
Let clang produce a dynamic nanvix executable that records DT_NEEDED for libc.so/libm.so, instead of static-only.
Scope (llvm-project Nanvix driver)
- Add a dynamic mode: drop
--no-dynamic-linker, emit -pie --export-dynamic, keep --hash-style=sysv.
- Make
-lc/-lm resolve to libc.so/libm.so (DT_NEEDED) rather than forcing -Bstatic.
- Keep static the default; gate dynamic behind a flag/triple.
Acceptance
clang --target=i686-unknown-nanvix (dynamic) yields ET_DYN with .dynamic + DT_NEEDED=libc.so,libm.so and .hash.
- Static path unchanged. lit driver test for dynamic flags.
Part of startup dynamic-linking epic (Path A: crt0 self-linker).
Goal
Let clang produce a dynamic nanvix executable that records DT_NEEDED for libc.so/libm.so, instead of static-only.
Scope (llvm-project Nanvix driver)
--no-dynamic-linker, emit-pie --export-dynamic, keep--hash-style=sysv.-lc/-lmresolve to libc.so/libm.so (DT_NEEDED) rather than forcing-Bstatic.Acceptance
clang --target=i686-unknown-nanvix(dynamic) yields ET_DYN with.dynamic+ DT_NEEDED=libc.so,libm.so and.hash.