kumquat-buildroot/package/efivar/efivar.mk
Julien Olivain 077741623f package/efivar: bump to version 39 to fix build failures
For release note since version 38, see [1].

This commit introduces changes in package patches:

- 0001: Patch dropped. An similar change is included in this release.
  See [2].
- 0002: Patch no longer needed since the package build recipe sets
  CFLAGS without -Werror, and the package makefile sets -Werror only
  by default. See [3], included since version 38.
- 0003: Rebased on version 39 and renamed to 0001. The patch is also
  flagged as "Upstream: Not applicable".
- 0004: Patch dropped. Included in this release. See [4].

This commit also removes all patch entries in ".checkpackageignore"
(since the remaining patch has its "Upstream:" tag).

This version 39 also fixes few build failures. Those can be seen by
running the command "utils/test-pkg -a -p efivar". The first group
of build failures is:

                br-arm-basic [28/45]: FAILED
       br-i386-pentium4-full [31/45]: FAILED
          br-mips64-n64-full [33/45]: FAILED
     br-mips64r6-el-hf-glibc [34/45]: FAILED
              linaro-aarch64 [38/45]: FAILED
                  linaro-arm [39/45]: FAILED

Fixes:

    /buildroot/host/opt/ext-toolchain/bin/../lib/gcc/aarch64-linux-gnu/7.3.1/../../../../aarch64-linux-gnu/bin/ld: .data not found for insert
    collect2: error: ld returned 1 exit status

efivar 38 was using linker scripts, which was not working in all
cases. Those issues are fixed by the upstream commit [5] which
removes the use of this linker script (included in this release).

The "test-pkg -a -p efivar" also caught another kind of build
failures:

    br-i386-pentium-mmx-musl [32/45]: FAILED

Fixes:

    In file included from efivar.h:18,
                     from efisec.h:24,
                     from secdb-dump.c:7:
    list.h: In function 'list_sort':
    list.h:152:2: warning: implicit declaration of function 'qsort_r'; did you mean 'qsort'? [-Wimplicit-function-declaration]
      152 |  qsort_r(array, nmemb, sizeof(*array), cmp, state);
          |  ^~~~~~~
          |  qsort

Those failures were introduced in commit f24029b561 "package/efivar:
bump to version 38". This is because efivar introduced a usage of the
qsort_r() libc function, in upstream commit [6], first included in
version 38.

Musl libc added the qsort_r() function in upstream commit [7], included in
version v1.2.3 (2022-04-07).  So external toolchains including a Musl older
than this version will fail.  But given how old this issue is (musql 1.2.3
is included in Buildroot since 2022.05), this issue is ignored.

uClibc-ng external toolchains are also not affected, since it added
the qsort_r() function in commit [8] included since its first version
v1.0.0 (2015-02-02). So there is no need to exclude external uclibc
toolchains.

[1] https://github.com/rhboot/efivar/releases/tag/39
[2] 4f3da3dc35
[3] 998f617cec
[4] cece3ffd5b
[5] cfd686de51
[6] 62afa2aa58
[7] https://git.musl-libc.org/cgit/musl/commit/?id=b76f37fd5625d038141b52184956fb4b7838e9a5
[8] 515d544331

Signed-off-by: Julien Olivain <ju.o@free.fr>
[Peter: drop dependency on !external musl]
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2024-03-04 08:25:44 +01:00

61 lines
1.6 KiB
Makefile

################################################################################
#
# efivar
#
################################################################################
EFIVAR_VERSION = 39
EFIVAR_SITE = $(call github,rhboot,efivar,$(EFIVAR_VERSION))
EFIVAR_LICENSE = LGPL-2.1
EFIVAR_LICENSE_FILES = COPYING
EFIVAR_INSTALL_STAGING = YES
EFIVAR_DEPENDENCIES = host-efivar
# -fPIC is needed at least on MIPS, otherwise fails to build shared
# -library.
# SUBDIRS is redefined so it skips building docs.
# LD_DASH_T is redefined as the linker detection does not seem to
# work properly for cross-compilation.
EFIVAR_MAKE_OPTS = \
libdir=/usr/lib \
LDFLAGS="$(TARGET_LDFLAGS) -fPIC" \
TOPDIR=$(@D) \
SUBDIRS=src \
LD_DASH_T=-T
define HOST_EFIVAR_BUILD_CMDS
# makeguids is an internal host tool and must be built separately with
# $(HOST_CC), otherwise it gets cross-built.
$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) \
CFLAGS="$(HOST_CFLAGS) -std=gnu99" \
TOPDIR=$(@D) CFLAGS_GCC= \
$(MAKE) -C $(@D)/src makeguids
endef
define EFIVAR_BUILD_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D) \
$(EFIVAR_MAKE_OPTS) \
all
endef
define HOST_EFIVAR_INSTALL_CMDS
$(INSTALL) -D -m 0755 $(@D)/src/makeguids $(HOST_DIR)/bin/makeguids
endef
define EFIVAR_INSTALL_STAGING_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D) \
$(EFIVAR_MAKE_OPTS) \
DESTDIR="$(STAGING_DIR)" \
install
endef
define EFIVAR_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D) \
$(EFIVAR_MAKE_OPTS) \
DESTDIR="$(TARGET_DIR)" \
install
endef
$(eval $(generic-package))
$(eval $(host-generic-package))