Skip to content

Simplify macOS linking by using clang as linker driver - formatted - #72

Merged
arpadbuermen merged 2 commits into
masterfrom
verley-macos
Feb 26, 2026
Merged

Simplify macOS linking by using clang as linker driver - formatted#72
arpadbuermen merged 2 commits into
masterfrom
verley-macos

Conversation

@arpadbuermen

Copy link
Copy Markdown
Collaborator

No description provided.

TBird2001 and others added 2 commits February 24, 2026 14:21
The existing macOS linker configuration passed raw ld64 flags that don't
work when using clang as the linker driver. This simplifies macOS linking
by using clang, which automatically handles SDK detection, system library
linking, and architecture flags.

Changes:
- Use clang instead of ld/ld64.lld on macOS
- Change -dylib to -dynamiclib (clang syntax)
- Remove manual -syslibroot and -platform_version flags (clang handles these)
- Simplify target specs to only pass -Wl,-undefined,dynamic_lookup
- Add build.rs to embed LLVM library rpath for runtime linking
- Add MacPorts installation instructions to configure script

Tested on macOS with MacPorts LLVM 18 and 21 on Apple Silicon (M1).
@arpadbuermen
arpadbuermen merged commit 2e06643 into master Feb 26, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants