Skip to contentSkip to conversation

ubi-utils-klibc: Fix build with clang

PATCH New Khem Raj 1 participant 2 messages Feb 6, 2021

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 ubi-utils-klibc: Fix build with clang

Cc Andrea Adami <[email protected]>
---
 ...make-Add-compiler-includes-in-cflags.patch | 32 +++++++++++++++++++
 .../mtd/ubi-utils-klibc_2.0.2.bb              |  1 +
 2 files changed, 33 insertions(+)
 create mode 100644 meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc-2.0.2/0001-make-Add-compiler-includes-in-cflags.patch
meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc-2.0.2/0001-make-Add-compiler-includes-in-cflags.patch new file +32 -0
new file mode 100644
index 0000000000..778d830128
@@ -0,0 +1,32 @@
+From 884ec4c654f1d07a387fdc1dae5640606369f254 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 6 Feb 2021 10:56:36 -0800
+Subject: [PATCH] make: Add compiler includes in cflags
+
+Fixes
+ In file included from ../git/ubi-utils/ubiformat.c:47:
+| ../git/include/common.h:22:10: fatal error: 'stdbool.h' file not found
+| #include <stdbool.h>
+|          ^~~~~~~~~~~
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index 5a6e77c..f0003d5 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -9,6 +9,7 @@ endif
+ if WITHOUT_LZO
+ AM_CPPFLAGS += -DWITHOUT_LZO
+ endif
++AM_CPPFLAGS += -I$(shell $(CC) -print-file-name=include)
+ 
+ sbin_PROGRAMS =
+ sbin_SCRIPTS =
+-- 
+2.30.0
+
meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_2.0.2.bb +1 -0
index d322381621..5f43b0229a 100644
@@ -16,6 +16,7 @@ SRC_URI = "git://git.infradead.org/mtd-utils.git \
              file://0003-Makefile.am-only-build-ubi-utils.patch \
              file://0004-mtd-utils-common.h-no-features.h-for-klibc-builds.patch \
              file://0005-common.h-replace-getline-with-fgets.patch \
+             file://0001-make-Add-compiler-includes-in-cflags.patch \
              "
 
 S = "${WORKDIR}/git"
Signature · 1 line
2.30.0
author
#1 lore raw

PATCH 2/2 kexecboot: Fix build with clang

Cc Andrea Adami <[email protected]>
---
 ...make-Add-compiler-includes-in-cflags.patch | 31 +++++++++++++++++++
 .../recipes-bsp/kexecboot/kexecboot_git.bb    |  6 ++--
 2 files changed, 35 insertions(+), 2 deletions(-)
 create mode 100644 meta-initramfs/recipes-bsp/kexecboot/files/0001-make-Add-compiler-includes-in-cflags.patch
meta-initramfs/recipes-bsp/kexecboot/files/0001-make-Add-compiler-includes-in-cflags.patch new file +31 -0
new file mode 100644
index 0000000000..931d0fa584
@@ -0,0 +1,31 @@
+From 528a64d17488295299dad9fbfe3d7140bc1cfdfa Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 6 Feb 2021 11:06:48 -0800
+Subject: [PATCH] make: Add compiler includes in cflags
+
+Fixes
+| In file included from /mnt/b/yoe/master/build/tmp/work/raspberrypi4_64-yoe-linux/kexecboot-klibc/0.6+gitAUTOINC+5a5e04be20-r0/recipe-sysroot/usr/lib/klibc/include/stdio.h:11:
+| /mnt/b/yoe/master/build/tmp/work/raspberrypi4_64-yoe-linux/kexecboot-klibc/0.6+gitAUTOINC+5a5e04be20-r0/recipe-sysroot/usr/lib/klibc/include/stdarg.h:9:15: fatal error: 'stdarg.h' file not found
+| #include_next <stdarg.h>
+|               ^~~~~~~~~~
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index c75df23..d2adf38 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -1,6 +1,6 @@
+ bin_PROGRAMS=kexecboot
+ 
+-kexecboot_CFLAGS = -I$(top_srcdir) $(AM_CFLAGS)
++kexecboot_CFLAGS = -I$(top_srcdir) $(AM_CFLAGS) -I$(shell $(CC) -print-file-name=include)
+ 
+ kexecboot_SOURCES = \
+ 	util.c \
+-- 
+2.30.0
+
meta-initramfs/recipes-bsp/kexecboot/kexecboot_git.bb +4 -2
index 2f46fa9523..ad9ccd02c6 100644
@@ -6,8 +6,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 PV = "0.6+git${SRCPV}"
 S = "${WORKDIR}/git"
 SRC_URI = "git://github.com/kexecboot/kexecboot.git"
-SRC_URI_append_libc-klibc = " file://0001-kexecboot-Use-new-reboot-API-with-klibc.patch "
-
+SRC_URI_append_libc-klibc = "\
+    file://0001-kexecboot-Use-new-reboot-API-with-klibc.patch \
+    file://0001-make-Add-compiler-includes-in-cflags.patch \
+"
 SRCREV = "5a5e04be206140059f42ac786d424da1afaa04b6"
 inherit autotools
 
Signature · 1 line
2.30.0