Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autolink wasi-libc emulation libraries #843

Conversation

kateinoigakukun
Copy link
Member

_WASI_EMULATED_XXX macros require linking against the corresponding emulation libraries. This patch adds -Xfrontend -public-autolink-library flags to the Swift compiler invocation to automatically link against the emulation libraries. Also enable getpid emulation explicitly, as it is available by default but emiting a warning.

`_WASI_EMULATED_XXX` macros require linking against the corresponding
emulation libraries. This patch adds `-Xfrontend -public-autolink-library`
flags to the Swift compiler invocation to automatically link against the
emulation libraries. Also enable getpid emulation explicitly, as it is
available by default but emiting a warning.
@kateinoigakukun
Copy link
Member Author

@swift-ci test

@kateinoigakukun
Copy link
Member Author

@swift-ci test

Copy link
Contributor

@jmschonfeld jmschonfeld left a comment

Choose a reason for hiding this comment

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

This looks ok to me - since this makes some nontrivial changes to the CMake files and we don't have CI for that on this repo yet, could you kick off a cross-repo toolchain test run on a swift PR linked to this change so that we can validate this doesn't somehow inadvertently break the existing CMake build? After that passes we can go ahead and merge this

@jmschonfeld
Copy link
Contributor

Looks like the linked toolchain build passed. Thanks!

@jmschonfeld jmschonfeld merged commit e905df1 into swiftlang:main Aug 16, 2024
3 checks passed
cthielen pushed a commit to cthielen/swift-foundation that referenced this pull request Nov 8, 2024
* Autolink wasi-libc emulation libraries

`_WASI_EMULATED_XXX` macros require linking against the corresponding
emulation libraries. This patch adds `-Xfrontend -public-autolink-library`
flags to the Swift compiler invocation to automatically link against the
emulation libraries. Also enable getpid emulation explicitly, as it is
available by default but emiting a warning.

* Link emulation libraries directly if building shared libraries
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.

2 participants