This is a fixe that allows FreeBSD/PowerPC64 use LLVM as themain compiler/linker. The commit list bellow refers to hashs found at LLVM Project repo https://github.com/llvm/llvm-project/tree/master, currently tagged as LLVM 9.X. The changes were backported to 8.x
LLVM commit list:
From 44266b9e115ad172b1f6a88d15d4e7579812c0fc Mon Sep 17 00:00:00 2001
From: Martin Storsjo <martin@martin.st>
Date: Thu, 16 May 2019 06:49:13 +0000
Subject: [PATCH] [PPC64][libunwind] Fix r2 not properly restored
This change makes each unwind step inspect the instruction at the
return address and, if needed, read r2 from its saved location and
modify the context appropriately.
The unwind logic is able to handle both ELFv1 and ELFv2 stacks.
Reported by Bug 41050
Patch by Leandro Lupori!
Revision: https://reviews.llvm.org/D59694
llvm-svn: 360861