From 105f0d834d67546166ec44be3d561a8b7739c98e Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 22 Jan 2024 12:55:25 +0100 Subject: [PATCH 1/4] Only add 80-bit long double source on x86 These no longer build on other architectures with LLVM 18. In previous versions they used an incorrect float layout. --- library/compiler-builtins/build.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/library/compiler-builtins/build.rs b/library/compiler-builtins/build.rs index d4b2a9b499e9..690a4fc9b687 100644 --- a/library/compiler-builtins/build.rs +++ b/library/compiler-builtins/build.rs @@ -290,17 +290,23 @@ mod c { sources.extend(&[ ("__divdc3", "divdc3.c"), ("__divsc3", "divsc3.c"), - ("__divxc3", "divxc3.c"), ("__extendhfsf2", "extendhfsf2.c"), ("__muldc3", "muldc3.c"), ("__mulsc3", "mulsc3.c"), - ("__mulxc3", "mulxc3.c"), ("__negdf2", "negdf2.c"), ("__negsf2", "negsf2.c"), - ("__powixf2", "powixf2.c"), ("__truncdfhf2", "truncdfhf2.c"), ("__truncsfhf2", "truncsfhf2.c"), ]); + + if target_arch == "x86" || target_arch == "x86_64" { + // Only add 80-bit long double sources on x86. + sources.extend(&[ + ("__divxc3", "divxc3.c"), + ("__mulxc3", "mulxc3.c"), + ("__powixf2", "powixf2.c"), + ]); + } } // When compiling in rustbuild (the rust-lang/rust repo) this library From 8ca492c7d7858ded13f2f83c560d8b467e700a54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Wed, 24 Jan 2024 19:38:55 +0100 Subject: [PATCH 2/4] CI: add a success conclusion job --- .../compiler-builtins/.github/workflows/main.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/library/compiler-builtins/.github/workflows/main.yml b/library/compiler-builtins/.github/workflows/main.yml index 360ed97391d6..9f15cb9d831b 100644 --- a/library/compiler-builtins/.github/workflows/main.yml +++ b/library/compiler-builtins/.github/workflows/main.yml @@ -128,3 +128,18 @@ jobs: run: | rustup set profile minimal && rustup default "nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/clippy)" && rustup component add clippy - run: cargo clippy -- -D clippy::all + + success: + needs: + - test + - rustfmt + - clippy + runs-on: ubuntu-latest + # GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency + # failed" as success. So we have to do some contortions to ensure the job fails if any of its + # dependencies fails. + if: always() # make sure this is never "skipped" + steps: + # Manually check the status of all dependencies. `if: failure()` does not work. + - name: check if any dependency failed + run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' From 845f4e75d12c43acbbc7a7347e6d07ee2094f21a Mon Sep 17 00:00:00 2001 From: BD103 <59022059+BD103@users.noreply.github.com> Date: Wed, 24 Jan 2024 13:57:31 -0500 Subject: [PATCH 3/4] fix: replace travis link with github actions link --- library/compiler-builtins/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/compiler-builtins/README.md b/library/compiler-builtins/README.md index da0adbce70c6..adcdcacbac12 100644 --- a/library/compiler-builtins/README.md +++ b/library/compiler-builtins/README.md @@ -62,7 +62,7 @@ features = ["c"] [1]: https://github.com/rust-lang/llvm-project/tree/9e3de9490ff580cd484fbfa2908292b4838d56e7/compiler-rt/test/builtins/Unit [2]: https://github.com/rust-lang/llvm-project/tree/9e3de9490ff580cd484fbfa2908292b4838d56e7/compiler-rt/lib/builtins [3]: https://github.com/rust-lang/compiler-builtins/blob/0ba07e49264a54cb5bbd4856fcea083bb3fbec15/build.rs#L180-L265 -[4]: https://travis-ci.org/rust-lang/compiler-builtins +[4]: https://github.com/rust-lang/compiler-builtins/actions ### Porting Reminders From 45a113effb32fabd8d6098a412bca2a2cbb85f15 Mon Sep 17 00:00:00 2001 From: Tyler Mandry Date: Thu, 4 Jan 2024 18:43:58 -0800 Subject: [PATCH 4/4] Handle move of cpu_model.c This happened in https://github.com/llvm/llvm-project/pull/75635/files and shows up when building against a recent commit of LLVM. --- library/compiler-builtins/build.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/compiler-builtins/build.rs b/library/compiler-builtins/build.rs index 690a4fc9b687..c133d5e7ced6 100644 --- a/library/compiler-builtins/build.rs +++ b/library/compiler-builtins/build.rs @@ -602,7 +602,12 @@ mod c { build_aarch64_out_of_line_atomics_libraries(&src_dir, cfg); // Some run-time CPU feature detection is necessary, as well. - sources.extend(&[("__aarch64_have_lse_atomics", "cpu_model.c")]); + let cpu_model_src = if src_dir.join("cpu_model.c").exists() { + "cpu_model.c" + } else { + "cpu_model/aarch64.c" + }; + sources.extend(&[("__aarch64_have_lse_atomics", cpu_model_src)]); } let mut added_sources = HashSet::new();