Index: lit/lit.cfg =================================================================== --- lit/lit.cfg +++ lit/lit.cfg @@ -78,6 +78,10 @@ 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)) Index: packages/Python/lldbsuite/test/lldbtest.py =================================================================== --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -490,6 +490,8 @@ 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 @@ 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 @@ '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 @@ 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 @@ 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 @@ '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 @@ 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 @@ 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 @@ 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'] Index: packages/Python/lldbsuite/test/plugins/builder_openbsd.py =================================================================== --- /dev/null +++ packages/Python/lldbsuite/test/plugins/builder_openbsd.py @@ -0,0 +1,10 @@ +from builder_base import * + + +def buildDsym( + sender=None, + architecture=None, + compiler=None, + dictionary=None, + testdir=None): + return False