olga / rpms / glibc

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