-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lower Arm64Call relocations in cranelift-object #2976
Conversation
The mini_core_hello_world example runs with this PR in combination with the following patch: diff --git a/example/mini_core.rs b/example/mini_core.rs
index c4834c80..aeec532d 100644
--- a/example/mini_core.rs
+++ b/example/mini_core.rs
@@ -285,9 +285,11 @@ fn ne(&self, other: &u64) -> bool {
}
impl PartialEq for u128 {
+ #[inline]
fn eq(&self, other: &u128) -> bool {
(*self) == (*other)
}
+ #[inline]
fn ne(&self, other: &u128) -> bool {
(*self) != (*other)
}
@@ -620,11 +622,3 @@ struct PanicLocation {
column: u32,
}
-#[no_mangle]
-#[cfg(not(windows))]
-pub fn get_tls() -> u8 {
- #[thread_local]
- static A: u8 = 42;
-
- A
-}
diff --git a/example/mini_core_hello_world.rs b/example/mini_core_hello_world.rs
index 6570f2bf..895f6a2e 100644
--- a/example/mini_core_hello_world.rs
+++ b/example/mini_core_hello_world.rs
@@ -287,37 +287,12 @@ struct ExternTypeWrapper {
assert_eq!(repeat[0], Some(42));
assert_eq!(repeat[1], Some(42));
- from_decimal_string();
-
- #[cfg(not(any(jit, windows)))]
- test_tls();
-
- #[cfg(all(not(jit), target_os = "linux"))]
- unsafe {
- global_asm_test();
- }
-
// Both statics have a reference that points to the same anonymous allocation.
static REF1: &u8 = &42;
static REF2: &u8 = REF1;
assert_eq!(*REF1, *REF2);
}
-#[cfg(all(not(jit), target_os = "linux"))]
-extern "C" {
- fn global_asm_test();
-}
-
-#[cfg(all(not(jit), target_os = "linux"))]
-global_asm! {
- "
- .global global_asm_test
- global_asm_test:
- // comment that would normally be removed by LLVM
- ret
- "
-}
-
#[repr(C)]
enum c_void {
_1,
diff --git a/src/lib.rs b/src/lib.rs
index cfc5902c..c154fde3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -288,7 +288,7 @@ fn build_isa(sess: &Session, backend_config: &BackendConfig) -> Box<dyn isa::Tar
cranelift_codegen::isa::lookup_variant(target_triple, variant).unwrap();
// Don't use "haswell" as the default, as it implies `has_lzcnt`.
// macOS CI is still at Ivy Bridge EP, so `lzcnt` is interpreted as `bsr`.
- builder.enable("nehalem").unwrap();
+ //builder.enable("nehalem").unwrap();
builder
}
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
CI failures are curious -- the particular relocation enum value seems to be missing in some builds. Old pinned version, or Cargo feature dependency maybe? |
The CI failure is because gimli-rs/object#322 needs to be merged first. |
Ah, sorry, missed that it was still pending. Thanks! |
Object released a new version with the change. CI passed. |
At least TLS support and better 128bit int support will also be necessary for cg_clif to work on AArch64.
Depends on gimli-rs/object#322