Coder Social home page Coder Social logo

Comments (7)

michaeleisel avatar michaeleisel commented on June 5, 2024

Interesting! Yeah this can be fixed

from zld.

michaeleisel avatar michaeleisel commented on June 5, 2024

@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.

rmaz avatar rmaz commented on June 5, 2024

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.

michaeleisel avatar michaeleisel commented on June 5, 2024

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.

michaeleisel avatar michaeleisel commented on June 5, 2024

s/multiple passes/avoiding multiple passes/

from zld.

rmaz avatar rmaz commented on June 5, 2024

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.

michaeleisel avatar michaeleisel commented on June 5, 2024

Sure, that'd be great! I can run unit tests on my end, and maybe some perf ones too

from zld.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.