summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Malea <daniel.malea@intel.com>2013-08-06 15:02:32 +0000
committerDaniel Malea <daniel.malea@intel.com>2013-08-06 15:02:32 +0000
commit9115f07465f417e291d9cd3207ad3db7d96df045 (patch)
tree74ddd0556f2ce799d5e863ea9eb53eb308030ad6
parent14b3d361f85889f314fa574f0c6948641bf25cc3 (diff)
downloadbcm5719-llvm-9115f07465f417e291d9cd3207ad3db7d96df045.tar.gz
bcm5719-llvm-9115f07465f417e291d9cd3207ad3db7d96df045.zip
Allow building test suite with non-default libc++
- add new "--libcxx" parameter to dotest.py to specify path to custom libc++ llvm-svn: 187802
-rwxr-xr-xlldb/test/dotest.py4
-rw-r--r--lldb/test/lldbtest.py20
2 files changed, 23 insertions, 1 deletions
diff --git a/lldb/test/dotest.py b/lldb/test/dotest.py
index d4bb9d913e4..4bc4dab2dd6 100755
--- a/lldb/test/dotest.py
+++ b/lldb/test/dotest.py
@@ -454,6 +454,7 @@ def parseOptionsAndInitTestdirs():
group.add_argument('-c', metavar='config-file', help='Read a config file specified after this option') # FIXME: additional doc.
group.add_argument('--framework', metavar='framework-path', help='The path to LLDB.framework')
group.add_argument('--executable', metavar='executable-path', help='The path to the lldb executable')
+ group.add_argument('--libcxx', metavar='directory', help='The path to custom libc++ library')
group.add_argument('-e', metavar='benchmark-exe', help='Specify the full path of an executable used for benchmark purposes (see also: -x)')
group.add_argument('-k', metavar='command', action='append', help="Specify a runhook, which is an lldb command to be executed by the debugger; The option can occur multiple times. The commands are executed one after the other to bring the debugger to a desired state, so that, for example, further benchmarking can be done")
group.add_argument('-R', metavar='dir', help='Specify a directory to relocate the tests and their intermediate files to. BE WARNED THAT the directory, if exists, will be deleted before running this test driver. No cleanup of intermediate test files is performed in this case')
@@ -605,6 +606,9 @@ def parseOptionsAndInitTestdirs():
if args.executable:
lldbExecutablePath = args.executable
+ if args.libcxx:
+ os.environ["LIBCXX_PATH"] = args.libcxx
+
if args.n:
noHeaders = True
diff --git a/lldb/test/lldbtest.py b/lldb/test/lldbtest.py
index 3fbaff1ed92..32d51b7b161 100644
--- a/lldb/test/lldbtest.py
+++ b/lldb/test/lldbtest.py
@@ -821,6 +821,11 @@ class Base(unittest2.TestCase):
#import traceback
#traceback.print_stack()
+ if "LIBCXX_PATH" in os.environ:
+ self.libcxxPath = os.environ["LIBCXX_PATH"]
+ else:
+ self.libcxxPath = None
+
if "LLDB_EXEC" in os.environ:
self.lldbExec = os.environ["LLDB_EXEC"]
else:
@@ -1360,11 +1365,24 @@ class Base(unittest2.TestCase):
if not module.buildDwarf(self, architecture, compiler, dictionary, clean):
raise Exception("Don't know how to build binary with dwarf")
- def getBuildFlags(self, use_cpp11=True, use_pthreads=True):
+ def getBuildFlags(self, use_cpp11=True, use_libcxx=False, use_libstdcxx=False, use_pthreads=True):
""" Returns a dictionary (which can be provided to build* functions above) which
contains OS-specific build flags.
"""
cflags = ""
+
+ # On Mac OS X, unless specifically requested to use libstdc++, use libc++
+ if not use_libstdcxx and sys.platform.startswith('darwin'):
+ use_libcxx = True
+
+ if use_libcxx and self.libcxxPath:
+ cflags += "-stdlib=libc++ "
+ if self.libcxxPath:
+ libcxxInclude = os.path.join(self.libcxxPath, "include")
+ libcxxLib = os.path.join(self.libcxxPath, "lib")
+ if os.path.isdir(libcxxInclude) and os.path.isdir(libcxxLib):
+ cflags += "-nostdinc++ -I%s -L%s -Wl,-rpath,%s " % (libcxxInclude, libcxxLib, libcxxLib)
+
if use_cpp11:
cflags += "-std="
if "gcc" in self.getCompiler() and "4.6" in self.getCompilerVersion():
OpenPOWER on IntegriCloud