SoMainline / linux-apple-resources

191 stars 16 forks source link

Fix clang cross compile command #2

Closed infinitebash closed 2 years ago

infinitebash commented 2 years ago

The command make ARCH=arm64 CROSS_COMPILE=clang LLVM=1 -j$(nproc) Image.lzma dtbs threw the following error on my machine (Arch Linux with clang 13.0.1):

error: unknown target triple 'clang', please use -triple or -arch

However make ARCH=arm64 CROSS_COMPILE=clang-arm64 LLVM=1 -j$(nproc) Image.lzma dtbs did work.

konradybcio commented 2 years ago

isn't clang-arm64 an Arch specific?

ClangBuiltLinux uses

make ARCH=arm64 LLVM=1 LLVM_IAS=1 LLVM_VERSION=15

not sure how necessary the last paremeter is though and I can't really test rn

alamshafil commented 2 years ago

I get the same error on Arch Linux; however, using:

make ARCH=arm64 LLVM=1 LLVM_IAS=1 LLVM_VERSION=15 -j$(nproc) Image.lzma dtbs

Works fine for me on Arch Linux.

DiscoStarslayer commented 2 years ago

I was able to build on ubuntu with make ARCH=arm64 LLVM=-14 (-14 specifies to use version 14 of the clang toolchain). The kernel docs specify the CROSS_COMPILE property is redundant when clang is being used.

infinitebash commented 2 years ago

The command make ARCH=arm64 LLVM=1 -j$(nproc) Image.lzma dtbs worked for me as well so I've updated my repo/PR to use it (as well as pulling changes from upstream).