kexec-tools: fix multiple compile errors
authorTony Ambardar <itugrok@yahoo.com>
Sat, 8 Jun 2024 05:03:30 +0000 (22:03 -0700)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 8 Jun 2024 12:08:38 +0000 (14:08 +0200)
commit1cb489c7849843116d365f727cec4c1e34c426ba
tree7b66de18e1a519c8094fcc1baeb7fcef2ddc5224
parent80d1c353b79e6c216dcb2534420470e3e6ed5d60
kexec-tools: fix multiple compile errors

Add two patches to fix compile errors being repeatedly seen on OpenWrt CI.

The first is an upstream backport to fix this i386-related error:

  x86_64-openwrt-linux-musl-gcc  -mcmodel=large -I./purgatory/include
  -I./purgatory/arch/x86_64/include -I./util_lib/include -I./include -Iinclude
  -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-x86_64_gcc-13.3.0_musl/lib/gcc/x86_64-openwrt-linux-musl/13.3.0/include
  -c -MD -o purgatory/arch/i386/entry32-16.o purgatory/arch/i386/entry32-16.S
  purgatory/arch/i386/entry32-16.S: Assembler messages:
  purgatory/arch/i386/entry32-16.S:23: Error: 64bit mode not supported on `i386'.

The second addresses an error using basename() on musl libc:

  kexec/arch/i386/x86-linux-setup.c: In function 'add_edd_entry':
  kexec/arch/i386/x86-linux-setup.c:332:20: warning: implicit declaration of function 'basename' [-Wimplicit-function-declaration]
    332 |         if (sscanf(basename(sysfs_name), "int13_dev%hhx", &devnum) != 1) {
        |                    ^~~~~~~~
  kexec/arch/i386/x86-linux-setup.c:332:20: warning: passing argument 1 of 'sscanf' makes pointer from integer without a cast [-Wint-conversion]
    332 |         if (sscanf(basename(sysfs_name), "int13_dev%hhx", &devnum) != 1) {
        |                    ^~~~~~~~~~~~~~~~~~~~
        |                    |
        |                    int
  ...

Fixes: #14621
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
package/boot/kexec-tools/Makefile
package/boot/kexec-tools/patches/010-Fix-building-on-x86_64-with-binutils-2.41.patch [new file with mode: 0644]
package/boot/kexec-tools/patches/020-i386-improve-basename-compatibility.patch [new file with mode: 0644]