Skip to content

Conversation

@csegarragonz
Copy link
Contributor

@csegarragonz csegarragonz commented Nov 9, 2022

Other than bumping the LLVM version, this PR also homogeneises the way we build LLVM targets. The main difference with how we did it before is that now, to re-build libc instead of going directly to wasi-libc and running make we run make libc from the llvm-project submodule. Under the hood, this does the same: cds to wasi-libc and make, but it means that we now can rely on LLVM.makefile as the single source of truth.

This has one disadvantage, which is that we need to clone llvm-project if we want to re-build libc (e.g. in cpp-sysroot) but cloning is never too bad in terms of execution time.

See faasm/faasm#705 for the bigger picture.

Closes #90

@csegarragonz csegarragonz mentioned this pull request Nov 15, 2022
15 tasks

flake8_cmd = [
"python3 -m flake8",
"{}".format("--format" if not check else ""),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The --format flag in flake8 is not an opt-in flag to actually change the code (as flake8 does not modify the sources), instead it is used to specify a different formatter to check for style warnings.



@task(default=True)
def build(ctx, clean=False):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is now: inv llvm.libc [--clean]

@csegarragonz csegarragonz marked this pull request as ready for review November 15, 2022 16:53
}


def do_llvm_build(target, clean_target=None):
Copy link
Contributor Author

@csegarragonz csegarragonz Nov 16, 2022

Choose a reason for hiding this comment

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

This function is a common entrypoint to build the different targets in LLVM.makefile (most importantly, all or libc).

"-O3 -mno-atomics",
"-O3",
"-mno-atomics",
"-mno-simd128",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that in LLVM 13 we need to be explicit about -mno-simd128 as otherwise some targets are built with simd.

export CC=/usr/bin/clang-10
export CPP=/usr/bin/clang-cpp-10
export LINK=/usr/bin/clang++-10
export CXX=/usr/bin/clang++-13
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I update this file, but I am not sure where it is used 🤔

- name: "Set the GH workspace as a safe git directory"
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
# --- Build libraries to wasm ---
- name: "Build libc"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This now re-builds libc from scratch every time (as it checks-out a fresh version of llvm that tracks without build directory) so re-building in the GHA takes an outrageous amont of time (>1h).

@csegarragonz csegarragonz self-assigned this Nov 17, 2022
@@ -1 +1,2 @@
ffi_call
ffi_prep_closure_loc
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is neeeded to build ctypes statically in CPython

@csegarragonz csegarragonz requested a review from Shillaker January 9, 2023 11:55
@csegarragonz csegarragonz merged commit 088b314 into main Jan 17, 2023
@csegarragonz csegarragonz deleted the llvm branch January 17, 2023 15:08
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