aboutsummaryrefslogtreecommitdiff
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/builders/builder.py8
-rw-r--r--lldb/packages/Python/lldbsuite/test/configuration.py1
-rw-r--r--lldb/packages/Python/lldbsuite/test/dotest.py10
-rw-r--r--lldb/packages/Python/lldbsuite/test/dotest_args.py8
-rw-r--r--lldb/packages/Python/lldbsuite/test/make/Makefile.rules10
5 files changed, 25 insertions, 12 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/builders/builder.py b/lldb/packages/Python/lldbsuite/test/builders/builder.py
index 3cd4837..4817dae 100644
--- a/lldb/packages/Python/lldbsuite/test/builders/builder.py
+++ b/lldb/packages/Python/lldbsuite/test/builders/builder.py
@@ -122,8 +122,12 @@ class Builder:
def getLibCxxArgs(self):
if configuration.libcxx_include_dir and configuration.libcxx_library_dir:
- return ["LIBCPP_INCLUDE_DIR={}".format(configuration.libcxx_include_dir),
- "LIBCPP_LIBRARY_DIR={}".format(configuration.libcxx_library_dir)]
+ libcpp_args = ["LIBCPP_INCLUDE_DIR={}".format(configuration.libcxx_include_dir),
+ "LIBCPP_LIBRARY_DIR={}".format(configuration.libcxx_library_dir)]
+ if configuration.libcxx_include_target_dir:
+ libcpp_args.append("LIBCPP_INCLUDE_TARGET_DIR={}".format(
+ configuration.libcxx_include_target_dir))
+ return libcpp_args
return []
def _getDebugInfoArgs(self, debug_info):
diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py
index 2a8d125..266d785 100644
--- a/lldb/packages/Python/lldbsuite/test/configuration.py
+++ b/lldb/packages/Python/lldbsuite/test/configuration.py
@@ -124,6 +124,7 @@ all_tests = set()
lldb_libs_dir = None
libcxx_include_dir = None
+libcxx_include_target_dir = None
libcxx_library_dir = None
# A plugin whose tests will be enabled, like intel-pt.
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index b4b1a36..818e8f6 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -280,17 +280,15 @@ def parseOptionsAndInitTestdirs():
logging.warning('No valid FileCheck executable; some tests may fail...')
logging.warning('(Double-check the --llvm-tools-dir argument to dotest.py)')
- configuration.libcxx_include_dir = args.libcxx_include_dir
- configuration.libcxx_library_dir = args.libcxx_library_dir
if args.libcxx_include_dir or args.libcxx_library_dir:
if args.lldb_platform_name:
logging.warning('Custom libc++ is not supported for remote runs: ignoring --libcxx arguments')
- elif args.libcxx_include_dir and args.libcxx_library_dir:
- configuration.libcxx_include_dir = args.libcxx_include_dir
- configuration.libcxx_library_dir = args.libcxx_library_dir
- else:
+ elif not (args.libcxx_include_dir and args.libcxx_library_dir):
logging.error('Custom libc++ requires both --libcxx-include-dir and --libcxx-library-dir')
sys.exit(-1)
+ configuration.libcxx_include_dir = args.libcxx_include_dir
+ configuration.libcxx_include_target_dir = args.libcxx_include_target_dir
+ configuration.libcxx_library_dir = args.libcxx_library_dir
if args.channels:
lldbtest_config.channels = args.channels
diff --git a/lldb/packages/Python/lldbsuite/test/dotest_args.py b/lldb/packages/Python/lldbsuite/test/dotest_args.py
index 3bd523a..31c0c0e 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -43,8 +43,12 @@ def create_parser():
if sys.platform == 'darwin':
group.add_argument('--apple-sdk', metavar='apple_sdk', dest='apple_sdk', default="", help=textwrap.dedent(
'''Specify the name of the Apple SDK (macosx, macosx.internal, iphoneos, iphoneos.internal, or path to SDK) and use the appropriate tools from that SDK's toolchain.'''))
- group.add_argument('--libcxx-include-dir', help=textwrap.dedent('Specify the path to a custom libc++ include directory. Must be used in conjunction with --libcxx-library-dir.'))
- group.add_argument('--libcxx-library-dir', help=textwrap.dedent('Specify the path to a custom libc++ library directory. Must be used in conjunction with --libcxx-include-dir.'))
+ group.add_argument('--libcxx-include-dir', help=textwrap.dedent(
+ 'Specify the path to a custom libc++ include directory. Must be used in conjunction with --libcxx-library-dir.'))
+ group.add_argument('--libcxx-include-target-dir', help=textwrap.dedent(
+ 'Specify the path to a custom libc++ include target directory to use in addition to --libcxx-include-dir. Optional.'))
+ group.add_argument('--libcxx-library-dir', help=textwrap.dedent(
+ 'Specify the path to a custom libc++ library directory. Must be used in conjunction with --libcxx-include-dir.'))
# FIXME? This won't work for different extra flags according to each arch.
group.add_argument(
'-E',
diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index c0fd5ec..25c4d88 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -408,7 +408,10 @@ endif
ifeq (1,$(USE_LIBCPP))
ifneq ($(and $(LIBCPP_INCLUDE_DIR), $(LIBCPP_LIBRARY_DIR)),)
CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(LIBCPP_INCLUDE_DIR)
- LDFLAGS += -L$(LLVM_LIBS_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++
+ ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" ""
+ CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR)
+ endif
+ LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++
else
ifeq "$(OS)" "Android"
# Nothing to do, this is already handled in
@@ -430,7 +433,10 @@ endif
ifeq ($(or $(USE_LIBSTDCPP), $(USE_LIBCPP), $(USE_SYSTEM_STDLIB)),)
ifneq ($(and $(LIBCPP_INCLUDE_DIR), $(LIBCPP_LIBRARY_DIR)),)
CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(LIBCPP_INCLUDE_DIR)
- LDFLAGS += -L$(LLVM_LIBS_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++
+ ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" ""
+ CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR)
+ endif
+ LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++
endif
endif