void-packages/srcpkgs/llvm8/files/patches/lldb/musl.patch
q66 ae921ec4d3 llvm8: clang cross-compiling and musl fixes
This involves two things.

The first thing is fixing the patch that adds musl target triples
into our clang; previously the patch wasn't correct, as it simply
added the musl triples among the GNU triples, which, when cross
compiling to musl targets, resulted in clang considering the GCC
cross installations for glibc and same arch for linking the crt
files; this resulted in broken builds. The new patch only considers
musl triples for musl targets and glibc triples for glibc targets,
so even if you have two cross-gccs installed in parallel for the
same arch (one for musl and one for glibc) it will not pick the
wrong ones.

The second thing is making clang use 64-bit long double for musl
ppc targets correctly. Previously there was no logic for specifying
this and that resulted in 128-bit long double using binaries
emitted by clang for musl and ppc(64). With our specific gcc
setup, that resulted in linking failures as the 128bit ldbl
runtime funcs were not available, and even if they were, the
results would be incorrect.

This also replaces the old zzz-aarch64.patch with a version fixed
for ppc.

[ci skip]

Closes: #11866 [via git-merge-pr]
2019-05-22 20:12:32 +02:00

31 lines
864 B
Diff

--- a/source/Plugins/Process/Linux/Procfs.h
+++ b/source/Plugins/Process/Linux/Procfs.h
@@ -11,21 +11,12 @@
// sys/procfs.h on Android/Linux for all supported architectures.
#include <sys/ptrace.h>
+#include <asm/ptrace.h>
-#ifdef __ANDROID__
-#if defined(__arm64__) || defined(__aarch64__)
-typedef unsigned long elf_greg_t;
-typedef elf_greg_t
- elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
-typedef struct user_fpsimd_state elf_fpregset_t;
-#ifndef NT_FPREGSET
-#define NT_FPREGSET NT_PRFPREG
-#endif // NT_FPREGSET
-#elif defined(__mips__)
-#ifndef NT_FPREGSET
-#define NT_FPREGSET NT_PRFPREG
-#endif // NT_FPREGSET
-#endif
-#else // __ANDROID__
+#if !defined(__GLIBC__) && defined(__powerpc__)
+#define pt_regs musl_pt_regs
+#include <sys/procfs.h>
+#undef pt_regs
+#else
#include <sys/procfs.h>
-#endif // __ANDROID__
+#endif