diff mbox series

[wrynose,meta-multimedia,03/10] clight: Fix build with musl

Message ID 20261109060030.621745-3-anuj.mittal@oss.qualcomm.com
State Under Review
Delegated to: Anuj Mittal
Headers show
Series [wrynose,meta-oe,01/10] fwupd-efi: Use the cross linker instead of the host ld.bfd | expand

Commit Message

Anuj Mittal Nov. 9, 2026, 6 a.m. UTC
From: Khem Raj <khem.raj@oss.qualcomm.com>

log.c uses open() and O_* flags without including <fcntl.h>, which
glibc pulls in indirectly but musl does not, so clang fails with
-Wimplicit-function-declaration.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
(cherry picked from commit c794b5fe79dc2d05652763ede841621f7f7918b0)
Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
---
 ...nclude-fcntl.h-for-open-and-O_-flags.patch | 27 +++++++++++++++++++
 .../recipes-multimedia/clight/clight_4.11.bb  |  1 +
 2 files changed, 28 insertions(+)
 create mode 100644 meta-multimedia/recipes-multimedia/clight/clight/0001-log-Include-fcntl.h-for-open-and-O_-flags.patch
diff mbox series

Patch

diff --git a/meta-multimedia/recipes-multimedia/clight/clight/0001-log-Include-fcntl.h-for-open-and-O_-flags.patch b/meta-multimedia/recipes-multimedia/clight/clight/0001-log-Include-fcntl.h-for-open-and-O_-flags.patch
new file mode 100644
index 0000000000..0faeb84402
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/clight/clight/0001-log-Include-fcntl.h-for-open-and-O_-flags.patch
@@ -0,0 +1,27 @@ 
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Khem Raj <khem.raj@oss.qualcomm.com>
+Date: Sun, 18 Oct 2026 17:05:19 -0700
+Subject: [PATCH] log: Include fcntl.h for open() and O_* flags
+
+open(), O_CREAT and O_WRONLY are declared in <fcntl.h>, which glibc
+happens to pull in through other headers but musl does not, so the
+build fails with clang:
+
+  src/utils/log.c:33:14: error: call to undeclared function 'open'
+
+Upstream-Status: Pending
+AI-Generated: Uses Claude Code
+Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
+---
+ src/utils/log.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/utils/log.c b/src/utils/log.c
+index 0ec38a5..8d46b90 100644
+--- a/src/utils/log.c
++++ b/src/utils/log.c
+@@ -1,3 +1,4 @@
++#include <fcntl.h>
+ #include <sys/file.h>
+ #include <sys/stat.h>
+ #include "utils.h"
diff --git a/meta-multimedia/recipes-multimedia/clight/clight_4.11.bb b/meta-multimedia/recipes-multimedia/clight/clight_4.11.bb
index 6280bd21b0..6f797ad601 100644
--- a/meta-multimedia/recipes-multimedia/clight/clight_4.11.bb
+++ b/meta-multimedia/recipes-multimedia/clight/clight_4.11.bb
@@ -7,6 +7,7 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
 SRCREV = "6a5ad96ce7643c433ea2f6bd597bc52dcc744120"
 SRC_URI = "git://github.com/FedeDP/${BPN};protocol=https;branch=master;tag=${PV} \
+           file://0001-log-Include-fcntl.h-for-open-and-O_-flags.patch \
 "
 
 inherit cmake pkgconfig features_check