Skip to content
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

ppc64 crossbuild fails #1999

Closed
naguam opened this issue Feb 21, 2024 · 4 comments
Closed

ppc64 crossbuild fails #1999

naguam opened this issue Feb 21, 2024 · 4 comments

Comments

@naguam
Copy link

naguam commented Feb 21, 2024

Hello,

I am not yet knowledgeable on kernel internals, however I was curious about building a kernel with clang.

I followed instructions here https://docs.kernel.org/kbuild/llvm.html

And made my tests on a clean debian stable vm with llvm/clang 14 and 18 (the later from apt-llvm)

The kernel 6.7.5 built perfectly with clang for my native x86 pc and crossbuild with ARCH=riscv

However the ppc64 build failed on both :

make LLVM=1 ARCH=powerpc defconfig
make LLVM=1 ARCH=powerpc -j4

(debian system clang 14)

and

make LLVM=-18 ARCH=powerpc defconfig
make LLVM=-18 ARCH=powerpc -j4

(apt llvm)

I hope I gave enough info to reproduce.

(I used apt build-dep linux to install the dependencies and ensured the kernel could be built with gcc. so not a dependency problem)

I am happy to contribute at my level,

(And sorry I don't have the build log/error anymore, but it is very fast to reproduce)

@naguam
Copy link
Author

naguam commented Feb 21, 2024

Ok in a debian container where I am now I was able to reproduce an output for llvm-14 and llvm-18 which have the same error (I tried llvm-18 thinking that for other arch than x86, llvm minimum versions could be higher)

objcopy: Unable to recognise the format of the input file `vmlinux'
make[2]: *** [arch/powerpc/boot/Makefile:399: arch/powerpc/boot/zImage.pseries] Error 1
make[1]: *** [arch/powerpc/Makefile:238: zImage] Error 2

@nathanchance
Copy link
Member

Thanks for the report! With ARCH=powerpc, there is still a dependency on GNU binutils in arch/powerpc/boot/wrapper, so you will need to install binutils-powerpc64le-linux-gnu and provide CROSS_COMPILE=powerpc64le-linux-gnu- to your make command (#1601)

@naguam
Copy link
Author

naguam commented Feb 21, 2024

Ok thanks I did not see that issue.

Maybe the Linux kernel documentation should be changed so it does not state LLVM=1 in the chart :).

@naguam naguam closed this as completed Feb 21, 2024
@nathanchance
Copy link
Member

Well LLVM=1 works for the main kernel build up through vmlinux and modules, so I don't think recommending CC=clang is fair, but I agree the documentation could be clearer around this situation... I'll think about how to do that.

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

No branches or pull requests

2 participants