[libc-commits] [libc] [llvm] [libc] Add the missing math_extras.h include (PR #74259)

Guillaume Chatelet via libc-commits libc-commits at lists.llvm.org
Mon Dec 4 04:44:03 PST 2023


https://github.com/gchatelet updated https://github.com/llvm/llvm-project/pull/74259

>From 13653cb77a6ff40b9ea6147d6de277eae6379ee8 Mon Sep 17 00:00:00 2001
From: Petr Hosek <phosek at google.com>
Date: Sun, 3 Dec 2023 22:43:51 +0000
Subject: [PATCH 1/2] [libc] Add the missing math_extras.h include

math_extras.h is used in integer_utils.h when building for 32-bit
platforms but the include is missing.
---
 libc/src/__support/CMakeLists.txt  | 1 +
 libc/src/__support/integer_utils.h | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/libc/src/__support/CMakeLists.txt b/libc/src/__support/CMakeLists.txt
index ba80965b5aaaf..d6dbad661cb73 100644
--- a/libc/src/__support/CMakeLists.txt
+++ b/libc/src/__support/CMakeLists.txt
@@ -189,6 +189,7 @@ add_header_library(
     integer_utils.h
   DEPENDS
     .bit
+    .math_extras
     .number_pair
     libc.src.__support.common
     libc.src.__support.CPP.type_traits
diff --git a/libc/src/__support/integer_utils.h b/libc/src/__support/integer_utils.h
index 433e99227bcfd..619e13f51c411 100644
--- a/libc/src/__support/integer_utils.h
+++ b/libc/src/__support/integer_utils.h
@@ -15,6 +15,10 @@
 #include "bit.h"
 #include "number_pair.h"
 
+#ifndef __SIZEOF_INT128__
+#include "math_extras.h"
+#endif
+
 #include <stdint.h>
 
 namespace LIBC_NAMESPACE {

>From 13f523c9ff29a8eb0611fb52fa5a26a4a5b1520a Mon Sep 17 00:00:00 2001
From: Guillaume Chatelet <gchatelet at google.com>
Date: Mon, 4 Dec 2023 12:43:38 +0000
Subject: [PATCH 2/2] Also fix BUILD.bazel

---
 utils/bazel/llvm-project-overlay/libc/BUILD.bazel | 1 +
 1 file changed, 1 insertion(+)

diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index 46d81987e7b32..0b6e725aa4d31 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -442,6 +442,7 @@ libc_support_library(
         ":__support_bit",
         ":__support_common",
         ":__support_cpp_type_traits",
+        ":__support_math_extras",
         ":__support_number_pair",
     ],
 )



More information about the libc-commits mailing list