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

Latest wasi-libc #109

Merged
merged 30 commits into from
Feb 27, 2023
Merged

Latest wasi-libc #109

merged 30 commits into from
Feb 27, 2023

Conversation

csegarragonz
Copy link
Contributor

@csegarragonz csegarragonz commented Feb 6, 2023

In this PR I rebase our wasi-libc fork to the latest upstream. Most importantly, many things that were not supported when we first forked wasi-libc have now been implemented (i.e. emulated). For example, signals or process clocks. So I use those when possible.

The diff between faasm's branch and the latest upstream head can be inspected here. I would like to simplify it further (e.g. removing syscalls support in Faasm?), but this is out of the scope of this PR.

The summary of changes after the rebase are the following:

  • Add the option to nuke the sysroot when re-building wasi-libc. Not doing so, prevented catching some bugs of dependencies building with older sysroots.
  • mmap/munmap is also supported as part of wasi-libc now. I ammend our demo functions to compile with both our mmap implementation and wasi-libc's.

@csegarragonz csegarragonz marked this pull request as ready for review February 8, 2023 14:20
@csegarragonz csegarragonz self-assigned this Feb 23, 2023
@csegarragonz csegarragonz changed the title Latest wasi libc Latest wasi-libc Feb 23, 2023
Copy link
Collaborator

@Shillaker Shillaker left a comment

Choose a reason for hiding this comment

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

Tiny comment on LLVM version, otherwise LGTM 👍

@@ -1,4 +1,5 @@
FROM faasm/llvm:13.0.1 as llvm
# llvm image is not re-built often, so the tag may be behind
FROM faasm/llvm:0.2.2 as llvm
Copy link
Collaborator

Choose a reason for hiding this comment

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

This image was tagged with the LLVM image used to build it (i.e. used to be LLVM 13.0.1). It makes it clearer which LLVM version is being used IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When updating the PR description, I removed the explanation of this change.

Turns out that installing LLVM (inc. libc) populates the sysroot with files (e.g. header files) that are not necessarily removed when re-building libc from scratch. Thus, different libc configurations for the same llvm version would yield different container images.

Even though adding the --purge flag to llvm.libc should do the trick, I am not enitrely sure. Thus, rather than having docker image inconsitencies I change the tagging mechanism.

@csegarragonz csegarragonz merged commit 90cf7f6 into main Feb 27, 2023
@csegarragonz csegarragonz deleted the latest-wasi-libc branch February 27, 2023 09:33
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