littlekernel / lk

LK embedded kernel
MIT License
3.11k stars 611 forks source link

Add support for building AArch64 with Clang #374

Closed arichardson closed 1 year ago

arichardson commented 1 year ago

These changes allow me to build with make CC="/usr/bin/clang -target aarch64-unknown-elf" LD=/usr/bin/ld.lld TOOLCHAIN_PREFIX=/usr/bin/ qemu-virt-arm64-test

arichardson commented 1 year ago

Unlike https://github.com/littlekernel/lk/pull/322 this does not add a LLVM= flag to change the default it just allows building if CC/LD are explicitly set to LLVM tools.

arichardson commented 1 year ago

ping?

travisg commented 1 year ago

These look pretty good, hoping to get a look at it this weekend. Mostly need to make sure it works well with GCC and see about trying to make it more generic. There have been multiple attempts to compile with clang over the years but they're generally fairly limited.

Message ID: @.***>

arichardson commented 1 year ago

These look pretty good, hoping to get a look at it this weekend. Mostly need to make sure it works well with GCC and see about trying to make it more generic. There have been multiple attempts to compile with clang over the years but they're generally fairly limited.

Thanks! I did build with GCC as well, and ran the build all script so hopefully it all works. Once these changes are in I'll submit another PR with changes to allow building for RISC-V with clang.

travisg commented 1 year ago

LGTM, sorry for the delay!