Skip to content

Commit

Permalink
scripts/sorttable: riscv: fix undeclared identifier 'EM_RISCV' error
Browse files Browse the repository at this point in the history
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: 54fed35 ("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]>
  • Loading branch information
milesdotchen authored and torvalds committed Sep 24, 2021
1 parent 9c0f0a0 commit d09c387
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/sorttable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand Down

0 comments on commit d09c387

Please sign in to comment.