[llvm] 1b829c3 - [gn build] Make libcxx_enable_debug_mode work better, maybe
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 15 07:45:46 PST 2022
Author: Nico Weber
Date: 2022-11-15T10:45:41-05:00
New Revision: 1b829c3d3a8c0488f8aa553eb15c7ee658f491c9
URL: https://github.com/llvm/llvm-project/commit/1b829c3d3a8c0488f8aa553eb15c7ee658f491c9
DIFF: https://github.com/llvm/llvm-project/commit/1b829c3d3a8c0488f8aa553eb15c7ee658f491c9.diff
LOG: [gn build] Make libcxx_enable_debug_mode work better, maybe
Refer to _LIBCPP_ENABLE_DEBUG_MODE instead of the old _LIBCPP_DEBUG
in a comment, and write that to __config_site correctly too.
See 13ea1343231fa4 and the comments in https://crbug.com/1358646.
Also change the default of libcxx_enable_debug_mode to false for now.
Since we used to not write _LIBCPP_ENABLE_DEBUG_MODE, the previous
default of true had no effect (except for compiling debug.cpp and
legacy_debug_handler.cpp, which we now no longer build by default).
So this (mostly) preserves previous behavior.
Added:
Modified:
llvm/utils/gn/secondary/libcxx/config.gni
llvm/utils/gn/secondary/libcxx/include/BUILD.gn
llvm/utils/gn/secondary/libcxx/src/BUILD.gn
Removed:
################################################################################
diff --git a/llvm/utils/gn/secondary/libcxx/config.gni b/llvm/utils/gn/secondary/libcxx/config.gni
index 9e49db1dcc8ce..dddff294acc71 100644
--- a/llvm/utils/gn/secondary/libcxx/config.gni
+++ b/llvm/utils/gn/secondary/libcxx/config.gni
@@ -4,4 +4,8 @@ declare_args() {
# libc++ inline ABI namespace. Defaults to __n, where n is the ABI version.
libcxx_abi_namespace = ""
+
+ # Whether to support libc++ opt-in debug mode via _LIBCPP_ENABLE_DEBUG_MODE.
+ libcxx_enable_debug_mode = false
+
}
diff --git a/llvm/utils/gn/secondary/libcxx/include/BUILD.gn b/llvm/utils/gn/secondary/libcxx/include/BUILD.gn
index e7976a0f9b231..e085c4c83c811 100644
--- a/llvm/utils/gn/secondary/libcxx/include/BUILD.gn
+++ b/llvm/utils/gn/secondary/libcxx/include/BUILD.gn
@@ -37,7 +37,6 @@ if (current_toolchain == default_toolchain) {
"_LIBCPP_HAS_NO_WIDE_CHARACTERS=",
"_LIBCPP_ABI_DEFINES=",
"_LIBCPP_ENABLE_ASSERTIONS_DEFAULT=",
- "_LIBCPP_ENABLE_DEBUG_MODE=",
]
if (libcxx_abi_version != 1) {
values += [ "_LIBCPP_ABI_VERSION=$libcxx_abi_version" ]
@@ -49,6 +48,11 @@ if (current_toolchain == default_toolchain) {
} else {
values += [ "_LIBCPP_ABI_NAMESPACE=__" + libcxx_abi_version ]
}
+ if (libcxx_enable_debug_mode) {
+ values += [ "_LIBCPP_ENABLE_DEBUG_MODE=1" ]
+ } else {
+ values += [ "_LIBCPP_ENABLE_DEBUG_MODE=" ]
+ }
}
write_cmake_config("write_modulemap") {
diff --git a/llvm/utils/gn/secondary/libcxx/src/BUILD.gn b/llvm/utils/gn/secondary/libcxx/src/BUILD.gn
index 5dd6aaa5c44c9..cdad9869f9147 100644
--- a/llvm/utils/gn/secondary/libcxx/src/BUILD.gn
+++ b/llvm/utils/gn/secondary/libcxx/src/BUILD.gn
@@ -3,9 +3,6 @@ import("//libcxx/config.gni")
import("//llvm/utils/gn/build/symlink_or_copy.gni")
declare_args() {
- # Whether to support libc++ opt-in debug mode via _LIBCPP_DEBUG.
- libcxx_enable_debug_mode = true
-
# Build libc++ with definitions for operator new/delete.
libcxx_enable_new_delete_definitions = true
More information about the llvm-commits
mailing list