[PATCH 2/2] RISC-V: Fix the undeclared ‘EM_RISCV’ build failure

Song Shuai songshuaishuai at tinylab.org
Fri Aug 11 03:41:17 PDT 2023


Use local `elf.h` instead of `linux/elf.h` to fix this build error:

```
kexec/arch/riscv/crashdump-riscv.c:17:13: error: ‘EM_RISCV’ undeclared here (not in a function); did you mean ‘EM_CRIS’?
  .machine = EM_RISCV,
             ^~~~~~~~
             EM_CRIS
```

Signed-off-by: Song Shuai <songshuaishuai at tinylab.org>
---
 kexec/arch/riscv/crashdump-riscv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kexec/arch/riscv/crashdump-riscv.c b/kexec/arch/riscv/crashdump-riscv.c
index 3ed4fe3..336d7a7 100644
--- a/kexec/arch/riscv/crashdump-riscv.c
+++ b/kexec/arch/riscv/crashdump-riscv.c
@@ -1,5 +1,5 @@
 #include <errno.h>
-#include <linux/elf.h>
+#include <elf.h>
 #include <unistd.h>
 
 #include "kexec.h"
-- 
2.20.1




More information about the kexec mailing list