Skip to contentSkip to conversation

package/efivar: fix build without threads

PATCH New Fabrice Fontaine 1 participant 1 message Feb 23, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/efivar: fix build without threads

Fix the following build failure without threads raised since bump to version 38 in commit f24029b561fbda0953c7dbd93d2485b03873996d and
https://github.com/rhboot/efivar/commit/cff88dd96b9d43e2c5875a24ba6180b196890ded:

thread-test.c:14:10: fatal error: pthread.h: No such file or directory
14 | #include <pthread.h>

      |          ^~~~~~~~~~~

Fixes:
- http://autobuild.buildroot.org/results/f2da14f91dc602a32dd5b2b7bdf3d3aa43afa7f4

---
 .../efivar/0005-Add-NO_THREADS-variable.patch | 54 +++++++++++++++++++
 package/efivar/efivar.mk                      |  4 ++
 2 files changed, 58 insertions(+)
 create mode 100644 package/efivar/0005-Add-NO_THREADS-variable.patch
package/efivar/0005-Add-NO_THREADS-variable.patch new file +54 -0
new file mode 100644
index 0000000000..fdd874ab70
@@ -0,0 +1,54 @@
+From 9fd025945212ab2b2bf71328588b2a5377655176 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Thu, 23 Feb 2023 11:46:38 +0100
+Subject: [PATCH] Add NO_THREADS variable
+
+Allow the user to disable building thread-test to avoid the following
+build failure without threads raised since version 38 and
+https://github.com/rhboot/efivar/commit/cff88dd96b9d43e2c5875a24ba6180b196890ded:
+
+thread-test.c:14:10: fatal error: pthread.h: No such file or directory
+   14 | #include <pthread.h>
+      |          ^~~~~~~~~~~
+
+Fixes:
+ - http://autobuild.buildroot.org/results/277f783c33102a0cea7c82ca902119ab90f37ad4
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Upstream status: https://github.com/rhboot/efivar/pull/238]
+---
+ src/Makefile            | 5 ++++-
+ src/include/defaults.mk | 1 +
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index ec1eabe..eb0427e 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -7,7 +7,10 @@ include $(TOPDIR)/src/include/defaults.mk
+ 
+ LIBTARGETS=libefivar.so libefiboot.so libefisec.so
+ STATICLIBTARGETS=libefivar.a libefiboot.a libefisec.a
+-BINTARGETS=efivar efisecdb thread-test
++BINTARGETS=efivar efisecdb
++ifeq ($(NO_THREADS),)
++BINTARGETS += thread-test
++endif
+ STATICBINTARGETS=efivar-static efisecdb-static
+ PCTARGETS=efivar.pc efiboot.pc efisec.pc
+ TARGETS=$(LIBTARGETS) $(BINTARGETS) $(PCTARGETS)
+diff --git a/src/include/defaults.mk b/src/include/defaults.mk
+index 630da23..9632887 100644
+--- a/src/include/defaults.mk
++++ b/src/include/defaults.mk
+@@ -8,6 +8,7 @@ BINDIR	?= $(EXEC_PREFIX)/bin
+ PCDIR	?= $(LIBDIR)/pkgconfig
+ DESTDIR	?=
+ PKGS	?=
++NO_THREADS ?=
+ 
+ CROSS_COMPILE	?=
+ COMPILER 	?= gcc
+-- 
+2.39.1
+
package/efivar/efivar.mk +4 -0
index 8b1d338bec..27ad7a39e2 100644
@@ -23,6 +23,10 @@ EFIVAR_MAKE_OPTS = \
 	SUBDIRS=src \
 	LD_DASH_T=-T
 
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
+EFIVAR_MAKE_OPTS += NO_THREADS=1
+endif
+
 define HOST_EFIVAR_BUILD_CMDS
 	# makeguids is an internal host tool and must be built separately with
 	# $(HOST_CC), otherwise it gets cross-built.
Signature · 6 lines
2.39.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot