[Lldb-commits] [lldb] r333888 - [LLDB] Unit tests basic support for OpenBSD
David Carlier via lldb-commits
lldb-commits at lists.llvm.org
Mon Jun 4 04:57:13 PDT 2018
Author: devnexen
Date: Mon Jun 4 04:57:12 2018
New Revision: 333888
URL: http://llvm.org/viewvc/llvm-project?rev=333888&view=rev
Log:
[LLDB] Unit tests basic support for OpenBSD
Add OpenBSD python module in order to support unit tests.
Reviewers: labath, zturner
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D47692
Modified:
lldb/trunk/lit/lit.cfg
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
Modified: lldb/trunk/lit/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg?rev=333888&r1=333887&r2=333888&view=diff
==============================================================================
--- lldb/trunk/lit/lit.cfg (original)
+++ lldb/trunk/lit/lit.cfg Mon Jun 4 04:57:12 2018
@@ -78,6 +78,10 @@ if platform.system() in ['Darwin']:
config.cc += " -isysroot %s" % sdk_path
config.cxx += " -isysroot %s" % sdk_path
+if platform.system() in ['OpenBSD']:
+ config.cc += " -pthread"
+ config.cxx += " -pthread"
+
config.substitutions.append(('%cc', config.cc))
config.substitutions.append(('%cxx', config.cxx))
Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=333888&r1=333887&r2=333888&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Jun 4 04:57:12 2018
@@ -490,6 +490,8 @@ def getsource_if_available(obj):
def builder_module():
if sys.platform.startswith("freebsd"):
return __import__("builder_freebsd")
+ if sys.platform.startswith("openbsd"):
+ return __import__("builder_openbsd")
if sys.platform.startswith("netbsd"):
return __import__("builder_netbsd")
if sys.platform.startswith("linux"):
@@ -1395,7 +1397,7 @@ class Base(unittest2.TestCase):
def getstdlibFlag(self):
""" Returns the proper -stdlib flag, or empty if not required."""
- if self.platformIsDarwin() or self.getPlatform() == "freebsd":
+ if self.platformIsDarwin() or self.getPlatform() == "freebsd" or self.getPlatform() == "openbsd":
stdlibflag = "-stdlib=libc++"
else: # this includes NetBSD
stdlibflag = ""
@@ -1424,7 +1426,7 @@ class Base(unittest2.TestCase):
'FRAMEWORK_INCLUDES': "-F%s" % self.framework_dir,
'LD_EXTRAS': "%s -Wl,-rpath,%s" % (self.dsym, self.framework_dir),
}
- elif sys.platform.rstrip('0123456789') in ('freebsd', 'linux', 'netbsd', 'darwin') or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile':
+ elif sys.platform.startswith('win'):
d = {
'CXX_SOURCES': sources,
'EXE': exe_name,
@@ -1433,8 +1435,8 @@ class Base(unittest2.TestCase):
os.path.join(
os.environ["LLDB_SRC"],
"include")),
- 'LD_EXTRAS': "-L%s/../lib -llldb -Wl,-rpath,%s/../lib" % (lib_dir, lib_dir)}
- elif sys.platform.startswith('win'):
+ 'LD_EXTRAS': "-L%s -lliblldb" % os.environ["LLDB_IMPLIB_DIR"]}
+ else:
d = {
'CXX_SOURCES': sources,
'EXE': exe_name,
@@ -1443,7 +1445,7 @@ class Base(unittest2.TestCase):
os.path.join(
os.environ["LLDB_SRC"],
"include")),
- 'LD_EXTRAS': "-L%s -lliblldb" % os.environ["LLDB_IMPLIB_DIR"]}
+ 'LD_EXTRAS': "-L%s/../lib -llldb -Wl,-rpath,%s/../lib" % (lib_dir, lib_dir)}
if self.TraceOn():
print(
"Building LLDB Driver (%s) from sources %s" %
@@ -1464,15 +1466,6 @@ class Base(unittest2.TestCase):
'FRAMEWORK_INCLUDES': "-F%s" % self.framework_dir,
'LD_EXTRAS': "%s -Wl,-rpath,%s -dynamiclib" % (self.dsym, self.framework_dir),
}
- elif sys.platform.rstrip('0123456789') in ('freebsd', 'linux', 'netbsd', 'darwin') or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile':
- d = {
- 'DYLIB_CXX_SOURCES': sources,
- 'DYLIB_NAME': lib_name,
- 'CFLAGS_EXTRAS': "%s -I%s -fPIC" % (stdflag,
- os.path.join(
- os.environ["LLDB_SRC"],
- "include")),
- 'LD_EXTRAS': "-shared -L%s/../lib -llldb -Wl,-rpath,%s/../lib" % (lib_dir, lib_dir)}
elif self.getPlatform() == 'windows':
d = {
'DYLIB_CXX_SOURCES': sources,
@@ -1482,6 +1475,15 @@ class Base(unittest2.TestCase):
os.environ["LLDB_SRC"],
"include")),
'LD_EXTRAS': "-shared -l%s\liblldb.lib" % self.os.environ["LLDB_IMPLIB_DIR"]}
+ else:
+ d = {
+ 'DYLIB_CXX_SOURCES': sources,
+ 'DYLIB_NAME': lib_name,
+ 'CFLAGS_EXTRAS': "%s -I%s -fPIC" % (stdflag,
+ os.path.join(
+ os.environ["LLDB_SRC"],
+ "include")),
+ 'LD_EXTRAS': "-shared -L%s/../lib -llldb -Wl,-rpath,%s/../lib" % (lib_dir, lib_dir)}
if self.TraceOn():
print(
"Building LLDB Library (%s) from sources %s" %
@@ -1672,6 +1674,8 @@ class Base(unittest2.TestCase):
cflags += "c++11"
if self.platformIsDarwin() or self.getPlatform() == "freebsd":
cflags += " -stdlib=libc++"
+ elif self.getPlatform() == "openbsd":
+ cflags += " -stdlib=libc++"
elif self.getPlatform() == "netbsd":
cflags += " -stdlib=libstdc++"
elif "clang" in self.getCompiler():
@@ -1706,7 +1710,7 @@ class Base(unittest2.TestCase):
return lib_dir
def getLibcPlusPlusLibs(self):
- if self.getPlatform() in ('freebsd', 'linux', 'netbsd'):
+ if self.getPlatform() in ('freebsd', 'linux', 'netbsd', 'openbsd'):
return ['libc++.so.1']
else:
return ['libc++.1.dylib', 'libc++abi.dylib']
More information about the lldb-commits
mailing list