Skip to contentSkip to conversation

canopenterm: Disable pinning lua to expect c89

PATCH New Khem Raj 1 participant 1 message Mar 24

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 canopenterm: Disable pinning lua to expect c89

Fixes build with latest lua

---
 ...o-not-pin-to-c89-constructs-on-linux.patch | 33 +++++++++++++++++++
 .../canopenterm/canopenterm_1.0.13.bb         |  3 +-
 2 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-extended/canopenterm/canopenterm/0001-cmake-Do-not-pin-to-c89-constructs-on-linux.patch
meta-oe/recipes-extended/canopenterm/canopenterm/0001-cmake-Do-not-pin-to-c89-constructs-on-linux.patch new file +33 -0
new file mode 100644
index 0000000000..e6213c473d
@@ -0,0 +1,33 @@
+From 694563e023a296ecfd4c73fac681509323c14ada Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 24 Mar 2026 10:01:59 -0700
+Subject: [PATCH] cmake: Do not pin to c89 constructs on linux
+
+This does not work with latest lua
+
+Fixes
+|    91 | #error "POSIX is not compatible with C89"
+|       |  ^
+| 1 error generated.
+| [44/51] Building C object CMakeFiles/crossline.dir/src/crossline/crossline.c.o
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ cmake/os_linux.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmake/os_linux.cmake b/cmake/os_linux.cmake
+index 7096cbd..ef18d56 100644
+--- a/cmake/os_linux.cmake
++++ b/cmake/os_linux.cmake
+@@ -56,7 +56,7 @@ if (BUILD_YOCTO)
+     if (LUA_FOUND)
+         include_directories(${LUA_INCLUDE_DIR})
+         set(PLATFORM_LIBS ${PLATFORM_LIBS} ${LUA_LIBRARIES})
+-        add_compile_definitions(LUA_USE_C89 LUA_USE_LINUX)
++        add_compile_definitions(LUA_USE_LINUX)
+     else()
+         message(FATAL_ERROR "Lua not found")
+     endif()
meta-oe/recipes-extended/canopenterm/canopenterm_1.0.13.bb +2 -1
index a81ed30f72..25c7d97451 100644
@@ -15,7 +15,8 @@ LIC_FILES_CHKSUM = "file://LICENSE.md;md5=5f8a62fabd50ce3f1d7794bc849ae7a5"
 
 DEPENDS = "cjson libinih libsdl3 lua libsocketcan pocketpy"
 
-SRC_URI = "git://github.com/CANopenTerm/CANopenTerm.git;protocol=https;branch=main"
+SRC_URI = "git://github.com/CANopenTerm/CANopenTerm.git;protocol=https;branch=main \
+           file://0001-cmake-Do-not-pin-to-c89-constructs-on-linux.patch"
 
 SRCREV  = "b0555360e5e8b444a2a9e14088fd253412184eb8"