about summary refs log tree commit diff
path: root/example
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2020-08-16 21:20:12 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2020-08-20 15:24:33 +0200
commitca9fc101c00e33a0735a3bd2fa44eeeb7841422f (patch)
treed09008e0c73f798f98c0bca0838c0e1b04c4ac26 /example
parent02b7cdc316b733649635fe7df1051429b0dfe25b (diff)
downloadrust-ca9fc101c00e33a0735a3bd2fa44eeeb7841422f.tar.gz
rust-ca9fc101c00e33a0735a3bd2fa44eeeb7841422f.zip
Fix weak linkage
This removes the last sysroot patch apart from the few patches that disable tests
Diffstat (limited to 'example')
-rw-r--r--example/mini_core_hello_world.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/example/mini_core_hello_world.rs b/example/mini_core_hello_world.rs
index 9c2ab5a5165..d79f9f5f79c 100644
--- a/example/mini_core_hello_world.rs
+++ b/example/mini_core_hello_world.rs
@@ -241,19 +241,22 @@ fn main() {
 
     assert_eq!(((|()| 42u8) as fn(()) -> u8)(()), 42);
 
-    extern {
-        #[linkage = "extern_weak"]
-        static ABC: *const u8;
-    }
-
+    #[cfg(not(jit))]
     {
         extern {
             #[linkage = "extern_weak"]
             static ABC: *const u8;
         }
-    }
 
-    unsafe { assert_eq!(ABC as usize, 0); }
+        {
+            extern {
+                #[linkage = "extern_weak"]
+                static ABC: *const u8;
+            }
+        }
+
+        unsafe { assert_eq!(ABC as usize, 0); }
+    }
 
     &mut (|| Some(0 as *const ())) as &mut dyn FnMut() -> Option<*const ()>;