From 20041b2163e7f7be47f4cea066f8c079e25ba260 Mon Sep 17 00:00:00 2001 From: Ingar Date: Mon, 23 Feb 2026 20:29:28 +0100 Subject: Updated to 0.7.0-rpt20260205. --- libcamera-fix-python3.14-macro-redefinition.patch | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 libcamera-fix-python3.14-macro-redefinition.patch (limited to 'libcamera-fix-python3.14-macro-redefinition.patch') diff --git a/libcamera-fix-python3.14-macro-redefinition.patch b/libcamera-fix-python3.14-macro-redefinition.patch new file mode 100644 index 0000000..92e41c8 --- /dev/null +++ b/libcamera-fix-python3.14-macro-redefinition.patch @@ -0,0 +1,36 @@ +From 0f580ec44434651ee30d68656dcdb8e7d91f082b Mon Sep 17 00:00:00 2001 +From: Carl Smedstad +Date: Sun, 15 Feb 2026 07:09:45 +0100 +Subject: [PATCH] py: Fix _POSIX_C_SOURCE and _XOPEN_SOURCE redefinition with + Python 3.14 + +Python 3.14's pyconfig.h defines _POSIX_C_SOURCE as 200809L and _XOPEN_SOURCE +as 700, but glibc's features.h now defines them as 202405L and 800 +respectively. When C++ standard library headers are included before Python.h, +features.h sets the newer values first, and pyconfig.h's redefinition triggers +a warning that -Werror turns into an error. + +Fix by adding -include Python.h to the Python bindings compiler args, ensuring +pyconfig.h is processed first. This causes features.h to see _GNU_SOURCE +(defined by pyconfig.h) and safely #undef the macros before redefining them. + +Co-Authored-By: Claude Opus 4.6 +--- + src/py/libcamera/meson.build | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build +index b0bd291f..c01f702f 100644 +--- a/src/py/libcamera/meson.build ++++ b/src/py/libcamera/meson.build +@@ -55,6 +55,7 @@ pycamera_args = [ + '-fvisibility=hidden', + '-Wno-shadow', + '-DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT', ++ '-include', 'Python.h', + ] + + if meson.is_cross_build() +-- +2.53.0 + -- cgit v1.2.3