From 431a47af9e231eb70384eb4e6dcf0d72bb70a3f4 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 21 Jan 2020 00:07:40 -0500 Subject: [PATCH] add gcc patch fixing libstdc++ futex use for time64 compatibility this is not the cleanest fix but should at least make it non-broken. --- .../gcc-5.3.0/0018-libstdc++-futex-time64.diff | 18 ++++++++++++++++++ .../gcc-6.4.0/0018-libstdc++-futex-time64.diff | 18 ++++++++++++++++++ .../gcc-6.5.0/0022-libstdc++-futex-time64.diff | 18 ++++++++++++++++++ .../gcc-7.2.0/0017-libstdc++-futex-time64.diff | 18 ++++++++++++++++++ .../gcc-7.3.0/0019-libstdc++-futex-time64.diff | 18 ++++++++++++++++++ .../gcc-8.3.0/0016-libstdc++-futex-time64.diff | 18 ++++++++++++++++++ .../gcc-9.2.0/0016-libstdc++-futex-time64.diff | 18 ++++++++++++++++++ 7 files changed, 126 insertions(+) create mode 100644 patches/gcc-5.3.0/0018-libstdc++-futex-time64.diff create mode 100644 patches/gcc-6.4.0/0018-libstdc++-futex-time64.diff create mode 100644 patches/gcc-6.5.0/0022-libstdc++-futex-time64.diff create mode 100644 patches/gcc-7.2.0/0017-libstdc++-futex-time64.diff create mode 100644 patches/gcc-7.3.0/0019-libstdc++-futex-time64.diff create mode 100644 patches/gcc-8.3.0/0016-libstdc++-futex-time64.diff create mode 100644 patches/gcc-9.2.0/0016-libstdc++-futex-time64.diff diff --git a/patches/gcc-5.3.0/0018-libstdc++-futex-time64.diff b/patches/gcc-5.3.0/0018-libstdc++-futex-time64.diff new file mode 100644 index 0000000..46902d1 --- /dev/null +++ b/patches/gcc-5.3.0/0018-libstdc++-futex-time64.diff @@ -0,0 +1,18 @@ +--- gcc-9.2.0/libstdc++-v3/src/c++11/futex.cc.orig 2020-01-20 14:55:05.507548334 -0500 ++++ gcc-9.2.0/libstdc++-v3/src/c++11/futex.cc 2020-01-20 14:56:52.458268068 -0500 +@@ -61,7 +61,15 @@ + struct timeval tv; + gettimeofday (&tv, NULL); + // Convert the absolute timeout value to a relative timeout ++#if defined(SYS_futex_time64) ++ struct ++ { ++ long tv_sec; ++ long tv_nsec; ++ } rt; ++#else + struct timespec rt; ++#endif + rt.tv_sec = __s.count() - tv.tv_sec; + rt.tv_nsec = __ns.count() - tv.tv_usec * 1000; + if (rt.tv_nsec < 0) diff --git a/patches/gcc-6.4.0/0018-libstdc++-futex-time64.diff b/patches/gcc-6.4.0/0018-libstdc++-futex-time64.diff new file mode 100644 index 0000000..46902d1 --- /dev/null +++ b/patches/gcc-6.4.0/0018-libstdc++-futex-time64.diff @@ -0,0 +1,18 @@ +--- gcc-9.2.0/libstdc++-v3/src/c++11/futex.cc.orig 2020-01-20 14:55:05.507548334 -0500 ++++ gcc-9.2.0/libstdc++-v3/src/c++11/futex.cc 2020-01-20 14:56:52.458268068 -0500 +@@ -61,7 +61,15 @@ + struct timeval tv; + gettimeofday (&tv, NULL); + // Convert the absolute timeout value to a relative timeout ++#if defined(SYS_futex_time64) ++ struct ++ { ++ long tv_sec; ++ long tv_nsec; ++ } rt; ++#else + struct timespec rt; ++#endif + rt.tv_sec = __s.count() - tv.tv_sec; + rt.tv_nsec = __ns.count() - tv.tv_usec * 1000; + if (rt.tv_nsec < 0) diff --git a/patches/gcc-6.5.0/0022-libstdc++-futex-time64.diff b/patches/gcc-6.5.0/0022-libstdc++-futex-time64.diff new file mode 100644 index 0000000..46902d1 --- /dev/null +++ b/patches/gcc-6.5.0/0022-libstdc++-futex-time64.diff @@ -0,0 +1,18 @@ +--- gcc-9.2.0/libstdc++-v3/src/c++11/futex.cc.orig 2020-01-20 14:55:05.507548334 -0500 ++++ gcc-9.2.0/libstdc++-v3/src/c++11/futex.cc 2020-01-20 14:56:52.458268068 -0500 +@@ -61,7 +61,15 @@ + struct timeval tv; + gettimeofday (&tv, NULL); + // Convert the absolute timeout value to a relative timeout ++#if defined(SYS_futex_time64) ++ struct ++ { ++ long tv_sec; ++ long tv_nsec; ++ } rt; ++#else + struct timespec rt; ++#endif + rt.tv_sec = __s.count() - tv.tv_sec; + rt.tv_nsec = __ns.count() - tv.tv_usec * 1000; + if (rt.tv_nsec < 0) diff --git a/patches/gcc-7.2.0/0017-libstdc++-futex-time64.diff b/patches/gcc-7.2.0/0017-libstdc++-futex-time64.diff new file mode 100644 index 0000000..46902d1 --- /dev/null +++ b/patches/gcc-7.2.0/0017-libstdc++-futex-time64.diff @@ -0,0 +1,18 @@ +--- gcc-9.2.0/libstdc++-v3/src/c++11/futex.cc.orig 2020-01-20 14:55:05.507548334 -0500 ++++ gcc-9.2.0/libstdc++-v3/src/c++11/futex.cc 2020-01-20 14:56:52.458268068 -0500 +@@ -61,7 +61,15 @@ + struct timeval tv; + gettimeofday (&tv, NULL); + // Convert the absolute timeout value to a relative timeout ++#if defined(SYS_futex_time64) ++ struct ++ { ++ long tv_sec; ++ long tv_nsec; ++ } rt; ++#else + struct timespec rt; ++#endif + rt.tv_sec = __s.count() - tv.tv_sec; + rt.tv_nsec = __ns.count() - tv.tv_usec * 1000; + if (rt.tv_nsec < 0) diff --git a/patches/gcc-7.3.0/0019-libstdc++-futex-time64.diff b/patches/gcc-7.3.0/0019-libstdc++-futex-time64.diff new file mode 100644 index 0000000..46902d1 --- /dev/null +++ b/patches/gcc-7.3.0/0019-libstdc++-futex-time64.diff @@ -0,0 +1,18 @@ +--- gcc-9.2.0/libstdc++-v3/src/c++11/futex.cc.orig 2020-01-20 14:55:05.507548334 -0500 ++++ gcc-9.2.0/libstdc++-v3/src/c++11/futex.cc 2020-01-20 14:56:52.458268068 -0500 +@@ -61,7 +61,15 @@ + struct timeval tv; + gettimeofday (&tv, NULL); + // Convert the absolute timeout value to a relative timeout ++#if defined(SYS_futex_time64) ++ struct ++ { ++ long tv_sec; ++ long tv_nsec; ++ } rt; ++#else + struct timespec rt; ++#endif + rt.tv_sec = __s.count() - tv.tv_sec; + rt.tv_nsec = __ns.count() - tv.tv_usec * 1000; + if (rt.tv_nsec < 0) diff --git a/patches/gcc-8.3.0/0016-libstdc++-futex-time64.diff b/patches/gcc-8.3.0/0016-libstdc++-futex-time64.diff new file mode 100644 index 0000000..46902d1 --- /dev/null +++ b/patches/gcc-8.3.0/0016-libstdc++-futex-time64.diff @@ -0,0 +1,18 @@ +--- gcc-9.2.0/libstdc++-v3/src/c++11/futex.cc.orig 2020-01-20 14:55:05.507548334 -0500 ++++ gcc-9.2.0/libstdc++-v3/src/c++11/futex.cc 2020-01-20 14:56:52.458268068 -0500 +@@ -61,7 +61,15 @@ + struct timeval tv; + gettimeofday (&tv, NULL); + // Convert the absolute timeout value to a relative timeout ++#if defined(SYS_futex_time64) ++ struct ++ { ++ long tv_sec; ++ long tv_nsec; ++ } rt; ++#else + struct timespec rt; ++#endif + rt.tv_sec = __s.count() - tv.tv_sec; + rt.tv_nsec = __ns.count() - tv.tv_usec * 1000; + if (rt.tv_nsec < 0) diff --git a/patches/gcc-9.2.0/0016-libstdc++-futex-time64.diff b/patches/gcc-9.2.0/0016-libstdc++-futex-time64.diff new file mode 100644 index 0000000..46902d1 --- /dev/null +++ b/patches/gcc-9.2.0/0016-libstdc++-futex-time64.diff @@ -0,0 +1,18 @@ +--- gcc-9.2.0/libstdc++-v3/src/c++11/futex.cc.orig 2020-01-20 14:55:05.507548334 -0500 ++++ gcc-9.2.0/libstdc++-v3/src/c++11/futex.cc 2020-01-20 14:56:52.458268068 -0500 +@@ -61,7 +61,15 @@ + struct timeval tv; + gettimeofday (&tv, NULL); + // Convert the absolute timeout value to a relative timeout ++#if defined(SYS_futex_time64) ++ struct ++ { ++ long tv_sec; ++ long tv_nsec; ++ } rt; ++#else + struct timespec rt; ++#endif + rt.tv_sec = __s.count() - tv.tv_sec; + rt.tv_nsec = __ns.count() - tv.tv_usec * 1000; + if (rt.tv_nsec < 0)