diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp
index 7d930cd6b99e..a44bd941e615 100644
--- a/src/libcamera/log.cpp
+++ b/src/libcamera/log.cpp
@@ -49,6 +49,15 @@
 
 namespace libcamera {
 
+
+/*
+ * secure_getenv is a GNU-specific extension to the C-Library.
+ * fall back to the default getenv when it is not available.
+ */
+#ifndef HAVE_SECURE_GETENV
+#define secure_getenv getenv
+#endif
+
 /**
  * \brief Message logger
  *
