From 802db34adb56723dfc7290b29fb9537a4f8f715f Mon Sep 17 00:00:00 2001 From: Francois Kritzinger Date: Fri, 4 Feb 2022 10:13:23 +0200 Subject: [PATCH] Add more checks used by Qt --- .../libbuild2/autoconf/checks/HAVE_RDRND.h | 21 +++++++++++++++++++ .../libbuild2/autoconf/checks/HAVE_RDSEED.h | 15 +++++++++++++ .../autoconf/checks/HAVE_SIGNALING_NAN.h | 9 ++++++++ .../autoconf/checks/HAVE_THREADSAFE_CLOEXEC.h | 19 +++++++++++++++++ .../libbuild2/autoconf/checks/HAVE_XOP.h | 2 +- 5 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_RDRND.h create mode 100644 libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_RDSEED.h create mode 100644 libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_SIGNALING_NAN.h create mode 100644 libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_THREADSAFE_CLOEXEC.h diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_RDRND.h b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_RDRND.h new file mode 100644 index 0000000..5dc2fd2 --- /dev/null +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_RDRND.h @@ -0,0 +1,21 @@ +// HAVE_RDRND : HAVE_AVX2 + +#undef HAVE_RDRND + +/* GCC, Clang: -mrdrnd + * + * MSVC: No controlling compiler option nor indicating macro. The + * documentation murkily says it's always enabled on Intel and only + * Intel processors; see: + * https://docs.microsoft.com/en-us/cpp/intrinsics/x86-intrinsics-list + * https://docs.microsoft.com/en-us/cpp/intrinsics/x64-amd64-intrinsics-list) + * + * According to Qt, all processors that support AVX2 support RDRND so + * follow their lead by assuming it's available if AVX2 is. + * + * Note that RDRND intrinsics were added to Visual C++ 2015 according to + * Wikipedia. + */ +#if defined(__RDRND__) || (defined(_MSC_VER) && defined(HAVE_AVX2)) +# define HAVE_RDRND 1 +#endif diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_RDSEED.h b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_RDSEED.h new file mode 100644 index 0000000..44c6172 --- /dev/null +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_RDSEED.h @@ -0,0 +1,15 @@ +// HAVE_RDSEED + +#undef HAVE_RDSEED + +/* GCC, Clang: -mrdseed + * + * MSVC: No controlling compiler option nor indicating macro. The + * documentation murkily says it's always enabled on Intel and only + * Intel processors; see: + * https://docs.microsoft.com/en-us/cpp/intrinsics/x86-intrinsics-list + * https://docs.microsoft.com/en-us/cpp/intrinsics/x64-amd64-intrinsics-list) + */ +#ifdef __RDSEED__ +# define HAVE_RDSEED 1 +#endif diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_SIGNALING_NAN.h b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_SIGNALING_NAN.h new file mode 100644 index 0000000..3c8b0be --- /dev/null +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_SIGNALING_NAN.h @@ -0,0 +1,9 @@ +// HAVE_SIGNALING_NAN + +#undef HAVE_SIGNALING_NAN + +/* Whether implementation's double fulfills the requirements of IEC 559 which + * was released in 2008. See + * https://en.cppreference.com/w/cpp/types/numeric_limits/is_iec559. + */ +#define HAVE_SIGNALING_NAN 1 diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_THREADSAFE_CLOEXEC.h b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_THREADSAFE_CLOEXEC.h new file mode 100644 index 0000000..6bff9bb --- /dev/null +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_THREADSAFE_CLOEXEC.h @@ -0,0 +1,19 @@ +// HAVE_THREADSAFE_CLOEXEC + +#undef HAVE_THREADSAFE_CLOEXEC + +/* Define if file descriptor-creating functions taking a *_CLOEXEC flag are + * available. Setting the FD_CLOEXEC flag in a separate fcntl() call opens a + * window for another thread to fork/exec. + * + * The set of functions covered by this check are pipe2(), dup3(), accept4(), + * and a version of socket() which takes the SOCK_CLOEXEC flag. + * + * Since glibc 2.10, FreeBSD 10, OpenBSD 5.7, NetBSD 6.0. + */ +#if BUILD2_AUTOCONF_GLIBC_PREREQ(2, 10) || \ + BUILD2_AUTOCONF_FREEBSD_PREREQ(10, 0) || \ + BUILD2_AUTOCONF_OPENBSD_PREREQ(201507) || \ + BUILD2_AUTOCONF_NETBSD_PREREQ(6, 0) +# define HAVE_THREADSAFE_CLOEXEC 1 +#endif diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_XOP.h b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_XOP.h index 8458477..e110644 100644 --- a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_XOP.h +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_XOP.h @@ -5,7 +5,7 @@ /* GCC, Clang: -mxop * * MSVC: No controlling compiler option nor indicating macro. The - * documnetation is murkily says it's always enabled on AMD and only AMD + * documentation murkily says it's always enabled on AMD and only AMD * processors; see: * https://docs.microsoft.com/en-us/cpp/intrinsics/x86-intrinsics-list * https://docs.microsoft.com/en-us/cpp/intrinsics/x64-amd64-intrinsics-list)