From d7ab3d87e1bdb78fd678f64587599c75b616d92a Mon Sep 17 00:00:00 2001 From: Leandro Lupori Date: Thu, 17 Apr 2025 18:06:08 -0300 Subject: [PATCH 1/4] Fix flang-aarch64-libcxx builder After flang-rt, flang-aarch64-libcxx builder started to fail. Before it, llvm libraries, flang and its runtime were built with the host compiler, but now flang runtime is built with the stage 1 clang. The problem is that the C++ library of these compilers may be incompatible. The linked issue has more details. To avoid this issue, build flang-rt with the host compiler. Fixes https://github.com/llvm/llvm-project/issues/135381 --- buildbot/osuosl/master/config/builders.py | 3 +++ zorg/buildbot/builders/FlangBuilder.py | 14 +++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/buildbot/osuosl/master/config/builders.py b/buildbot/osuosl/master/config/builders.py index 07118eb4b..3ccc8891e 100644 --- a/buildbot/osuosl/master/config/builders.py +++ b/buildbot/osuosl/master/config/builders.py @@ -2540,6 +2540,9 @@ "-DLLVM_ENABLE_ASSERTIONS=ON", "-DLLVM_ENABLE_LIBCXX=On", "-DCMAKE_BUILD_TYPE=Release", + "-DLLVM_RUNTIME_TARGETS=aarch64-unknown-linux-gnu", + "-DRUNTIMES_aarch64-unknown-linux-gnu_CMAKE_CXX_COMPILER='c++'", + "-DRUNTIMES_aarch64-unknown-linux-gnu_CMAKE_C_COMPILER='cc'" ])}, {'name' : "flang-aarch64-release", diff --git a/zorg/buildbot/builders/FlangBuilder.py b/zorg/buildbot/builders/FlangBuilder.py index c26dffdc6..ef3e71e22 100644 --- a/zorg/buildbot/builders/FlangBuilder.py +++ b/zorg/buildbot/builders/FlangBuilder.py @@ -138,10 +138,22 @@ def getFlangOutOfTreeBuildFactory( ) ) + # 'check-flang-rt' becomes 'check-flang-rt-' when a runtime target + # is specified. + check_flang_rt = 'check-flang-rt' + for arg in llvm_extra_configure_args: + if arg.find("DLLVM_RUNTIME_TARGETS") != -1: + targets = arg.split('=', 1)[1] + # Currently only one target is supported. + if not targets or targets.find(";") != -1: + break + check_flang_rt += '-' + targets + break + addNinjaSteps( f, obj_dir=flang_rt_obj_dir, - checks=['check-flang-rt'], + checks=[check_flang_rt], env=env, stage_name="flang-rt", **kwargs) From c24ade70abee18787785210e699d6a13328e9d53 Mon Sep 17 00:00:00 2001 From: Leandro Lupori Date: Wed, 18 Jun 2025 11:14:46 -0300 Subject: [PATCH 2/4] Revert "Fix flang-aarch64-libcxx builder" This reverts commit d7ab3d87e1bdb78fd678f64587599c75b616d92a. --- buildbot/osuosl/master/config/builders.py | 3 --- zorg/buildbot/builders/FlangBuilder.py | 14 +------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/buildbot/osuosl/master/config/builders.py b/buildbot/osuosl/master/config/builders.py index 3ccc8891e..07118eb4b 100644 --- a/buildbot/osuosl/master/config/builders.py +++ b/buildbot/osuosl/master/config/builders.py @@ -2540,9 +2540,6 @@ "-DLLVM_ENABLE_ASSERTIONS=ON", "-DLLVM_ENABLE_LIBCXX=On", "-DCMAKE_BUILD_TYPE=Release", - "-DLLVM_RUNTIME_TARGETS=aarch64-unknown-linux-gnu", - "-DRUNTIMES_aarch64-unknown-linux-gnu_CMAKE_CXX_COMPILER='c++'", - "-DRUNTIMES_aarch64-unknown-linux-gnu_CMAKE_C_COMPILER='cc'" ])}, {'name' : "flang-aarch64-release", diff --git a/zorg/buildbot/builders/FlangBuilder.py b/zorg/buildbot/builders/FlangBuilder.py index ef3e71e22..c26dffdc6 100644 --- a/zorg/buildbot/builders/FlangBuilder.py +++ b/zorg/buildbot/builders/FlangBuilder.py @@ -138,22 +138,10 @@ def getFlangOutOfTreeBuildFactory( ) ) - # 'check-flang-rt' becomes 'check-flang-rt-' when a runtime target - # is specified. - check_flang_rt = 'check-flang-rt' - for arg in llvm_extra_configure_args: - if arg.find("DLLVM_RUNTIME_TARGETS") != -1: - targets = arg.split('=', 1)[1] - # Currently only one target is supported. - if not targets or targets.find(";") != -1: - break - check_flang_rt += '-' + targets - break - addNinjaSteps( f, obj_dir=flang_rt_obj_dir, - checks=[check_flang_rt], + checks=['check-flang-rt'], env=env, stage_name="flang-rt", **kwargs) From 725671b0383a7ba77deca7e228c4dd249204a529 Mon Sep 17 00:00:00 2001 From: Leandro Lupori Date: Wed, 18 Jun 2025 09:45:38 -0300 Subject: [PATCH 3/4] Use getCmakeWithNinjaBuildFactory() for flang-aarch64-libcxx --- buildbot/osuosl/master/config/builders.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/buildbot/osuosl/master/config/builders.py b/buildbot/osuosl/master/config/builders.py index 07118eb4b..ba723ec68 100644 --- a/buildbot/osuosl/master/config/builders.py +++ b/buildbot/osuosl/master/config/builders.py @@ -2526,21 +2526,30 @@ 'tags' : ['flang'], 'workernames' : ["linaro-flang-aarch64-libcxx"], 'builddir': "flang-aarch64-libcxx", - 'factory' : UnifiedTreeBuilder.getCmakeWithNinjaBuildFactory( - clean=True, - checks=['check-flang','check-flang-rt'], - depends_on_projects=['llvm','mlir','clang','flang','flang-rt'], - extra_configure_args=[ + 'factory' : FlangBuilder.getFlangOutOfTreeBuildFactory( + checks=['check-flang'], + llvm_extra_configure_args=[ "-DLLVM_TARGETS_TO_BUILD=AArch64", - "-DLLVM_INSTALL_UTILS=ON", "-DCMAKE_CXX_STANDARD=17", "-DLLVM_ENABLE_WERROR=OFF", + "-DBUILD_SHARED_LIBS=ON", + "-DLLVM_ENABLE_ASSERTIONS=ON", + "-DLLVM_ENABLE_LIBCXX=On", + "-DCMAKE_BUILD_TYPE=Release", + ], + flang_extra_configure_args=[ "-DFLANG_ENABLE_WERROR=ON", "-DBUILD_SHARED_LIBS=ON", "-DLLVM_ENABLE_ASSERTIONS=ON", "-DLLVM_ENABLE_LIBCXX=On", "-DCMAKE_BUILD_TYPE=Release", - ])}, + ], + flang_rt_extra_configure_args=[ + "-DBUILD_SHARED_LIBS=ON", + "-DLLVM_ENABLE_ASSERTIONS=ON", + "-DLLVM_ENABLE_LIBCXX=On", + "-DCMAKE_BUILD_TYPE=Release", + ])}, {'name' : "flang-aarch64-release", 'tags' : ["flang"], From ff7e68063272c859c472a0d325e290aa0d8189e7 Mon Sep 17 00:00:00 2001 From: Leandro Lupori Date: Mon, 23 Jun 2025 10:22:37 -0300 Subject: [PATCH 4/4] Don't build shared libs --- buildbot/osuosl/master/config/builders.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/buildbot/osuosl/master/config/builders.py b/buildbot/osuosl/master/config/builders.py index ba723ec68..e34059324 100644 --- a/buildbot/osuosl/master/config/builders.py +++ b/buildbot/osuosl/master/config/builders.py @@ -2532,20 +2532,17 @@ "-DLLVM_TARGETS_TO_BUILD=AArch64", "-DCMAKE_CXX_STANDARD=17", "-DLLVM_ENABLE_WERROR=OFF", - "-DBUILD_SHARED_LIBS=ON", "-DLLVM_ENABLE_ASSERTIONS=ON", "-DLLVM_ENABLE_LIBCXX=On", "-DCMAKE_BUILD_TYPE=Release", ], flang_extra_configure_args=[ "-DFLANG_ENABLE_WERROR=ON", - "-DBUILD_SHARED_LIBS=ON", "-DLLVM_ENABLE_ASSERTIONS=ON", "-DLLVM_ENABLE_LIBCXX=On", "-DCMAKE_BUILD_TYPE=Release", ], flang_rt_extra_configure_args=[ - "-DBUILD_SHARED_LIBS=ON", "-DLLVM_ENABLE_ASSERTIONS=ON", "-DLLVM_ENABLE_LIBCXX=On", "-DCMAKE_BUILD_TYPE=Release",