These allow overriding dead_strip_dylibs.
Details
- Reviewers
int3 gkm - Group Reviewers
Restricted Project - Commits
- rG66a1ecd2cf90: [lld/mac] Implement -needed_framework, -needed_library, -needed-l
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lld/MachO/Driver.cpp | ||
---|---|---|
333–334 | why not just dylibFile->forceNeeded = isNeeded? (actually same question for forceWeakImport below... and I see we don't do that if check for explicitlyLinked above). I believe addFile() returns a new instance each time, so unconditionally setting these values should be fine |
Thanks!
lld/MachO/Driver.cpp | ||
---|---|---|
333–334 | I did it this way for consistency with forceWeakImport, but now that I think about it I think it's needed for correctness:
That's not true: It always reads the file, but it then calls addDylib() which uses the dylib cache. That's important too: -needed-lFoo -reexport-lFoo marks libFoo.dylib as both needed and reexported. (…I guess I should add a test for this.) Good point about the explicitilyLinked: I think that's wrong. If you link a dylib both explicitly (say, via an -l flag) and implicitly via LC_LINKER_COMMAND, I think the latter runs later and overwrites explicitlyLinked with false. I'll make a CL for that. |
lld/MachO/Driver.cpp | ||
---|---|---|
333–334 | ah I see. Makes sense now! |
why not just dylibFile->forceNeeded = isNeeded? (actually same question for forceWeakImport below... and I see we don't do that if check for explicitlyLinked above). I believe addFile() returns a new instance each time, so unconditionally setting these values should be fine