summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_llvm
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /compiler/rustc_llvm
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_llvm')
-rw-r--r--compiler/rustc_llvm/Cargo.toml8
-rw-r--r--compiler/rustc_llvm/build.rs6
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/LLVMWrapper.h1
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp28
-rw-r--r--compiler/rustc_llvm/src/lib.rs3
5 files changed, 27 insertions, 19 deletions
diff --git a/compiler/rustc_llvm/Cargo.toml b/compiler/rustc_llvm/Cargo.toml
index 34556df3c..58e219e5a 100644
--- a/compiler/rustc_llvm/Cargo.toml
+++ b/compiler/rustc_llvm/Cargo.toml
@@ -3,12 +3,12 @@ name = "rustc_llvm"
version = "0.0.0"
edition = "2021"
-[features]
-static-libstdcpp = []
-emscripten = []
-
[dependencies]
+# tidy-alphabetical-start
libc = "0.2.73"
+# tidy-alphabetical-end
[build-dependencies]
+# tidy-alphabetical-start
cc = "1.0.69"
+# tidy-alphabetical-end
diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
index f606fa483..fe13162cd 100644
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
@@ -258,6 +258,12 @@ fn main() {
{
println!("cargo:rustc-link-lib=z");
} else if target.contains("netbsd") {
+ // On NetBSD/i386, gcc and g++ is built for i486 (to maximize backward compat)
+ // However, LLVM insists on using 64-bit atomics.
+ // This gives rise to a need to link rust itself with -latomic for these targets
+ if target.starts_with("i586") || target.starts_with("i686") {
+ println!("cargo:rustc-link-lib=atomic");
+ }
println!("cargo:rustc-link-lib=z");
println!("cargo:rustc-link-lib=execinfo");
}
diff --git a/compiler/rustc_llvm/llvm-wrapper/LLVMWrapper.h b/compiler/rustc_llvm/llvm-wrapper/LLVMWrapper.h
index 3f2bf2c9b..142384e6d 100644
--- a/compiler/rustc_llvm/llvm-wrapper/LLVMWrapper.h
+++ b/compiler/rustc_llvm/llvm-wrapper/LLVMWrapper.h
@@ -25,7 +25,6 @@
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Instrumentation.h"
#include "llvm/Transforms/Scalar.h"
-#include "llvm/Transforms/Vectorize.h"
#define LLVM_VERSION_GE(major, minor) \
(LLVM_VERSION_MAJOR > (major) || \
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
index b729c4022..31565db1b 100644
--- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
@@ -795,6 +795,20 @@ LLVMRustOptimize(
CGSCCAnalysisManager CGAM;
ModuleAnalysisManager MAM;
+ if (LLVMPluginsLen) {
+ auto PluginsStr = StringRef(LLVMPlugins, LLVMPluginsLen);
+ SmallVector<StringRef> Plugins;
+ PluginsStr.split(Plugins, ',', -1, false);
+ for (auto PluginPath: Plugins) {
+ auto Plugin = PassPlugin::Load(PluginPath.str());
+ if (!Plugin) {
+ LLVMRustSetLastError(("Failed to load pass plugin" + PluginPath.str()).c_str());
+ return LLVMRustResult::Failure;
+ }
+ Plugin->registerPassBuilderCallbacks(PB);
+ }
+ }
+
FAM.registerPass([&] { return PB.buildDefaultAAPipeline(); });
Triple TargetTriple(TheModule->getTargetTriple());
@@ -918,20 +932,6 @@ LLVMRustOptimize(
}
}
- if (LLVMPluginsLen) {
- auto PluginsStr = StringRef(LLVMPlugins, LLVMPluginsLen);
- SmallVector<StringRef> Plugins;
- PluginsStr.split(Plugins, ',', -1, false);
- for (auto PluginPath: Plugins) {
- auto Plugin = PassPlugin::Load(PluginPath.str());
- if (!Plugin) {
- LLVMRustSetLastError(("Failed to load pass plugin" + PluginPath.str()).c_str());
- return LLVMRustResult::Failure;
- }
- Plugin->registerPassBuilderCallbacks(PB);
- }
- }
-
ModulePassManager MPM;
bool NeedThinLTOBufferPasses = UseThinLTOBuffers;
if (!NoPrepopulatePasses) {
diff --git a/compiler/rustc_llvm/src/lib.rs b/compiler/rustc_llvm/src/lib.rs
index eb7096150..518c20c9f 100644
--- a/compiler/rustc_llvm/src/lib.rs
+++ b/compiler/rustc_llvm/src/lib.rs
@@ -1,6 +1,9 @@
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
+#![cfg_attr(not(bootstrap), doc(rust_logo))]
+#![cfg_attr(not(bootstrap), feature(rustdoc_internals))]
+#![cfg_attr(not(bootstrap), allow(internal_features))]
// NOTE: This crate only exists to allow linking on mingw targets.