Comments (7)
Interesting! Yeah this can be fixed
from zld.
@rmaz you think that the explanation in the Xcode 11 release notes was incorrect? Because I'd like to just copy whatever they did for parity, so even if force loading everything is unnecessary, I'd rather be just as unnecessary as Xcode 11's ld
is
from zld.
Simplest IMO would be extending the -ObjC
code to also check for Swift symbols. The other option would be to first do a pass over the entire archive looking for a Swift symbol to mark the archive as force loadable, but it seemed a little wasteful to do multiple passes for every archive. Thoughts?
from zld.
Yeah multiple passes seems reasonable. What confuses me is that it says, "Static libraries are now always force-loaded in their entirety during linking". However, when I build a mixed ObjC/Swift static lib, and one of the files is an ObjC category (so it would cause issues unless it's been force loaded), it fails to include it. So it seems like, despite what the release notes say, it probably only forcibly includes at the object file level and not at the static library level. But I've asked for clarification in that swift.org ticket
from zld.
s/multiple passes/avoiding multiple passes/
from zld.
So it seems like, despite what the release notes say, it probably only forcibly includes at the object file level and not at the static library level.
That was my suspicion too, but I have not closely verified. I know it is not doing force_load
on all static libraries as our application would be unlinkable in that case. I can confirm that extending the ObjC code path to include Swift symbols works for our code. If you're fine with this approach I can put up a PR tomorrow.
from zld.
Sure, that'd be great! I can run unit tests on my end, and maybe some perf ones too
from zld.
Related Issues (20)
- support CommandLineTools users HOT 4
- Failed to make tbb_staticlib on M1. HOT 1
- Can't run zld from releases HOT 3
- Not working with Xcode 13.3 HOT 3
- DOCS: Note that the full Xcode installation is required, xcode CLI is not enough HOT 3
- Library not loaded: @rpath/libLTO.dylib - Reason: image not found HOT 3
- falied to build on mac HOT 2
- Xcode required vs command line tools? HOT 2
- Killed: 9 (SIGKILL) on M1 Mac HOT 1
- The Future of zld [RFC] HOT 5
- Xcode 14 beta. Can not Not link _objc_msgSend HOT 12
- Xcode 14/MacOs 13 installation failure HOT 5
- not fast HOT 9
- Build commands failed M1 Mac HOT 2
- Unable to use Linker on Rust and M1 Pro Mac HOT 1
- Comparison with mold/sold HOT 1
- Xcode14.2 MacOS Ventura 13.1 have BUG HOT 2
- Installing from homebrew on M1 Mac Pro fails HOT 2
- Unable to install through Homebrew HOT 1
- Build failed through homebrew HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zld.