-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Makefile: Add flags for cross-compiler LLVM
target
#685
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mariasfiraiala I think we should be striving for better clang integration, if possible one that does not depend on a GCC toolchain, but rather on clang, ldd, and binutils. If that is not possible, we should still update the build system so that the user is not required to manually set so many env vars.
If you decide to pursue this, here are some useful resources:
LLVM
targetLLVM
target
@mariasfiraiala @michpappas @razvand, should we go ahead with some variation of this PR until we get a better I think we can do something very transparent to the user, like check if the user selected any The only env variable that should be set is the |
@mariasfiraiala following the discussion here we should update this PR to just add the We should eventually just remove the whole |
7359a68
to
2c2b28f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @mariasfiraiala. Besides the comment, I would replace flags
with something more specific (like target flags
?) in the commit message / description.
✅ Checkpatch passed Beep boop! I ran Unikraft's
|
This commit adds target flags needed for cross-compiling with `clang` for`AArch64`. They are guarded by a condition which checks if these flags are really needed (the compiler is `clang` and the architecture is `AArch64`). Signed-off-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
2c2b28f
to
999fc9c
Compare
Done @StefanJum, please take another look! |
Just to have it here for documentation purposes, there is a small issue with the TLS phdrs, that rarely shows up, a better description of it being on the discord channel. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @mariasfiraiala, all good.
Reviewed-by: Stefan Jumarea stefanjumarea02@gmail.com
Thanks @mariasfiraiala 🚀 Approved-by: Michalis Pappas michalis@unikraft.io |
Prerequisite checklist
checkpatch.pl
on your commit series before opening this PR;Base target
AArch64
kvm
Additional configuration
Download the cross-compiling toolchain. Get it from the official ARM developer website; look out for the
AArch64 bare-metal target (aarch64-none-elf)
.Disable all erratum options from
Architecture Selection
->Arm8 Compatible
->Workaround for [...] erratum
(for now, until build: Add minumum required compiler version and fix cpu model and erratas for arm64 #949 gets upstreamed)Build your app:
make CC=clang CROSS_COMPILE=~/toolchains/gcc-arm-11.2-2022.02-x86_64-aarch64-none-elf/bin/aarch64-none-elf-
Description of changes
If one wishes to compile an app using
clang
, for instance, they would have to choose theCustom cross-compiler LLVM target
option from the make build system, and manually set the flags.This commit adds flags needed for cross-compiling with
clang
forAArch64
.Instead of the extra step of filling in the cross-compiler in the
Custom cross-compiler LLVM target
field, we harcode it to beaarch64-none-elf
, which withclang
, works like a charm (it doesn't get a trap due to theemutls
issue - unikraft/docs#153).Fixes: #921
Signed-off-by: Maria Sfiraiala maria.sfiraiala@gmail.com