This code was added in 2002, before Clang even existed. The 'Valgrind relies on GCC" output is certainly no-longer true, and this check "passes" when using vanilla Clang, or Clang pretending to be GCC etc. Seems easiest to just remove this code, as there are numerous other compiler checks throughout configure. Patch to remove is attached.
You didn't add the patch. Do you mean removing # Check for the compiler support if test "${GCC}" != "yes" ; then AC_MSG_ERROR([Valgrind relies on GCC to be compiled]) fi ?
commit 41a7f59a8838a042813ac20fe1472e55e9bd5697 (HEAD -> master, origin/master, origin/HEAD) Author: Paul Floyd <pjfloyd@wanadoo.fr> Date: Mon Apr 17 21:53:23 2023 +0200 Bug 374596 - inconsistent RDTSCP support on x86_64
Created attachment 158183 [details] 0001-build-remove-Valgrind-relies-on-GCC-check-output.patch
> You didn't add the patch. Do you mean removing 🤦 Sorry. Yes, those lines. Patch attached now in any case.
commit 1e784548a17aec105ed79d53c91c3fd023b2c364 (HEAD -> master, origin/master, origin/HEAD) Author: Paul Floyd <pjfloyd@wanadoo.fr> Date: Tue Apr 18 22:27:55 2023 +0200 Bug 468606 - build: remove "Valgrind relies on GCC" check/output