fortify-headers: fix inconsistent time_t version of ppoll
authorGeorgi Valkov <gvalkov@gmail.com>
Wed, 10 May 2023 00:02:29 +0000 (03:02 +0300)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 12 May 2023 10:16:11 +0000 (12:16 +0200)
Bug:
fortify/poll.h includes poll.h, which redirects ppoll to __ppoll_time64
if the _REDIR_TIME64 macro is 1. Then fortify/poll.h will #undef ppoll
and use the 32 bit version.

Fix: we should not do this when _REDIR_TIME64 is 1.

[1] https://forum.openwrt.org/t/idle-cpu-usage-of-usbmuxd/140331/15
[2] https://github.com/openwrt/openwrt/issues/12574

Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
toolchain/fortify-headers/Makefile
toolchain/fortify-headers/patches/001-__ppoll_time64.patch [new file with mode: 0644]

index 904a10066cbfe8db41dba2a80fafc7ab7e734006..1950eb1fdc88e128dba73f2ac785958fd2210f42 100644 (file)
@@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/target.mk
 
 PKG_NAME:=fortify-headers
 PKG_VERSION:=1.1
-PKG_RELEASE=1
+PKG_RELEASE=2
 
 PKG_SOURCE_URL:=https://dl.2f30.org/releases
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
diff --git a/toolchain/fortify-headers/patches/001-__ppoll_time64.patch b/toolchain/fortify-headers/patches/001-__ppoll_time64.patch
new file mode 100644 (file)
index 0000000..9c6fea3
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/include/poll.h
++++ b/include/poll.h
+@@ -39,7 +39,7 @@ _FORTIFY_FN(poll) int poll(struct pollfd
+       return __orig_poll(__f, __n, __s);
+ }
+-#ifdef _GNU_SOURCE
++#if defined(_GNU_SOURCE) && !_REDIR_TIME64
+ #undef ppoll
+ _FORTIFY_FN(ppoll) int ppoll(struct pollfd *__f, nfds_t __n, const struct timespec *__s,
+                              const sigset_t *__m)