libc++: do not enable modules build to avoid ODR violation
Currently, libc++ doesn't build with its modulemap config file and we don't take care of the libc++'s build performance now. So, let me disable module build for libc++. Bug: 40263312 Change-Id: I3b1867f3e555a80a00d128338dda66a916cd04b9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6248376 Reviewed-by: Nico Weber <thakis@chromium.org> Reviewed-by: Erik Staab <estaab@chromium.org> Auto-Submit: Takuto Ikuta <tikuta@chromium.org> Reviewed-by: Alan Zhao <ayzhao@google.com> Commit-Queue: Takuto Ikuta <tikuta@chromium.org> Cr-Commit-Position: refs/heads/main@{#1419704}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
dd37af4c5c
commit
a98c174e92
31
buildtools/third_party/libc++/BUILD.gn
vendored
31
buildtools/third_party/libc++/BUILD.gn
vendored
@ -253,6 +253,7 @@ target(_libcxx_target_type, "libc++") {
|
||||
"//third_party/libc++/src/src/hash.cpp",
|
||||
"//third_party/libc++/src/src/ios.cpp",
|
||||
"//third_party/libc++/src/src/ios.instantiations.cpp",
|
||||
"//third_party/libc++/src/src/iostream.cpp",
|
||||
"//third_party/libc++/src/src/locale.cpp",
|
||||
"//third_party/libc++/src/src/memory.cpp",
|
||||
"//third_party/libc++/src/src/mutex.cpp",
|
||||
@ -279,15 +280,6 @@ target(_libcxx_target_type, "libc++") {
|
||||
"//third_party/libc++/src/src/verbose_abort.cpp",
|
||||
]
|
||||
|
||||
if (!use_explicit_libcxx_modules) {
|
||||
sources += [
|
||||
# TODO(crbug.com/40440396): Have a separate target for this to avoid
|
||||
# compile errors in explicit modules build due to type mismatch of
|
||||
# std::{cerr,cin,clog,cout} between declaration and definition.
|
||||
"//third_party/libc++/src/src/iostream.cpp",
|
||||
]
|
||||
}
|
||||
|
||||
if (is_apple || (!is_asan && !is_tsan && !is_msan)) {
|
||||
# In {a,t,m}san configurations, operator new and operator delete will be
|
||||
# provided by the sanitizer runtime library. Since libc++ defines these
|
||||
@ -329,6 +321,11 @@ target(_libcxx_target_type, "libc++") {
|
||||
configs += configs_to_add
|
||||
|
||||
if (use_libcxx_modules) {
|
||||
# TODO(https://github.com/llvm/llvm-project/issues/127012): We don't enable
|
||||
# Clang modules for libc++ as libc++'s iostream.cpp has ODR issue
|
||||
# (https://crbug.com/40440396#comment81). Also we don't take care about the
|
||||
# libc++'s build performance much.
|
||||
# (https://crrev.com/c/6248376/4#message-0ddf8e6a0f3ce1eb1654f7025280d8ed75cf2e81)
|
||||
configs -= [ "//build/config/compiler:libcxx_module" ]
|
||||
}
|
||||
if ((is_android || is_apple) && libcxx_is_shared) {
|
||||
@ -375,22 +372,6 @@ target(_libcxx_target_type, "libc++") {
|
||||
|
||||
deps = [ "//third_party/llvm-libc:llvm-libc-shared" ]
|
||||
|
||||
if (use_explicit_libcxx_modules) {
|
||||
modulemap = rebase_path("//third_party/libc++/src/include/module.modulemap",
|
||||
root_build_dir)
|
||||
cflags += [
|
||||
"-fmodules",
|
||||
"-fmodule-map-file=" + modulemap,
|
||||
]
|
||||
|
||||
deps += [
|
||||
":std",
|
||||
":std_config",
|
||||
":std_core",
|
||||
":std_stddef_h",
|
||||
]
|
||||
}
|
||||
|
||||
if (!is_win) {
|
||||
defines += [ "LIBCXX_BUILDING_LIBCXXABI" ]
|
||||
if (!export_libcxxabi_from_executables) {
|
||||
|
Reference in New Issue
Block a user