Blame SOURCES/glibc-rh1418978-1a.patch

147e83
Backporting changes to the support/ subdirectory.
147e83
147e83
This is kept separate from glibc-rh1418978-1.patch to simplify rebases
147e83
of the support/ subdirectory.  Changes here should be restricted to
147e83
things that absolutely cannot be upstreamed at this point (such as
147e83
support for older compilers).
147e83
147e83
diff --git a/support/blob_repeat.c b/support/blob_repeat.c
147e83
index 16c1e448b990e386..a2d5e0cbd736f998 100644
147e83
--- a/support/blob_repeat.c
147e83
+++ b/support/blob_repeat.c
147e83
@@ -30,6 +30,9 @@
147e83
 #include <unistd.h>
147e83
 #include <wchar.h>
147e83
 
147e83
+/* For check_mul_overflow_size_t.  */
147e83
+#include <malloc/malloc-internal.h>
147e83
+
147e83
 /* Small allocations should use malloc directly instead of the mmap
147e83
    optimization because mappings carry a lot of overhead.  */
147e83
 static const size_t maximum_small_size = 4 * 1024 * 1024;
147e83
@@ -118,8 +121,8 @@ minimum_stride_size (size_t page_size, size_t element_size)
147e83
      common multiple, it appears only once.  Therefore, shift one
147e83
      factor.  */
147e83
   size_t multiple;
147e83
-  if (__builtin_mul_overflow (page_size >> common_zeros, element_size,
147e83
-                              &multiple))
147e83
+  if (check_mul_overflow_size_t (page_size >> common_zeros, element_size,
147e83
+                                 &multiple))
147e83
     return 0;
147e83
   return multiple;
147e83
 }
147e83
@@ -255,7 +258,7 @@ support_blob_repeat_allocate (const void *element, size_t element_size,
147e83
                               size_t count)
147e83
 {
147e83
   size_t total_size;
147e83
-  if (__builtin_mul_overflow (element_size, count, &total_size))
147e83
+  if (check_mul_overflow_size_t (element_size, count, &total_size))
147e83
     {
147e83
       errno = EOVERFLOW;
147e83
       return (struct support_blob_repeat) { 0 };
147e83
diff --git a/support/links-dso-program.cc b/support/links-dso-program.cc
147e83
index dba6976c0609a332..8ff3155dd7fcd757 100644
147e83
--- a/support/links-dso-program.cc
147e83
+++ b/support/links-dso-program.cc
147e83
@@ -1,3 +1,8 @@
147e83
+/* Change for backporting: The build system does not define _ISOMAC
147e83
+   for us because the tests-internal changes have not been
147e83
+   backported.  */
147e83
+#define _ISOMAC 1
147e83
+
147e83
 #include <iostream>
147e83
 
147e83
 using namespace std;