aboutsummaryrefslogtreecommitdiff
path: root/libs/efivar
diff options
context:
space:
mode:
authorTianling Shen <cnsztl@immortalwrt.org>2023-05-19 17:37:24 +0800
committerTianling Shen <cnsztl@gmail.com>2023-05-20 13:05:33 +0800
commitf03a2827ea2c2a8d8b63733b3dc75652b8530ae1 (patch)
tree27b754b07c7fbdd26fc5ea475d359e08b2d8b97d /libs/efivar
parentb9481f55d85dfca003606ca6bfbc55243ee74f9c (diff)
efivar: fix compilation with musl 1.2.4
musl 1.2.4 deprecated legacy "LFS64" ("large file support") interfaces so just having _GNU_SOURCE defined is not enough anymore. Backport an upstream fix to replace these old data types. Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Diffstat (limited to 'libs/efivar')
-rw-r--r--libs/efivar/Makefile2
-rw-r--r--libs/efivar/patches/003-Use-off_t-instead-of-off64_t.patch40
2 files changed, 41 insertions, 1 deletions
diff --git a/libs/efivar/Makefile b/libs/efivar/Makefile
index 63c2abe52..f0563ba7b 100644
--- a/libs/efivar/Makefile
+++ b/libs/efivar/Makefile
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=efivar
PKG_VERSION:=38
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/rhboot/efivar/releases/download/$(PKG_VERSION)
diff --git a/libs/efivar/patches/003-Use-off_t-instead-of-off64_t.patch b/libs/efivar/patches/003-Use-off_t-instead-of-off64_t.patch
new file mode 100644
index 000000000..0f1ac79cb
--- /dev/null
+++ b/libs/efivar/patches/003-Use-off_t-instead-of-off64_t.patch
@@ -0,0 +1,40 @@
+From 914c686cc54b2405dab08bff77cd60827aab54b1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 14 Dec 2022 16:55:51 -0800
+Subject: [PATCH] Use off_t instead of off64_t
+
+Pass _FILE_OFFSET_BITS=64 to ensure 64bit off_t
+
+This helps building efivar for 32bit arches on systems using musl C
+library. It works with glibc since _GNU_SOURCE defines
+_LARGEFILE64_SOURCE as well, this feature test macro enables the 64bit
+interfaces which were done as intermediate steps when transition to
+66-bit off_t was done as part olf LFS64 support.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/error.c | 2 +-
+ src/include/defaults.mk | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+--- a/src/error.c
++++ b/src/error.c
+@@ -191,7 +191,7 @@ dbglog_write(void *cookie, const char *b
+ }
+
+ static int
+-dbglog_seek(void *cookie UNUSED, off64_t *offset, int whence)
++dbglog_seek(void *cookie UNUSED, off_t *offset, int whence)
+ {
+ FILE *log = efi_errlog ? efi_errlog : stderr;
+ int rc;
+--- a/src/include/defaults.mk
++++ b/src/include/defaults.mk
+@@ -34,6 +34,7 @@ CPPFLAGS ?=
+ override _CPPFLAGS := $(CPPFLAGS)
+ override CPPFLAGS = $(_CPPFLAGS) -DLIBEFIVAR_VERSION=$(VERSION) \
+ -D_GNU_SOURCE \
++ -D_FILE_OFFSET_BITS=64 \
+ -I$(TOPDIR)/src/include/
+ CFLAGS ?= $(OPTIMIZE) $(DEBUGINFO) $(WARNINGS) $(ERRORS)
+ CFLAGS_GCC ?= -specs=$(TOPDIR)/src/include/gcc.specs \