Enable aarch64 build on amd64 host#43826
Conversation
|
After it is verified to work I will send a patch to toolshed and eliminate most of the crafty stuff here |
|
Compilation -> Build |
|
/retest |
6ede1b5 to
7ca51bf
Compare
Signed-off-by: Takeshi Yoneda <tyoneda@netflix.com>
Signed-off-by: Takeshi Yoneda <tyoneda@netflix.com>
fb4c1f7 to
ba94259
Compare
|
@phlax this is verified to work. I am thinking to add |
|
so there is a sysroot with glibc here https://github.com/envoyproxy/toolshed/releases/download/bins-v0.1.47/sysroot-glibc2.28-libstdc++13-arm64.tar.xz libc++ comes from the toolchain what is quite possible - there is some setup in toolshed which might not be correct for arm x-compile i think it was in toolshed - but i seem to rem when implementing the toolchains some point where i thought - hmm, that probs wont work if anyone actually tries to x-compile arm fwiw - the arm toolchain and sysroot are tested in envoy ci (ie not x-compile) |
|
@phlax so are you saying that instead of providing another toolchain like _with_libc or whatever like the current change, we should be able to fix the existing arm64 toolchain to be able to do x-compile/build? |
|
ill try locally to x-compile assert lib or similar and get a bot on the case with any issues |
|
cool - at least this lua patch is working perfectly for this cross compile usecase regardless of the toolchain change. I will also try to find the toolshed side fix to make this PR only have the luajit patch |
|
toolshed's arm64 toolchain not carrying the libc++, so during the compilation bazel is looking at the local copy of libc++ is what I think is happening |
|
when i say the toolchain provides libc++ im talking about this https://github.com/llvm/llvm-project/releases/ via this https://github.com/bazel-contrib/toolchains_llvm |
|
one thing im 100% confident about - our x86/arm builds in ci do the right thing wrt glibc and libc++ - glibc comes from sysroot, and libc++ comes from the toolchains_llvm setup - the exception is GCC which does use the host glibc and libstdc++ |
|
cool - my claude is working now 🏃 |
|
yep you are right that this only happens in x-build |
|
when cross-compiling, |
|
also it doesn't happen on darwin, so you have to test it on linux 🫠 |
|
@phlax yeah so we need either the current change here or the change like this where we modify the existing arm64 toolchain in toolshed so that we have an overlay libc++ when x-compiling due to the reason pointed out by @bplotnick - which one do you prefer? |
|
luajit patch is necessary anyways for both cases |
|
so - i think if there is a reasonable solution that we can implement in toolshed then that would probs be better this pr feels like its reimplementing what is there already, and a bit brittle i looked at the patch - but tbh - i would much rather review it as a pr to toolshed, and cant promise to do that before monday high-level comment - wondering if we can make the x-compile work arch-agnostically |
|
Yeah then I will send a PR to the tool shed soon. Absolutely no need to have this in before Monday but thank you!! |
Signed-off-by: Takeshi Yoneda <tyoneda@netflix.com>
| name = "llvm_toolchain", | ||
| llvm_version = "18.1.8", | ||
| cxx_standard = {"": "c++20"}, | ||
| stdlib = {"linux-aarch64": "libc++"}, |
There was a problem hiding this comment.
this will force libc++ for arm64 target regardless of the host, otherwise it will be downgraded to stdlibc++ on the host, which is not ideal.
when cross-compiling, toolchains_llvm falls back from builtin-libc++ to libstdc++ and so you get the host libstdc++ behavior.
There was a problem hiding this comment.
yeah - i think we need to guard this with a select - the toolchain should work with libstdc++ also i think
There was a problem hiding this comment.
fwiw, we used to test this more
not sure what current testing is - maybe we dont test libstdc++ at all outside of gcc
that is why the the sysroots have libstdc++ bundled - because they cant get it from the toolchain, but perhaps we can now remove that - not sure
Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]