This flag was introduced in ld64-609. It instructs the linker to link to
a static library while treating its symbols as if they had hidden
visibility. This is useful when building a dylib that links to static
libraries but we don't want the symbols from those to be exported.
Details
- Reviewers
thakis int3 - Group Reviewers
Restricted Project - Commits
- rG595fc59f742a: Reland "[lld-macho] Implement -load_hidden"
rG4c79e1a3f4eb: [lld-macho] Implement -load_hidden
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This is annoyingly invasive, but I can't think of a better way.
I completely agree. I've been sitting on this one for a while, hoping that I could come up with a nicer solution. We could avoid having to pass forceHidden to all the helper functions by making them methods of ObjFile, but that would be a similarly invasive diff, and the changes to the {Archive,Obj,Bitcode}File ctors would still have to stay.
We could possibly pass ArchiveFile * into the BitcodeFile and ObjFile constructors and have that take the place of archiveName + forceHidden. But that's a marginal improvement (saving one parameter in the ctors); I don't see a way around the rest of the parameter passing. I'm good with this as-is. Thanks!
Added handling for bitcode files; this will fix the bot breakage that was due to BitcodeFile::forceHidden being unused.
nit: spell out "without"