This page contains status information about efforts to bring LLVM to PowerPC64 target, using OpenPower ELF v2 ABI.

Status summary

The summary bellow is valid when using llvm 8.0.0 + patches. GNU LD v2.17 is currently needed for 32 bit sysroot/libraries):

Description

Build Status

Sanity Status

Info

base (minimal)

OK

OK

with patches

base (LIB32)

OK

OK

with patches. (see known issues bellow)

base (toolchain)

OK

OK

with patches.

stand/bootloader

OK

OK

with patches. Tested only slof loader with QEMU

kernel

OK

OK

with patches.

disc1.iso

OK

OK

disc1.iso boots and installs correctly on QEMU. On bare metal there's report of kernel hang on boot

Test environment: QEMU 4.0 rc0 virtual machine pseries with KVM acceleration, running on host machine with CPU POWER8E model 2.1.

(-machine pseries-4.0,accel=kvm,cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken,cap-hpt-max-page-size=16M)


Patches

FreeBSD Base

Description

URL

Status

makes LLVM default on PowerPC64

D20378

review (flag day)

LLVM - change default ABI for FreeBSD13.0+

D20383

review (flag day)

LLVM - backport FreeBSD/PowerPC64 LLVM9 upstream changes

D20337

review

fix kernel build with lld8

D19352

committed (r348112)

fix incorrect clang target triple computation (Makefile.inc1)

D19237

review (not a blocker)

fix LIB32 build (Makefile.libcompat)

D20261

review

fix stand/bootloader build

D20026

commited

ship ld.bfd with base

D20259

commited

fix wrong KASSERT in mphyp_pte_insert()

D20012

commited

fix pseries-llan (QEMU)

D20008

commited

silence cast-align warnings from clang on powerpc64

D18807

commited

fix rtld-elf compilation warning for powerpc64 ELFv2 ABI

D18808

commited

fix compilation error (contrib/binutils/opcodes/ppc-dis.c)

D19235

committed r344791

fix compilation error (include/pthread.h)

D19236

abandoned after test with r344922

increase ctfconvert buffer size

D19353

commited

fix kldxref

D19370

commited

FreeBSD Ports

Description

URL

Status

backport of LLVM 9 fixes in preparation for building FreeBSD/PowerPC64

D20375

review

LLVM 8.0.0

Description

URL

Status

8.x backport

change default ABI for FreeBSD13.0+

to be released

Adds ABI parsing when specified on target triple

D61950

commited in LLVM9/head

41981

llvm-objdump: when ELF st_other field is set, print its value before symbol name

D61647 D61718

commited in LLVM9/head

41961

Implement Thunk Section Spacing

D61610 D61720

commited in LLVM9/head

41959

Update LocalEntry from assigned symbols

D56586

commited in LLVM9/head

41960

Preserve LocalEntry when linking

D56782

commited in LLVM9/head

41943

Fix missing ELF st_other field on versioned symbols

41048, D59436

commited in LLVM9/head

41968

[libunwind] Fix r2 not properly restored

41050, D59694

commited in LLVM9/head

41942

[PPC] Fix 32-bit build of libunwind

D61792

commited in LLVM9/head

41941


Pending Issues

List of currently known pending issues. This list assumes above patches are already applied.

FreeBSD base

Description

URL

Workaround

Status

slof loader is broken when linked with LLVM LLD

Use GNU LD v2.17

LLD PowerPC 32-bit support is in early stages. See 40888

LIB32 binaries are broken when linked with LLVM LLD

Use GNU LD v2.17

LLD PowerPC 32-bit support is in early stages. See 40888

LIB32 build is incompatible with WITH_LLVM_LIBUNWIND=yes

Fixed

See D61792

FreeBSD base compiler

Description

URL

Workaround

Status

LLVM/lld large binaries (like clang itself) may get a wrong/corrupted .init after link

40740

21690

D61610D61720 Fix available

LLVM/lld doesn't implement dynamic relocations R_PPC_LOCAL24PC and R_PPC_GOT16 used by LIB32

40888

link with GNU LD 2.17

LLD PowerPC 32-bit support is in early stages. See 40888

FreeBSD kernel

Description

URL

Workaround

Status

[ppc][pseries] panic: Error evicting page: -7

237470

Fixed

driver virtio drivers are not working.

D19815

needs investigation for a proper fix. (It is NOT a ELFv2 related issue, it's seen on ELFv1 too)

FreeBSD ports

Description

URL

Workaround

Status

cannot build rust package (firefox dependency)

rust depends on some rust version already running on the machine, so rust need to be cross compiled first

Petitiboot - kexec (bare metal)

Description

URL

Workaround

Status

kexec can't boot ELFv2 FreeBSD kernel

https://github.com/antonblanchard/kexec-lite/pull/9

http://drop.rtk0.net/kexec

committed, is in Talos II/Lite/Blackbird PNOR beta firmware. Only affects platforms using kexec-lite containing this commit. Older versions of kexec-lite did not do the erroneous computation and always used the first address of .text as the entry point.

Contact

FreeBSD IRC Channels

powerpc/llvm-elfv2 (last edited 2019-05-23 16:22:55 by AlfredoDalAva)