From: gkoehler Date: Sun, 19 Nov 2023 01:14:07 +0000 (+0000) Subject: Fix cc -ftrapping-math on macppc X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=286d7b47cd0a1941a4474152b47d3f956322aacb;p=openbsd Fix cc -ftrapping-math on macppc Handle CALL_RM like CALL for 32-bit ELF. If a function call has the strictfp attribute, its opcode changes from CALL to CALL_RM. If a call uses the secure PLT, then it must getGlobalBaseReg() to set r30. After I rebuilt xenocara/lib/pixman with this change, Xorg stopped crashing on my macppc. pixman uses cc -ftrapping-math which puts strictfp on each function call. https://github.com/llvm/llvm-project/pull/72758 ok jca@ tobhe@ deraadt@ --- diff --git a/gnu/llvm/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/gnu/llvm/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp index d80a33ff606..7704d1efc03 100644 --- a/gnu/llvm/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp +++ b/gnu/llvm/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp @@ -5293,7 +5293,8 @@ void PPCDAGToDAGISel::Select(SDNode *N) { // generate secure plt code for TLS symbols. getGlobalBaseReg(); } break; - case PPCISD::CALL: { + case PPCISD::CALL: + case PPCISD::CALL_RM: { if (PPCLowering->getPointerTy(CurDAG->getDataLayout()) != MVT::i32 || !TM.isPositionIndependent() || !Subtarget->isSecurePlt() || !Subtarget->isTargetELF())