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