-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc] Temporary math macros fix #87681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libc] Temporary math macros fix #87681
Conversation
@llvm/pr-subscribers-libc Author: Michael Jones (michaelrj-google) ChangesDownstream's having some issues due to math-macros.h issues. These will Full diff: https://github.com/llvm/llvm-project/pull/87681.diff 2 Files Affected:
diff --git a/libc/include/llvm-libc-macros/math-macros.h b/libc/include/llvm-libc-macros/math-macros.h
index 1497e32044e975..99fb3dbf0a9b4e 100644
--- a/libc/include/llvm-libc-macros/math-macros.h
+++ b/libc/include/llvm-libc-macros/math-macros.h
@@ -9,6 +9,9 @@
#ifndef LLVM_LIBC_MACROS_MATH_MACROS_H
#define LLVM_LIBC_MACROS_MATH_MACROS_H
+// TODO: Remove this. This is a temporary fix for a downstream problem.
+#ifdef LLVM_LIBC_FULLBUILD
+
#include "limits-macros.h"
#define FP_NAN 0
@@ -79,4 +82,10 @@ template <typename T> inline constexpr bool isnan(T x) {
#endif
+#else
+
+#include <math.h>
+
+#endif // LLVM_LIBC_FULLBUILD
+
#endif // LLVM_LIBC_MACROS_MATH_MACROS_H
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index 9dfe4c48184e3e..c06253b19558c8 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -68,7 +68,6 @@ libc_support_library(
name = "llvm_libc_macros_math_macros",
hdrs = ["include/llvm-libc-macros/math-macros.h"],
deps = [":llvm_libc_macros_limits_macros"],
- defines = ["__FP_LOGBNAN_MIN"],
)
libc_support_library(
@@ -1000,8 +999,8 @@ libc_support_library(
libc_support_library(
name = "__support_osutil_quick_exit",
- hdrs = ["src/__support/OSUtil/quick_exit.h"],
srcs = ["src/__support/OSUtil/linux/quick_exit.cpp"],
+ hdrs = ["src/__support/OSUtil/quick_exit.h"],
deps = [
":__support_osutil_syscall",
],
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -9,6 +9,9 @@ | |||
#ifndef LLVM_LIBC_MACROS_MATH_MACROS_H | |||
#define LLVM_LIBC_MACROS_MATH_MACROS_H | |||
|
|||
// TODO: Remove this. This is a temporary fix for a downstream problem. | |||
#ifdef LLVM_LIBC_FULLBUILD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change the flag to LIBC_FULL_BUILD
and add the change to libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
in https://github.com/llvm/llvm-project/pull/87598/files#diff-25513d7d596301fa3039e5ad6bab76159cd5bd330a5890773e10cf5507045ca0
After this, if there is any regression on the full build bots, I will fix it forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Downstream's having some issues due to math-macros.h issues. These will be fixed properly soon. See llvm#87683 for tracking this tech debt.
fa94097
to
d95569b
Compare
I will land this after the presubmits finish. |
Downstream's having some issues due to math-macros.h issues. These will
be fixed properly soon.
See #87683 for tracking this tech debt.