Index: buildbot/osuosl/master/config/builders.py =================================================================== --- buildbot/osuosl/master/config/builders.py +++ buildbot/osuosl/master/config/builders.py @@ -70,15 +70,26 @@ 'slavenames':["systemz-1"], 'builddir':"llvm-s390x-linux1", 'factory': LLVMBuilder.getLLVMBuildFactory("s390x-linux-gnu", jobs=4, clean=False, timeout=20, config_name='Release+Asserts')}, - + # We currently have to force LLVM_HOST_TRIPLE and + # LLVM_DEFAULT_TARGET_TRIPLE on this system. CMake gets the value + # correct for the processor but it's currently not possible to emit O32 + # code using a mips64-* triple. This is a bug and should be fixed soon. + # We must also force LLVM_TARGET_ARCH so that the ExecutionEngine tests + # run. {'name': "llvm-mips-linux", 'slavenames':["mipsswbrd002"], 'builddir':"llvm-mips-linux", - 'factory': LLVMBuilder.getLLVMBuildFactory("mips-linux-gnu", timeout=40, config_name='Release+Asserts', - extra_configure_args=["--with-extra-options=-mips32r2", - "CC=/mips/proj/build-compiler/clang-be-o32-latest/bin/clang", - "CXX=/mips/proj/build-compiler/clang-be-o32-latest/bin/clang++", - "--with-extra-ld-options=-mips32r2"])}, + 'factory': LLVMBuilder.getLLVMCMakeBuildFactory( + timeout=40, config_name='Release', + enable_shared=True, + extra_cmake_args=["-DLLVM_HOST_TRIPLE=mips-linux-gnu", + "-DLLVM_DEFAULT_TARGET_TRIPLE=mips-linux-gnu", + "-DLLVM_TARGET_ARCH=Mips", + "-DLLVM_ENABLE_ASSERTIONS=ON", + "-DLLVM_PARALLEL_LINK_JOBS=1"], + env={'CC': '/mips/proj/build-compiler/clang-be-o32-latest/bin/clang', + 'CXX': '/mips/proj/build-compiler/clang-be-o32-latest/bin/clang++', + })}, {'name': "llvm-aarch64-linux", 'slavenames':["aarch64-foundation"], 'builddir':"llvm-aarch64-linux", @@ -692,8 +703,8 @@ extra_cmake_args=["-DLLVM_TARGETS_TO_BUILD='ARM;AArch64'"])}, # Mips check-all with CMake builder - # We currently have to force CMAKE_HOST_TRIPLE and - # CMAKE_DEFAULT_TARGET_TRIPLE on this system. CMake gets the value + # We currently have to force LLVM_HOST_TRIPLE and + # LLVM_DEFAULT_TARGET_TRIPLE on this system. CMake gets the value # correct for the processor but it's currently not possible to emit O32 # code using a mips64-* triple. This is a bug and should be fixed soon. # We must also force LLVM_TARGET_ARCH so that the ExecutionEngine tests @@ -710,8 +721,8 @@ stage1_upload_directory='clang-cmake-mips', env = {'BOTO_CONFIG': '/var/buildbot/llvmlab-build-artifacts.boto'})}, # Mips check-all with CMake builder - # We currently have to force CMAKE_HOST_TRIPLE and - # CMAKE_DEFAULT_TARGET_TRIPLE on this system. CMake gets the value + # We currently have to force LLVM_HOST_TRIPLE and + # LLVM_DEFAULT_TARGET_TRIPLE on this system. CMake gets the value # correct for the processor but it's currently not possible to emit O32 # code using a mips64-* triple. This is a bug and should be fixed soon. # We must also force LLVM_TARGET_ARCH so that the ExecutionEngine tests Index: zorg/buildbot/builders/LLVMBuilder.py =================================================================== --- zorg/buildbot/builders/LLVMBuilder.py +++ zorg/buildbot/builders/LLVMBuilder.py @@ -135,3 +135,91 @@ workdir = llvm_objdir, env = merged_env)) return f + +def getLLVMCMakeBuildFactory( + clean = True, # "clean-llvm" step is requested if true. + test = True, # "test-llvm" step is requested if true. + jobs = '%(jobs)s', # Number of concurrent jobs. + timeout = 20, # Timeout if no activity seen (minutes). + make = 'make', # Make command. + enable_shared = False, # Enable shared (-DBUILD_SHARED_LIBS=ON configure parameters added) if true. + defaultBranch = 'trunk', # Branch to build. + config_name = 'Debug', # Configuration name. + env = {}, # Environmental variables for all steps. + extra_cmake_args = []): # Extra args for the cmake step. + # Prepare environmental variables. Set here all env we want everywhere. + merged_env = { + 'TERM' : 'dumb' # Make sure Clang doesn't use color escape sequences. + } + if env is not None: + merged_env.update(env) # Overwrite pre-set items with the given ones, so user can set anything. + + llvm_srcdir = "llvm.src" + llvm_objdir = "llvm.obj" + + f = buildbot.process.factory.BuildFactory() + + # Determine the build directory. + f.addStep( + buildbot.steps.shell.SetProperty( + name = "get_builddir", + command = ["pwd"], + property = "builddir", + description = "set build dir", + workdir = ".", + env = merged_env)) + + # Checkout sources. + f.addStep( + SVN( + name = 'svn-llvm', + mode = 'update', baseURL='http://llvm.org/svn/llvm-project/llvm/', + defaultBranch = defaultBranch, + workdir = llvm_srcdir)) + + cmake_args = ['cmake'] + cmake_args += ["-DCMAKE_BUILD_TYPE="+config_name], + if enable_shared: + cmake_args.append('-DBUILD_SHARED_LIBS=ON') + cmake_args.extend(extra_cmake_args) + cmake_args += ['../' + llvm_srcdir] + f.addStep( + Configure( + command = cmake_args, + description = ['configuring', config_name], + descriptionDone = ['configure', config_name], + workdir = llvm_objdir, + env = merged_env)) + if clean: + f.addStep( + WarningCountingShellCommand( + name = "clean-llvm", + command = [make, 'clean'], + haltOnFailure = True, + description = "cleaning llvm", + descriptionDone = "clean llvm", + workdir = llvm_objdir, + env = merged_env)) + f.addStep( + WarningCountingShellCommand( + name = "compile", + command = ['nice', '-n', '10', + make, WithProperties("-j%s" % jobs)], + haltOnFailure = True, + description = "compiling llvm", + descriptionDone = "compile llvm", + workdir = llvm_objdir, + env = merged_env, + timeout = timeout * 60)) + if test: + litTestArgs = '-v -j %s' % jobs + f.addStep( + LitTestCommand( + name = 'test-llvm', + command = [make, "check-all", "VERBOSE=1", + WithProperties("LIT_ARGS=%s" % litTestArgs)], + description = ["testing", "llvm"], + descriptionDone = ["test", "llvm"], + workdir = llvm_objdir, + env = merged_env)) + return f