1
0
mirror of https://github.com/openwrt/openwrt.git synced 2025-10-30 07:49:23 +08:00
Files
openwrt/toolchain/fortify-headers/patches/012-poll-Check-if-_REDIR_TIME64-is-defined.patch
Hauke Mehrtens 61f16a6960 toolchain: fortify-headers: Fix build of some packages
Fix some warnings and compile errors generated by the new
fortify-headers when compiling some applications like strace.

Fixes: 6268692bd2 ("toolchain: fortify-headers: Update to version 2.3.3")
Link: https://github.com/openwrt/openwrt/pull/20561
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-27 00:47:43 +01:00

33 lines
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sun, 26 Oct 2025 23:15:30 +0100
Subject: poll: Check if _REDIR_TIME64 is defined
Treat _REDIR_TIME64 being undefined like being set to 0.
This fixes the following compile error in strace:
```
In file included from pathtrace.c:12:
/include/fortify/poll.h:46:30: error: "_REDIR_TIME64" is not defined, evaluates to 0 [-Werror=undef]
46 | #if defined(_GNU_SOURCE) && !_REDIR_TIME64
| ^~~~~~~~~~~~~
cc1: all warnings being treated as errors
```
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
include/poll.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/include/poll.h
+++ b/include/poll.h
@@ -43,7 +43,7 @@ _FORTIFY_FN(poll) int poll(struct pollfd
return __orig_poll(__f, __n, __s);
}
-#if defined(_GNU_SOURCE) && !_REDIR_TIME64
+#if defined(_GNU_SOURCE) && (!defined(_REDIR_TIME64) || !_REDIR_TIME64)
#undef ppoll
#if __has_builtin(__builtin_ppoll)
__diagnose_as_builtin(__builtin_ppoll, 1, 2, 3, 4)