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

/!\ This code is under rapid development and testing; it is not yet ready for production use as of 20190705.

Build 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 on power8/QEMU-pseries and G5

kernel

OK

OK

Tested on power8/QEMU-pseries and G5 and power9. Some power9 bare-metal requires an updated OPAL firmware (or disable OPAL Flash)

disc1.iso

OK

OK

The ports summary bellow is based on FreeBSD 13 installed from the ELFv2 experimental ISO.

Ports Package

Build Status

Sanity Status

Info

lang/rust

OK*

OK

*Patch to be submitted by Mikael Urankar D20792

lang/ghc

OK

OK

GCC8 is currently required due to 42541

ports/java/openjdk8

OK*

OK

*Patch to be submitted by Mikael Urankar

lang/fpc

DISABLED

Package configured only for amd64 386 currently. Also would require ELFv2 compatible bootstrap

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)

fix LIB32 build (Makefile.libcompat)

D20261

review

fix incorrect clang target triple computation (Makefile.inc1)

D19237

review (optional)

LLVM - backport FreeBSD/PowerPC64 LLVM9 upstream changes

D20337

review (may be dropped after LLVM 8.0.1 in base)

fix missing powerpc64 in _LLVM_TARGET_FILT

D20756

review

readelf: print description for 'e_flags' in ELF header (ABI type)

D20782

review (optional)

add ABI flags to 'file' magic

D20771

review (optional)

fix panic when loading if_epair.ko built with modern compiler

D20461

commited r349377

fix kernel build with lld8

D19352

commited (r348112)

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

/!\ Packages are not yet being built for this configuration; for now, you will have to build your own. Expect to find failures as unlike the results with gcc, few ports have really been tested.

/!\ Use of the -CURRENT powerpc packages built on FreeBSD.org may or may not work (it has not been tested as of 20190705).

Description

URL

Status

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

D20375

abandoned - ports/llvm80 will be updated to 8.0.1 soon, and it contains all important changes

LLVM 8.0.0

Description

URL

Status

8.x backport

change default ABI for FreeBSD13.0+

to be released

[PPC32] Fix PLT calls for -msecure-plt -fpic

D63563

commited in LLVM9/head

Adds ABI parsing when specified on target triple

D61950

commited in LLVM9/head

41981 unfeasible for 8.0.1

[libunwind] Fix r2 not properly restored

41050, D59694

commited in LLVM9/head

41942 8.0.1 (r360861 r364217)

Consider localentry offset when computing branch distance

D61058

commited in LLVM9/head

42332 8.0.1 (r359094 r364209)

[PPC] Fix 32-bit build of libunwind

D61792

commited in LLVM9/head

41941 8.0.1 (r360862 r363030)

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

D61647 D61718

commited in LLVM9/head

41961 8.0.1 (r360439 r362668)

Implement Thunk Section Spacing

D61610 D61720

commited in LLVM9/head

41959 8.0.1 (r353865 r353866 358975 r360405 r362043 r362273 r362274)

Update LocalEntry from assigned symbols

D56586

commited in LLVM9/head

41960 8.0.1 (r361237 r362671)

Preserve LocalEntry when linking

D56782

commited in LLVM9/head

41943 8.0.1 (r354184 r361921)

Fix missing ELF st_other field on versioned symbols

41048, D59436

commited in LLVM9/head

41968 8.0.1 (r360439 r360442 r362668 r362669)


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 8

Use GNU LD v2.17

LLD PowerPC 32-bit support is being improved. See 40888

LIB32 binaries are broken when linked with LLVM LLD 8

Use GNU LD v2.17

LLD PowerPC 32-bit support is being improved. See 40888

LIB32 build is incompatible with WITH_LLVM_LIBUNWIND=yes

Fixed

See D61792

FreeBSD base compiler

Description

URL

Workaround

Status

Integrated AS doesn't implement mulldo, addo and subfo instructions

42541

use GNU AS 2.30+

reported

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 being improved. See 40888

FreeBSD kernel

Description

URL

Workaround

Status

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)

'kldload if_epair' causes kernel panic

232387 D20461

fixed r349377

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

237470

Fixed

FreeBSD ports

Description

URL

Workaround

Status

cannot build rust package (firefox dependency)

D20792

see D20792

rust-elfv2 bootstrap is a work in progress

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-07-12 17:25:36 by AlfredoDalAva)