[Lldb-commits] [PATCH] D132257: [lldb] Create flag to use a custom libcxx in tests

Felipe de Azevedo Piovezan via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 19 11:43:05 PDT 2022


fdeazeve updated this revision to Diff 454073.
fdeazeve added a comment.
Herald added a subscriber: JDevlieghere.

Fixed typo in commit message


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132257/new/

https://reviews.llvm.org/D132257

Files:
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/dotest_args.py
  lldb/packages/Python/lldbsuite/test/make/Makefile.rules


Index: lldb/packages/Python/lldbsuite/test/make/Makefile.rules
===================================================================
--- lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -402,6 +402,14 @@
 	endif
 endif
 
+ifdef CUSTOM_LIBCPP
+        ifeq (,$(findstring clang,$(CC)))
+                $(error "CUSTOM_LIBCPP only supported for Clang compilers")
+        endif
+
+        CXXFLAGS += -nostdinc++ -cxx-isystem $(CUSTOM_LIBCPP)
+endif
+
 #----------------------------------------------------------------------
 # Additional system libraries
 #----------------------------------------------------------------------
Index: lldb/packages/Python/lldbsuite/test/dotest_args.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -172,6 +172,11 @@
         type=str,
         metavar='A plugin whose tests will be enabled',
         help='A plugin whose tests will be enabled. The only currently supported plugin is intel-pt.')
+    group.add_argument(
+        '--custom-libcpp',
+        metavar='custom-libcpp',
+        dest='custom_libcpp',
+        help='(Clang only) Specify path to a custom standard library to use. Disables search for other standard C++ libraries.')
 
     # Configuration options
     group = parser.add_argument_group('Remote platform options')
Index: lldb/packages/Python/lldbsuite/test/dotest.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/dotest.py
+++ lldb/packages/Python/lldbsuite/test/dotest.py
@@ -335,6 +335,9 @@
         # that explicitly require no debug info.
         os.environ['CFLAGS'] = '-gdwarf-{}'.format(configuration.dwarf_version)
 
+    if args.custom_libcpp:
+        os.environ['CUSTOM_LIBCPP'] = args.custom_libcpp
+
     if args.settings:
         for setting in args.settings:
             if not len(setting) == 1 or not setting[0].count('='):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132257.454073.patch
Type: text/x-patch
Size: 2070 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220819/4f62d57a/attachment.bin>


More information about the lldb-commits mailing list