diff --git a/testing/rmlint/APKBUILD b/testing/rmlint/APKBUILD
index 0392d9d84376ad6b5caa9f2514e2bbabd0564f9f..3a9f95a5009302407275e7ddbfa3bd8b59b27b61 100644
--- a/testing/rmlint/APKBUILD
+++ b/testing/rmlint/APKBUILD
@@ -2,7 +2,7 @@
 # Maintainer: Edd Salkield <edd@salkield.uk>
 pkgname=rmlint
 pkgver=2.10.2
-pkgrel=1
+pkgrel=2
 pkgdesc="Remove duplicates and other lint from your filesystem"
 url="https://rmlint.readthedocs.io/en/latest/"
 arch="all"
@@ -12,6 +12,7 @@ checkdepends="dash py3-nose py3-parameterized py3-psutil"
 subpackages="$pkgname-doc $pkgname-lang $pkgname-shredder-pyc $pkgname-shredder:shredder:noarch"
 source="https://github.com/sahib/rmlint/archive/v$pkgver/rmlint-v$pkgver.tar.gz
 	remove-usage-of-lseek64.patch
+	gcc14-remove-header-in-checkfunc.patch
 	"
 options="!check" # awaiting upstream fixes to test suite
 				 # https://github.com/sahib/rmlint/issues/593
@@ -41,4 +42,5 @@ shredder() {
 sha512sums="
 8f8d58892785e9012cb15f3e89480d9d04772fa3f923064520bf17afcc8948b1a24d6f8399176a1a26bd5036553c605958f3720e40cf6cba135a4f3381131180  rmlint-v2.10.2.tar.gz
 f77bf8d77bf7d7c83a91a97ed79733b11ea55bd1814ba13262349a4ebd29bf8de4e76b0a082676c634ef83106953097dae1d6faddfa6aa9866a7cf41ed158b18  remove-usage-of-lseek64.patch
+fe3e496de332975bbb26127c2dd6eef9e71d8f442c4ee301cb47d2cdac409c7803b76f74b26f9958b5849e26a2ef6098901284938f43de291af31e775eda69eb  gcc14-remove-header-in-checkfunc.patch
 "
diff --git a/testing/rmlint/gcc14-remove-header-in-checkfunc.patch b/testing/rmlint/gcc14-remove-header-in-checkfunc.patch
new file mode 100644
index 0000000000000000000000000000000000000000..44f4f77c9295cb57b6fd2985293cb5a703030c42
--- /dev/null
+++ b/testing/rmlint/gcc14-remove-header-in-checkfunc.patch
@@ -0,0 +1,55 @@
+Source: https://github.com/sahib/rmlint/pull/605.patch
+--
+From 2911558726338ea447ba310321f2f0a090d00cb4 Mon Sep 17 00:00:00 2001
+From: Alex Fan <alex.fan.q@gmail.com>
+Date: Sat, 7 Jan 2023 02:14:17 +1100
+Subject: [PATCH] remove header in CheckFunc
+
+this is the proper way suggested by upstream
+https://pairlist4.pair.net/pipermail/scons-users/2023-January/009150.html
+---
+ SConstruct | 17 +++--------------
+ 1 file changed, 3 insertions(+), 14 deletions(-)
+
+diff --git a/SConstruct b/SConstruct
+index 7e12d4134..83af15e12 100755
+--- a/SConstruct
++++ b/SConstruct
+@@ -196,12 +196,7 @@ def check_bigfiles(context):
+ 
+     have_stat64 = True
+     if tests.CheckFunc(
+-        context, 'stat64',
+-        header=
+-            '#include <sys/types.h>'
+-            '#include <sys/stat.h>'
+-            '#include <unistd.h>'
+-
++        context, 'stat64'
+     ):
+         have_stat64 = False
+ 
+@@ -269,10 +264,7 @@ def check_xattr(context):
+ 
+     for func in ['getxattr', 'setxattr', 'removexattr', 'listxattr']:
+         if tests.CheckFunc(
+-            context, func,
+-            header=
+-                '#include <sys/types.h>'
+-                '#include <sys/xattr.h>'
++            context, func
+         ):
+             rc = 0
+             break
+@@ -290,10 +282,7 @@ def check_lxattr(context):
+ 
+     for func in ['lgetxattr', 'lsetxattr', 'lremovexattr', 'llistxattr']:
+         if tests.CheckFunc(
+-            context, func,
+-            header=
+-                '#include <sys/types.h>'
+-                '#include <sys/xattr.h>'
++            context, func
+         ):
+             rc = 0
+             break