Building Linus tree with clang trunk, powernv_defconfig:
make CC=/scratch/joel/llvm-build/bin/clang-8 HOSTCC=/scratch/joel/llvm-build/bin/clang-8 LD=/scratch/joel/llvm-build/bin/ld.lld -j176
...
ld.lld -EL -m elf64lppc -Bstatic --orphan-handling=warn --build-id -o .tmp_vmlinux1 -T ./arch/powerpc/kernel/vmlinux.lds --whole-archive built-in.a --no-whole-archive --start-group lib/lib.a --end-group
ld.lld: error: ./arch/powerpc/kernel/vmlinux.lds:73: unknown section directive: 0
>>> .text BLOCK(0) : AT(ADDR(.text) - (0xc000000000000000 -0x00000000)) {
>>> ^
arch/powerpc/kernel/vmlinux.lds.S:
/*
* BLOCK(0) overrides the default output section alignment because
* this needs to start right after .head.text in order for fixed
* section placement to work.
*/
.text BLOCK(0) : AT(ADDR(.text) - LOAD_OFFSET) {
@shenki I'm not sure if we would want to either
A. enable block support as an alias for align in lld
or
B. change the linker script to use align.
Anyway here is the lld patch.
https://reviews.llvm.org/D56060
I suggested changing the script at the LLD patch page. I think BLOCK does not sound as clear as ALIGN so I would try to avoid supporting it, given the fact that documentation implicitly says its deprecated.
There is some use of the BLOCK syntax in the wild, but we probably don't have to care about supporting them.
I have written a patch that I will submit to the upstream kernel:
http://ozlabs.org/~joel/0001-powerpc-Use-ALIGN-instead-of-BLOCK.patch
@shenki LGTM, did you send that patch yet?
What do we do from here?
@shenki can you get the patch backported to LTS and co?
It needs to be merged into mainline first before it can get backported. It is queued up for 5.1 so we'll see it merged into a few weeks.
Merged into mainline: https://git.kernel.org/torvalds/c/a652758ac1475f69d28d11b3528c4f48