From 194fe553462c21b0f242afdd0c99c59db8d00e84 Mon Sep 17 00:00:00 2001 From: guominx Date: Thu, 2 Apr 2026 17:11:39 +0000 Subject: [PATCH] iox-#XXXX Auto-detect sys/acl.h availability on Linux On Linux, IOX_PLATFORM_FEATURE_ACL previously defaulted to ON unconditionally. This causes build failures when using hermetic toolchains (e.g. Zig/clang sysroots) that do not provide sys/acl.h or libacl. Use CMake's check_include_file to probe for sys/acl.h at configure time. If the header is absent, default IOX_PLATFORM_FEATURE_ACL to OFF so the existing no-op stub is used instead. The option can still be overridden explicitly by the user. This unblocks hermetic and minimal toolchain builds without requiring out-of-tree patches (e.g. rules_ros2_iceoryx_no_acl.patch). Co-Authored-By: Claude Sonnet 4.6 (1M context) --- .../linux/cmake/IceoryxPlatformDeployment.cmake | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/iceoryx_platform/linux/cmake/IceoryxPlatformDeployment.cmake b/iceoryx_platform/linux/cmake/IceoryxPlatformDeployment.cmake index b434a1b7e0..cad7d817fb 100644 --- a/iceoryx_platform/linux/cmake/IceoryxPlatformDeployment.cmake +++ b/iceoryx_platform/linux/cmake/IceoryxPlatformDeployment.cmake @@ -38,7 +38,16 @@ configure_option( DEFAULT_VALUE "/etc/" ) -option(IOX_PLATFORM_FEATURE_ACL "Use ACLs for access control" ON) +include(CheckIncludeFile) +check_include_file("sys/acl.h" IOX_HAVE_SYS_ACL_H) +if(IOX_HAVE_SYS_ACL_H) + set(IOX_PLATFORM_FEATURE_ACL_DEFAULT ON) +else() + message(STATUS "[i] sys/acl.h not found - disabling ACL support (hermetic or minimal toolchain detected)") + set(IOX_PLATFORM_FEATURE_ACL_DEFAULT OFF) +endif() + +option(IOX_PLATFORM_FEATURE_ACL "Use ACLs for access control" ${IOX_PLATFORM_FEATURE_ACL_DEFAULT}) message(STATUS "[i] IOX_PLATFORM_FEATURE_ACL: ${IOX_PLATFORM_FEATURE_ACL}") message(STATUS "[i] <<<<<<<<<<<<<< End iceoryx_platform configuration: >>>>>>>>>>>>>>")