ab157e9e7b1be068acd90d7688a762d94ccbbdcb
[buildroot.git] /
1 From 4909cfbbe8dd512b8fc0892859549c26e1b14d30 Mon Sep 17 00:00:00 2001
2 From: Mark Corbin <mark.corbin@embecosm.com>
3 Date: Sun, 21 Oct 2018 10:38:18 +0100
4 Subject: [PATCH] Fix RISC-V 32-bit build of riscv-glibc 2.26
5
6 This patch fixes two build errors with the 32-bit version of
7 glibc-2.26 from the riscv-glibc repository.
8
9 A void reference to 'refsym' has been added to dl-runtime.c to avoid
10 an 'unused variable' error when building with '-Werror'.
11
12 Some data types were hard-coded for 64-bit in ldsodefs.h. These have
13 been modified to allow 32-bit builds.
14
15 This patch was provided by Fabrice Bellard as part of his RISC-V
16 Buildroot development source.
17
18 Signed-off-by: Mark Corbin <mark.corbin@embecosm.com>
19 ---
20 elf/dl-runtime.c | 1 +
21 sysdeps/riscv/ldsodefs.h | 4 ++--
22 2 files changed, 3 insertions(+), 2 deletions(-)
23
24 diff --git a/elf/dl-runtime.c b/elf/dl-runtime.c
25 index 51d3819d4a..e728e8907e 100644
26 --- a/elf/dl-runtime.c
27 +++ b/elf/dl-runtime.c
28 @@ -146,6 +146,7 @@ _dl_fixup (
29 if (__glibc_unlikely (GLRO(dl_bind_not)))
30 return value;
31
32 + (void)refsym;
33 return elf_machine_fixup_plt (l, result, refsym, sym, reloc, rel_addr, value);
34 }
35
36 diff --git a/sysdeps/riscv/ldsodefs.h b/sysdeps/riscv/ldsodefs.h
37 index db993df80a..91e7a8c88f 100644
38 --- a/sysdeps/riscv/ldsodefs.h
39 +++ b/sysdeps/riscv/ldsodefs.h
40 @@ -25,14 +25,14 @@ struct La_riscv_regs;
41 struct La_riscv_retval;
42
43 #define ARCH_PLTENTER_MEMBERS \
44 - Elf64_Addr (*riscv_gnu_pltenter) (Elf64_Sym *, unsigned int, \
45 + ElfW(Addr) (*riscv_gnu_pltenter) (ElfW(Sym) *, unsigned int, \
46 uintptr_t *, uintptr_t *, \
47 const struct La_riscv_regs *, \
48 unsigned int *, const char *name, \
49 long int *framesizep);
50
51 #define ARCH_PLTEXIT_MEMBERS \
52 - unsigned int (*riscv_gnu_pltexit) (Elf64_Sym *, unsigned int, \
53 + unsigned int (*riscv_gnu_pltexit) (ElfW(Sym) *, unsigned int, \
54 uintptr_t *, uintptr_t *, \
55 const struct La_riscv_regs *, \
56 struct La_riscv_retval *, \
57 --
58 2.17.1
59