aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Chen <[email protected]>2021-09-24 15:43:38 -0700
committerLinus Torvalds <[email protected]>2021-09-24 16:13:35 -0700
commitd09c38726c78effaf910a1e3f31e247b5b031d56 (patch)
tree2ae5e9ab6216dda11f45b95608adb102453f3056
parent9c0f0a03e386f4e1df33db676401547e1b7800c6 (diff)
scripts/sorttable: riscv: fix undeclared identifier 'EM_RISCV' error
Fix the following build failure reported in [1] by adding a conditional definition of EM_RISCV in order to allow cross-compilation on machines which do not have EM_RISCV definition in their host. scripts/sorttable.c:352:7: error: use of undeclared identifier 'EM_RISCV' EM_RISCV was added to <elf.h> in glibc 2.24 so builds on systems with glibc headers < 2.24 should show this error. [[email protected]: changelog addition] Link: https://lore.kernel.org/lkml/[email protected]/ [1] Link: https://lkml.kernel.org/r/[email protected] Fixes: 54fed35fd393 ("riscv: Enable BUILDTIME_TABLE_SORT") Signed-off-by: Miles Chen <[email protected]> Reported-by: Stefan Wahren <[email protected]> Tested-by: Stefan Wahren <[email protected]> Reviewed-by: Jisheng Zhang <[email protected]> Cc: Michal Kubecek <[email protected]> Cc: Paul Walmsley <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: Albert Ou <[email protected]> Cc: Markus Mayer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--scripts/sorttable.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/sorttable.c b/scripts/sorttable.c
index f355869c65cd..6ee4fa882919 100644
--- a/scripts/sorttable.c
+++ b/scripts/sorttable.c
@@ -54,6 +54,10 @@
#define EM_ARCV2 195
#endif
+#ifndef EM_RISCV
+#define EM_RISCV 243
+#endif
+
static uint32_t (*r)(const uint32_t *);
static uint16_t (*r2)(const uint16_t *);
static uint64_t (*r8)(const uint64_t *);