diff mbox series

[meta-multimedia,5/8] clight: Fix build with musl

Message ID 20261019004122.2475327-5-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-oe,1/8] luajit: Set TARGET_SYS to Linux for musl targets | expand

Commit Message

Khem Raj Oct. 19, 2026, 12:41 a.m. UTC
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>
---
 ...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