ports/devel/llvm70/files/patch-head-r308867.diff
Brooks Davis d38df13120 Add all patches from base llvm/clang/lld/lldb 7.0 to devel/llvm70
This adds all the patches that were applied in the past to the
clang700-import branch, under contrib/llvm. After these, there only
minimal diffs left between the port sources and the base sources.

Most of these remaining diffs are due to #ifdef shortcuts in the base
sources, because we don't compile certain features in. Other diffs are
because the port has applied a few changes that we don't have in base.

Also switch to the common LICENSE defintion in devel/llvm-devel and
chase new USE_GNOME requirements (for libxml2).

PR:	212343, 230604
Submitted by:	dim
MFH:		2018Q4
Differential Revision:	https://reviews.freebsd.org/D17709
2018-11-01 17:47:32 +00:00

33 lines
1.3 KiB
Diff

r308867 | dim | 2016-11-19 22:05:17 +0100 (Sat, 19 Nov 2016) | 15 lines
Work around LLVM PR30879, which is about a bad interaction between X86
Call Frame Optimization on i386 and libunwind, by disallowing the
optimization for i386-freebsd12.
This should fix some instances of broken exception handling when frame
pointers are omitted, in particular some unittests run during the build
of editors/libreoffice.
This hack will be removed as soon as upstream has implemented a more
permanent fix for this problem.
Upstream PR: https://llvm.org/bugs/show_bug.cgi?id=30879
Reviewed by: emaste
PR: 212343
Index: lib/Target/X86/X86CallFrameOptimization.cpp
===================================================================
--- lib/Target/X86/X86CallFrameOptimization.cpp (revision 308866)
+++ lib/Target/X86/X86CallFrameOptimization.cpp (revision 308867)
@@ -125,6 +125,11 @@ bool X86CallFrameOptimization::isLegal(MachineFunc
if (NoX86CFOpt.getValue())
return false;
+ // Work around LLVM PR30879 (bad interaction between CFO and libunwind)
+ if (STI->isTargetFreeBSD() && STI->is32Bit() &&
+ STI->getTargetTriple().getOSMajorVersion() >= 12)
+ return false;
+
// We can't encode multiple DW_CFA_GNU_args_size or DW_CFA_def_cfa_offset
// in the compact unwind encoding that Darwin uses. So, bail if there
// is a danger of that being generated.