def LibCXXABI(): buildbot.Step('libcxxabi') # TODO(sbc): Remove this. # The compiler-rt doesn't currently rebuild libraries when a new -DCMAKE_AR # value is specified. if os.path.isdir(LIBCXXABI_OUT_DIR): Remove(LIBCXXABI_OUT_DIR) Mkdir(LIBCXXABI_OUT_DIR) command = [ CMAKE_BIN, '-G', CMAKE_GENERATOR, LIBCXXABI_SRC_DIR, '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DCMAKE_TOOLCHAIN_FILE=' + WindowsFSEscape(os.path.join(HOST_DIR, 'wavix_toolchain.cmake')), '-DCMAKE_EXPORT_COMPILE_COMMANDS=YES', '-DCMAKE_C_COMPILER_WORKS=YES', '-DCMAKE_CXX_COMPILER_WORKS=YES', '-DLIBCXXABI_LIBCXX_PATH=' + LIBCXX_SRC_DIR, '-DLIBCXXABI_LIBCXX_INCLUDES=' + os.path.join(LIBCXX_SRC_DIR, 'include'), '-DLIBCXXABI_ENABLE_STATIC=ON', '-DLIBCXXABI_ENABLE_SHARED=OFF', '-DLIBCXXABI_ENABLE_THREADS=ON', '-DLIBCXXABI_SYSROOT=' + SYSROOT_DIR, '-DLIBCXXABI_USE_COMPILER_RT=ON', '-DLIBCXXABI_ENABLE_PIC=OFF', '-DCMAKE_INSTALL_PREFIX=' + WindowsFSEscape(SYSROOT_DIR) ] proc.check_call(command, cwd=LIBCXXABI_OUT_DIR) proc.check_call([NINJA_BIN, 'install'], cwd=LIBCXXABI_OUT_DIR) CopyLibraryToSysroot(SYSROOT_DIR, os.path.join(LIBCXXABI_SRC_DIR, 'libc++abi.imports'))
def CompilerRT(): # TODO(sbc): Figure out how to do this step as part of the llvm build. # I suspect that this can be done using the llvm/runtimes directory but # have yet to make it actually work this way. buildbot.Step('compiler-rt') # TODO(sbc): Remove this. # The compiler-rt doesn't currently rebuild libraries when a new -DCMAKE_AR # value is specified. if os.path.isdir(COMPILER_RT_OUT_DIR): Remove(COMPILER_RT_OUT_DIR) Mkdir(COMPILER_RT_OUT_DIR) command = [ CMAKE_BIN, '-G', CMAKE_GENERATOR, WindowsFSEscape(os.path.join(COMPILER_RT_SRC_DIR, 'lib', 'builtins')), '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DCMAKE_TOOLCHAIN_FILE=' + WindowsFSEscape(os.path.join(HOST_DIR, 'wavix_toolchain.cmake')), '-DCMAKE_EXPORT_COMPILE_COMMANDS=YES', '-DCMAKE_C_COMPILER_WORKS=YES', '-DCMAKE_CXX_COMPILER_WORKS=YES', '-DCOMPILER_RT_BAREMETAL_BUILD=On', '-DCOMPILER_RT_BUILD_XRAY=OFF', '-DCOMPILER_RT_INCLUDE_TESTS=OFF', '-DCOMPILER_RT_ENABLE_IOS=OFF', '-DCOMPILER_RT_DEFAULT_TARGET_ONLY=On', '-DLLVM_CONFIG_PATH=' + WindowsFSEscape(os.path.join(HOST_DIR, 'bin', 'llvm-config')), '-DCOMPILER_RT_OS_DIR=wavix', '-DCMAKE_INSTALL_PREFIX=' + WindowsFSEscape(os.path.join(HOST_DIR, 'lib', 'clang', '9.0.0')) ] proc.check_call(command, cwd=COMPILER_RT_OUT_DIR) proc.check_call([NINJA_BIN, 'install'], cwd=COMPILER_RT_OUT_DIR)
def LinkLLVMTorture(name, linker, fails, indir, outdir, extension, opt, args=None): buildbot.Step('Link LLVM Torture (%s, %s)' % (name, opt)) assert os.path.isfile(linker), 'Cannot find linker at %s' % linker Remove(outdir) Mkdir(outdir) input_pattern = os.path.join(indir, '*.' + extension) unexpected_result_count = link_assembly_files.run( linker=linker, files=input_pattern, fails=fails, attributes=[opt], out=outdir, args=args) if 0 != unexpected_result_count: buildbot.Fail()
def CompileLLVMTorture(outdir, opt): name = 'Compile LLVM Torture (%s)' % (opt) buildbot.Step(name) c = Executable(os.path.join(HOST_BIN, 'clang')) cxx = Executable(os.path.join(HOST_BIN, 'clang++')) Remove(outdir) Mkdir(outdir) unexpected_result_count = compile_torture_tests.run( c=c, cxx=cxx, testsuite=GCC_TEST_DIR, sysroot_dir=SYSROOT_DIR, fails=LLVM_KNOWN_TORTURE_FAILURES, out=outdir, config='wasm-o', opt=opt) if 0 != unexpected_result_count: buildbot.Fail()
def LibCXX(): buildbot.Step('libcxx') # TODO(sbc): Remove this. # The compiler-rt doesn't currently rebuild libraries when a new -DCMAKE_AR # value is specified. if os.path.isdir(LIBCXX_OUT_DIR): Remove(LIBCXX_OUT_DIR) Mkdir(LIBCXX_OUT_DIR) command = [ CMAKE_BIN, '-G', CMAKE_GENERATOR, LIBCXX_SRC_DIR, '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DCMAKE_TOOLCHAIN_FILE=' + WindowsFSEscape(os.path.join(HOST_DIR, 'wavix_toolchain.cmake')), '-DCMAKE_EXPORT_COMPILE_COMMANDS=YES', # Make HandleLLVMOptions.cmake (it can't check for c++11 support # because no C++ programs can be linked until libc++abi is # installed, so chicken and egg. '-DCXX_SUPPORTS_CXX11=ON', '-DCXX_SUPPORTS_CXX14=ON', '-DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF', # HandleLLVMOptions.cmake include CheckCompilerVersion.cmake. # This checks for working <atomic> header, which in turn errors # out on systems with threads disabled '-DLLVM_COMPILER_CHECKED=ON', '-DCMAKE_C_COMPILER_WORKS=YES', '-DCMAKE_CXX_COMPILER_WORKS=YES', '-DLIBCXX_CXX_ABI=libcxxabi', '-DLIBCXX_CXX_ABI_INCLUDE_PATHS=' + WindowsFSEscape(os.path.join(LIBCXXABI_SRC_DIR, 'include')), '-DLIBCXX_CXX_ABI_LIBRARY_PATH=' + WindowsFSEscape(os.path.join(SYSROOT_DIR, 'lib')), '-DLLVM_PATH=' + LLVM_SRC_DIR, '-DLIBCXX_ENABLE_STATIC=ON', '-DLIBCXX_ENABLE_SHARED=OFF', '-DLIBCXX_HAS_MUSL_LIBC=ON', '-DLIBCXX_ENABLE_THREADS=ON', '-DLIBCXX_INCLUDE_BENCHMARKS=OFF', '-DCMAKE_INSTALL_PREFIX=' + WindowsFSEscape(SYSROOT_DIR) ] proc.check_call(command, cwd=LIBCXX_OUT_DIR) proc.check_call([NINJA_BIN, 'install'], cwd=LIBCXX_OUT_DIR)
def HelloWorld(): buildbot.Step('HelloWorld') # TODO(sbc): Remove this. # The compiler-rt doesn't currently rebuild libraries when a new -DCMAKE_AR # value is specified. if os.path.isdir(HELLOWORLD_OUT_DIR): Remove(HELLOWORLD_OUT_DIR) Mkdir(HELLOWORLD_OUT_DIR) command = [ CMAKE_BIN, '-G', CMAKE_GENERATOR, HELLOWORLD_SRC_DIR, '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DCMAKE_TOOLCHAIN_FILE=' + WindowsFSEscape(os.path.join(HOST_DIR, 'wavix_toolchain.cmake')), '-DCMAKE_EXPORT_COMPILE_COMMANDS=YES', '-DCMAKE_INSTALL_PREFIX=' + WindowsFSEscape(SYSROOT_DIR) ] proc.check_call(command, cwd=HELLOWORLD_OUT_DIR) proc.check_call([NINJA_BIN, 'install'], cwd=HELLOWORLD_OUT_DIR)
def Clobber(): buildbot.Step('Clobbering work dir') #if os.path.isdir(BUILD_DIR): # Remove(BUILD_DIR) Remove(HOST_DIR) Remove(SYSROOT_DIR)