b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | From 578f370c7e7a9f056aefa062b34590b0aa13bce5 Mon Sep 17 00:00:00 2001 |
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
| 3 | Date: Tue, 15 Aug 2017 17:27:30 +0800 |
| 4 | Subject: [PATCH] Fix build on aarch64/musl |
| 5 | |
| 6 | Errors |
| 7 | |
| 8 | invalid operands to binary & (have 'long double' and 'unsigned int') |
| 9 | |
| 10 | error: redefinition |
| 11 | of 'struct iovec' |
| 12 | struct iovec { void *iov_base; size_t iov_len; }; |
| 13 | ^ |
| 14 | Upstream-Status: Pending |
| 15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 16 | |
| 17 | Rebase to 0.170 |
| 18 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
| 19 | |
| 20 | --- |
| 21 | backends/aarch64_initreg.c | 4 ++-- |
| 22 | backends/arm_initreg.c | 2 +- |
| 23 | 2 files changed, 3 insertions(+), 3 deletions(-) |
| 24 | |
| 25 | --- a/backends/aarch64_initreg.c |
| 26 | +++ b/backends/aarch64_initreg.c |
| 27 | @@ -33,7 +33,7 @@ |
| 28 | #include "system.h" |
| 29 | #include <assert.h> |
| 30 | #if defined(__aarch64__) && defined(__linux__) |
| 31 | -# include <linux/uio.h> |
| 32 | +# include <sys/uio.h> |
| 33 | # include <sys/user.h> |
| 34 | # include <sys/ptrace.h> |
| 35 | # include <asm/ptrace.h> |
| 36 | @@ -94,7 +94,7 @@ aarch64_set_initial_registers_tid (pid_t |
| 37 | |
| 38 | Dwarf_Word dwarf_fregs[32]; |
| 39 | for (int r = 0; r < 32; r++) |
| 40 | - dwarf_fregs[r] = fregs.vregs[r] & 0xFFFFFFFF; |
| 41 | + dwarf_fregs[r] = (unsigned int)fregs.vregs[r] & 0xFFFFFFFF; |
| 42 | |
| 43 | if (! setfunc (64, 32, dwarf_fregs, arg)) |
| 44 | return false; |
| 45 | --- a/backends/arm_initreg.c |
| 46 | +++ b/backends/arm_initreg.c |
| 47 | @@ -38,7 +38,7 @@ |
| 48 | #endif |
| 49 | |
| 50 | #ifdef __aarch64__ |
| 51 | -# include <linux/uio.h> |
| 52 | +# include <sys/uio.h> |
| 53 | # include <sys/user.h> |
| 54 | # include <sys/ptrace.h> |
| 55 | /* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */ |