Open MrSmith33 opened 1 year ago
Oh, wild :D - are you positive that'd be a totally standalone .dylib, not depending on any Apple lib? - The direct linker command-line interface for Posix targets (ld
) isn't really tested, as it's hardly usable (=> normally linking through C (cross-)compiler instead with gcc/clang CLI). If -shared
is the only blocker for the Apple ld64
-compatible direct ld64.lld
interface (should apparently be -dylib
instead), you might get further by separating compile & link - compiling the object file(s) first, then linking via -L-dylib
etc.
It only uses a couple syscalls I think, so should be fully independent.
How should the separate link step be done? Through lld-link.exe
? Is it the same as internal linker?
I'd use LDC with -link-internally
like you already did, but removing/replacing -shared
and specifying the object file instead of the .d
source file. lld-link.exe
should be usable too, but then you need to either rename it to ld64.lld.exe
before, or use something like -flavor darwin
as first CLI option AFAIK.
results in