ASR_BASE

Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/toolchain/fortify-headers/Makefile b/toolchain/fortify-headers/Makefile
new file mode 100644
index 0000000..7e6bad5
--- /dev/null
+++ b/toolchain/fortify-headers/Makefile
@@ -0,0 +1,30 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/target.mk
+
+PKG_NAME:=fortify-headers
+PKG_VERSION:=1.1
+PKG_RELEASE=3
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/jvoisin/$(PKG_NAME).git
+PKG_SOURCE_DATE:=2019-04-14
+PKG_SOURCE_VERSION:=e3fee64643279c144efd3d6856ed4e818c0d5ca2
+PKG_MIRROR_HASH:=f2ce18b031aecbf43d18142941ece7c90691a8b4e96fbb1d5af94f24e5572dad
+
+include $(INCLUDE_DIR)/toolchain-build.mk
+
+define Host/Compile
+	true
+endef
+
+define Host/Install
+	$(MAKE) -C $(HOST_BUILD_DIR) PREFIX="" DESTDIR="$(TOOLCHAIN_DIR)" install
+endef
+
+$(eval $(call HostBuild))
diff --git a/toolchain/fortify-headers/patches/001-__ppoll_time64.patch b/toolchain/fortify-headers/patches/001-__ppoll_time64.patch
new file mode 100644
index 0000000..05f8c71
--- /dev/null
+++ b/toolchain/fortify-headers/patches/001-__ppoll_time64.patch
@@ -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) && !(defined(_REDIR_TIME64) && _REDIR_TIME64)
+ #undef ppoll
+ _FORTIFY_FN(ppoll) int ppoll(struct pollfd *__f, nfds_t __n, const struct timespec *__s,
+                              const sigset_t *__m)
diff --git a/toolchain/fortify-headers/patches/002-strings.h-add-__extension__-mark.patch b/toolchain/fortify-headers/patches/002-strings.h-add-__extension__-mark.patch
new file mode 100644
index 0000000..a07bb15
--- /dev/null
+++ b/toolchain/fortify-headers/patches/002-strings.h-add-__extension__-mark.patch
@@ -0,0 +1,24 @@
+From 9ee4b9bd8df55ebbd5f6426fda4a36e1958b64c5 Mon Sep 17 00:00:00 2001
+From: Matthias Van Parys <matthias.vanparys@softathome.com>
+Date: Mon, 10 Jul 2023 14:31:05 +0200
+Subject: [PATCH] strings.h: Add __extension__ mark to include_next to silence
+ -pedantic
+
+Add __extension__ before #include-next in strings.h as was done for all other header files in commits
+7fd984fcb532be01f68cddc194c09a7ca10c1ea6 and a9ffac8596b094da8563aa5dd5d81c946670afe
+---
+ include/strings.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/include/strings.h
++++ b/include/strings.h
+@@ -16,6 +16,9 @@
+ #ifndef _FORTIFY_STRINGS_H
+ #define _FORTIFY_STRINGS_H
+ 
++#ifndef __cplusplus
++__extension__
++#endif
+ #include_next <strings.h>
+ 
+ #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0