Skip to content

[dynlink] Toolchain dynamic-executable mode (clang driver) #10

Description

@ppenna

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions