summaryrefslogtreecommitdiff
path: root/user/llvm14/dwarf-info.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2022-11-28 23:40:21 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2022-11-28 23:44:16 -0600
commit2ca2069f91c77a186e098c0ae391b379cab594cc (patch)
treeccb7df3b200b4cfea490780974f6a736878ea4a0 /user/llvm14/dwarf-info.patch
parente78459be10169c4bd2499648a23e2935873a3e13 (diff)
downloadpackages-2ca2069f91c77a186e098c0ae391b379cab594cc.tar.gz
packages-2ca2069f91c77a186e098c0ae391b379cab594cc.tar.bz2
packages-2ca2069f91c77a186e098c0ae391b379cab594cc.tar.xz
packages-2ca2069f91c77a186e098c0ae391b379cab594cc.zip
user/llvm14: Fix tests on 32-bit machines
* DWARF info patch fixes issue seen on ARMv7 and PPC. * Dyld patch fixes OrcJIT on PPC (also needed for mesa). * MachO fix is being sent upstream and affects all 32-bit CPUs. * PPC test fix is already upstream, backported to 14 branch. Fixes: #846
Diffstat (limited to 'user/llvm14/dwarf-info.patch')
-rw-r--r--user/llvm14/dwarf-info.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/user/llvm14/dwarf-info.patch b/user/llvm14/dwarf-info.patch
new file mode 100644
index 000000000..44b9e88ad
--- /dev/null
+++ b/user/llvm14/dwarf-info.patch
@@ -0,0 +1,28 @@
+Author: A. Wilcox <awilfox@adelielinux.org>
+
+This isn't the proper fix, but debugging the LLVM formatter is a bit
+above my paygrade at the moment.
+
+The issue shows up in the DWARF X86 test on ppc and armv7:
+
+error: Simplified template DW_AT_name could not be reconstituted:
+ original: f3<char, '\x00', '\x01', '\x06', '\a', '\r', '\x0e', '\x1f', ' ', '!', '\x7f', '\x80'>
+ reconstituted: f3<char, '\x00', '\x00', '\x00', '\a', '\r', '\x00', '\x00', ' ', '!', '\x00', '\x00'>
+
+With this patch, this error does not occur. Debugging shows that the
+llvm::format overload called in the error case is <long long>, so I
+think it is having an issue converting a 64-bit value on platforms
+where char is default-unsigned.
+
+(pmmx does not show this issue, and has signed char.)
+--- llvm-14.0.6.src/lib/DebugInfo/DWARF/DWARFDie.cpp.old 2022-06-22 16:46:24.000000000 +0000
++++ llvm-14.0.6.src/lib/DebugInfo/DWARF/DWARFDie.cpp 2022-11-28 10:32:05.573627744 +0000
+@@ -506,7 +506,7 @@
+ OS << (char)Val;
+ OS << "'";
+ } else if (Val < 256)
+- OS << to_string(llvm::format("'\\x%02x'", Val));
++ OS << to_string(llvm::format("'\\x%02x'", (char)Val));
+ else if (Val <= 0xFFFF)
+ OS << to_string(llvm::format("'\\u%04x'", Val));
+ else