scripts/sorttable: riscv: fix undelcred identifier 'EM_RISCV' error
Subsystems (2)
PATCH 1/1 scripts/sorttable: riscv: fix undelcred identifier 'EM_RISCV' error
Fix the following build break 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.
build break log from [1]:scripts/sorttable.c:352:7: error: use of undeclared identifier 'EM_RISCV'
[1] https://lore.kernel.org/lkml/[email protected]/
--- scripts/sorttable.c | 4 ++++ 1 file changed, 4 insertions(+)
scripts/sorttable.c +4 -0
@@ -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 *);
Signature · 1 line
2.18.0
Thanks
Quoted 6 lines · On Mon, 13 Sep 2021 11:06:25 +0800 Miles Chen <[email protected]> wrote:
Fix the following build break by adding a conditional definition of
EM_RISCVin order to allow cross-compilation on machines which do not haveEM_RISCVdefinition in their host.build break log from [1]:
scripts/sorttable.c:352:7: error: use of undeclared identifier 'EM_RISCV'
Looks strange I can't reproduce it. FWICT, this may be seen with some old toolchains.
Quoted 7 lines
[1] https://lore.kernel.org/lkml/[email protected]/
Cc Jisheng Zhang <[email protected]>Reported-by Stefan Wahren <[email protected]>Fixes 54fed35fd393 ("riscv: Enable BUILDTIME_TABLE_SORT")Signed-off-by Miles Chen <[email protected]>
Quoted 9 lines
--- scripts/sorttable.c | 4 ++++ 1 file changed, 4 insertions(+)scripts/sorttable.c +0
-0
scripts/sorttable.c line 63
Quoted 10 lines
scripts/sorttable.c +4
-0@@ -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 *);
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Quoted 7 lines · Jisheng Zhang
Quoted 4 lines · On Mon, 13 Sep 2021 11:06:25 +0800 Miles Chen <[email protected]> wrote:
Fix the following build break by adding a conditional definition of
EM_RISCVin order to allow cross-compilation on machines which do not haveEM_RISCVdefinition in their host.
Quoted 5 lines
Quoted 2 lines
build break log from [1]:
scripts/sorttable.c:352:7: error: use of undeclared identifier 'EM_RISCV'Looks strange I can't reproduce it. FWICT, this may be seen with some old toolchains.
I checked the history and EM_RISCV was added to <elf.h> in glibc 2.24 so builds on systems with glibc headers < 2.24 should show this error.
Michal
Quoted 35 lines
Quoted 6 lines
[1] https://lore.kernel.org/lkml/[email protected]/
Cc Jisheng Zhang <[email protected]>Reported-by Stefan Wahren <[email protected]>Fixes 54fed35fd393 ("riscv: Enable BUILDTIME_TABLE_SORT")Signed-off-by Miles Chen <[email protected]>Reviewed-by Jisheng Zhang <[email protected]>Quoted 9 lines
--- scripts/sorttable.c | 4 ++++ 1 file changed, 4 insertions(+)scripts/sorttable.c +0
-0scripts/sorttable.c line 63
Quoted 10 lines
scripts/sorttable.c +4
-0@@ -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 *);_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
cc Andrew,
Quoted 16 lines · Michal Kubecek
Quoted 7 lines · Jisheng Zhang
Quoted 4 lines · On Mon, 13 Sep 2021 11:06:25 +0800 Miles Chen <[email protected]> wrote:
Fix the following build break by adding a conditional definition of
EM_RISCVin order to allow cross-compilation on machines which do not haveEM_RISCVdefinition in their host.Quoted 7 lines
Quoted 3 lines
build break log from [1]:
scripts/sorttable.c:352:7: error: use of undeclared identifier 'EM_RISCV'Looks strange I can't reproduce it. FWICT, this may be seen with some old
toolchains.
Quoted 16 lines
I checked the history and
EM_RISCVwas added to <elf.h> in glibc 2.24 so
builds on systems with glibc headers < 2.24 should show this error.Michal
Quoted 10 lines
Quoted 8 lines
Cc Jisheng Zhang <[email protected]>Reported-by Stefan Wahren <[email protected]>Fixes 54fed35fd393 ("riscv: Enable BUILDTIME_TABLE_SORT")Signed-off-by Miles Chen <[email protected]>Reviewed-by Jisheng Zhang <[email protected]>
Hi Andrew,
I cannot find the maintainer for scripts/sorttable.c, would you pick up this change, please?
thanks
Miles
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
--- scripts/sorttable.c | 4 ++++ 1 file changed, 4 insertions(+)scripts/sorttable.c +0
-0@@ -54,6 +54,10 @@#define EM_ARCV2 195#endif
Quoted 14 lines
Quoted 5 lines
Quoted 5 lines
scripts/sorttable.c +4
-0+#ifndef EM_RISCV +#define EM_RISCV 243 +#endif +static uint32_t (*r)(const uint32_t *);Quoted 9 lines
scripts/sorttable.c line 63
Quoted 2 lines
scripts/sorttable.c +0
-0static uint16_t (*r2)(const uint16_t *);static uint64_t (*r8)(const uint64_t *);_______________________________________________
Linux-mediatek mailing list
[email protected]
Quoted 1 line
Quoted 1 line
Quoted 21 lines · Miles Chen
cc Andrew,
Quoted 18 lines · Michal Kubecek
Quoted 7 lines · Jisheng Zhang
Quoted 4 lines · On Mon, 13 Sep 2021 11:06:25 +0800 Miles Chen <[email protected]> wrote:
Fix the following build break by adding a conditional definition of
EM_RISCVin order to allow cross-compilation on machines which do not haveEM_RISCVdefinition in their host.Quoted 6 lines
Quoted 3 lines
build break log from [1]:
scripts/sorttable.c:352:7: error: use of undeclared identifier 'EM_RISCV'Looks strange I can't reproduce it. FWICT, this may be seen with some old toolchains.
I checked the history and
EM_RISCVwas added to <elf.h> in glibc 2.24 so builds on systems with glibc headers < 2.24 should show this error.
This is happening for us when we try to build ARM(64) cross-builds on Ubuntu 16.04. Yes, I know, that's a fairly old distro. At the same time it isn't ancient (extended support is still available), and it *should* be possible to build the 5.15 kernel on it.
And yes, some of our build machines have been updated to Ubuntu 20.04, but not all of them. We'll get there eventually. For now this error is posing a bit of a problem.
Quoted 11 lines
Quoted 11 lines
Michal
Quoted 9 lines
Quoted 8 lines
Cc Jisheng Zhang <[email protected]>Reported-by Stefan Wahren <[email protected]>Fixes 54fed35fd393 ("riscv: Enable BUILDTIME_TABLE_SORT")Signed-off-by Miles Chen <[email protected]>
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Reviewed-by Jisheng Zhang <[email protected]>Hi Andrew,
I cannot find the maintainer for
scripts/sorttable.c, would you pick up this change, please?
Yes, please. I've been looking at failed nightly builds since September
12. It's only a forward looking build (so nothing mission critical), but it would still be nice to have it build again.
Regards,
-Markus
Quoted 23 lines
thanks
MilesQuoted 20 lines
Quoted 20 lines
Quoted 20 lines
--- scripts/sorttable.c | 4 ++++ 1 file changed, 4 insertions(+)scripts/sorttable.c +4
-0@@ -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 *);