[Lldb-commits] [PATCH] D74891: [lldb] Never compile the debugserver with Clang module flags

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 20 04:09:19 PST 2020


teemperor created this revision.
Herald added subscribers: lldb-commits, JDevlieghere, mgorny.
Herald added a project: LLDB.

Compiling ObjC++ with Clang modules is usually not working well and compiling
the small debugserver with modules is not worth the trouble.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D74891

Files:
  lldb/tools/debugserver/source/CMakeLists.txt


Index: lldb/tools/debugserver/source/CMakeLists.txt
===================================================================
--- lldb/tools/debugserver/source/CMakeLists.txt
+++ lldb/tools/debugserver/source/CMakeLists.txt
@@ -62,6 +62,14 @@
 
 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -Wl,-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_SOURCE_DIR}/../resources/lldb-debugserver-Info.plist")
 
+# Remove any module flags as the debugserver contains ObjC++ code which probably won't work
+# with Clang modules.
+string(REGEX REPLACE "-fmodules-cache-path=[^ ]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+string(REGEX REPLACE "-fmodules-local-submodule-visibility" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+string(REGEX REPLACE "-fmodules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+string(REGEX REPLACE "-gmodules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+string(REGEX REPLACE "-fcxx-modules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+
 check_cxx_compiler_flag("-Wno-gnu-zero-variadic-macro-arguments"
                         CXX_SUPPORTS_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS)
 if (CXX_SUPPORTS_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74891.245614.patch
Type: text/x-patch
Size: 1157 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200220/da7b543c/attachment.bin>


More information about the lldb-commits mailing list