Skip to content

Conversation

kateinoigakukun
Copy link
Member

.swift_ast section is now recognized as a "metadata" section by LLVM's object emission. On WebAssembly, metadata symbols must not appear in the object file symbol table. Therefore, change the linkage of the @__Swift_AST global from InternalLinkage to PrivateLinkage to avoid exposing the symbol.

swiftlang/llvm-project@555eaef

`.swift_ast` section is now recognized as a "metadata" section by LLVM's
object emission. On WebAssembly, metadata symbols must not appear in the
object file symbol table. Therefore, change the linkage of the
`@__Swift_AST` global from InternalLinkage to PrivateLinkage to avoid
exposing the symbol.

swiftlang/llvm-project@555eaef
@kateinoigakukun
Copy link
Member Author

@swift-ci smoke test

Copy link
Contributor

@aschwaighofer aschwaighofer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me.

@aschwaighofer
Copy link
Contributor

Does the corresponding LLVM patch also existing on the branch that main currently builds with?

@kateinoigakukun
Copy link
Member Author

kateinoigakukun commented Sep 17, 2025

The commit is not included in the current stable llvm branch swift's main uses but it's included in the new rebranch. This is a fix to unblock the ongoing test failures on rebranch

@aschwaighofer
Copy link
Contributor

Should this change be merged to rebranch instead? Is there the risk that the symbol will be stripped (in main branch) without the matching llvm commit on the stable/.... branch?

I am inferring that possibility from the comment on the llvm PR:

This change ensures that this section is not marked as loadable, which makes it possible for it to be stripped.

@kateinoigakukun
Copy link
Member Author

kateinoigakukun commented Sep 18, 2025

I think it's safe to apply the LLVM change and this change independently, because a private loadable global var should remain in the object file. Correct me @hyp if my understanding is incorrect.
My intention to merge this to main instead rebranch is to minimize dfff for the rebranch merge

@aschwaighofer
Copy link
Contributor

Aah, I misread/misunderstood what the LLVM change does: it allows for stripping the symbol, not as I initially read it, prevent it.

@AnthonyLatsis
Copy link
Collaborator

@swift-ci please smoke test Linux

1 similar comment
@AnthonyLatsis
Copy link
Collaborator

@swift-ci please smoke test Linux

@AnthonyLatsis AnthonyLatsis merged commit 22e85b0 into swiftlang:main Sep 18, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants