Skip to content

Conversation

@MaxDesiatov
Copy link
Contributor

autolink_extract_main should support the .swift1_autolink_entries section for WebAssembly binaries.

Related to SR-9307.

(cc @compnerd)

@compnerd
Copy link
Member

Since the WASM target actually uses lld, why not use the LLVM extension to support autolinking rather than use autolink-extract? Is there anything preventing that?

@MaxDesiatov
Copy link
Contributor Author

Sorry, I'm not sure, what do you mean by "the LLVM extension" here?

@compnerd
Copy link
Member

No need to be sorry about that. LLVM has an extension to support autolinking (llvm.dependent-libraries). It seems like it should be possible to use that in WASM as well. If just using that in WASM is not reasonable, then let's go ahead with this approach. But if that approach is viable, it would be better (it avoids the additional tool, simplifies the pipeline).

@MaxDesiatov
Copy link
Contributor Author

@kateinoigakukun WDYT about the approach suggested by Saleem above? I don't have much experience with LLVM and autolinking, but I'm ready to dig in if you also think that's relevant

@kateinoigakukun
Copy link
Member

I agree that the approach suggested by compnerd would be the simplest solution.
And I'm sure that we can make a new convention for the autolink in wasm tools conventions. (Yeah, but it requires a lot of effort)

So what should we do are:

  1. Propose a new convention for autolink in Wasm object file conventions
  2. Support llvm.dependent-libraries in Wasm target backend of LLVM to lower it in the proposed convention.
  3. Support the new convention in wasm-ld

If we accomplished them, we won't need this swift-autolink-extract workaround in Wasm target.

@MaxDesiatov
Copy link
Contributor Author

@compnerd would it be ok to merge this one as a temporary solution? In the meantime we'll try to push forward for support in upstream LLVM and Wasm tool conventions for this?

@kateinoigakukun
Copy link
Member

Closing in favor of #65914

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WebAssembly Platform: WebAssembly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants