about summary refs log tree commit diff
path: root/src/libstd/sys/windows/mod.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-07-16 16:38:56 -0700
committerAlex Crichton <alex@alexcrichton.com>2018-08-15 17:20:13 -0700
commitfccc04d3e72bb462cba1b492ba0e2cd4ab2aebec (patch)
treec7f02bfe96a7865c68ce3403516ed220ce0510fb /src/libstd/sys/windows/mod.rs
parentd767ee11616390d128853a06f5addb619e79213f (diff)
downloadrust-fccc04d3e72bb462cba1b492ba0e2cd4ab2aebec.tar.gz
rust-fccc04d3e72bb462cba1b492ba0e2cd4ab2aebec.zip
Start adding an `aarch64-pc-windows-msvc` target
This commit adds the necessary definitions for target specs and such as well as
the necessary support in libstd to compile basic `aarch64-pc-windows-msvc`
binaries. The target is not currently built on CI, but it can be built locally
with:

    ./configure --target=aarch64-pc-windows-msvc --set rust.lld
    ./x.py build src/libstd --target aarch64-pc-windows-msvc

Currently this fails to build `libtest` due to a linker bug (seemingly in LLD?)
which hasn't been investigate yet. Otherwise though with libstd you can build a
hello world program (linked with LLD). I've not tried to execute it yet, but it
at least links!

Full support for this target is still a long road ahead, but this is hopefully a
good stepping stone to get started.

Points of note about this target are:

* Currently defaults to `panic=abort` as support is still landing in LLVM for
  SEH on AArch64.
* Currently defaults to LLD as a linker as I was able to get farther with it
  than I was with `link.exe`
Diffstat (limited to 'src/libstd/sys/windows/mod.rs')
-rw-r--r--src/libstd/sys/windows/mod.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libstd/sys/windows/mod.rs b/src/libstd/sys/windows/mod.rs
index 0d12ecf8fe3..ccf79de909f 100644
--- a/src/libstd/sys/windows/mod.rs
+++ b/src/libstd/sys/windows/mod.rs
@@ -266,8 +266,12 @@ pub fn dur2timeout(dur: Duration) -> c::DWORD {
 // handlers.
 //
 // https://msdn.microsoft.com/en-us/library/dn774154.aspx
-#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+#[allow(unreachable_code)]
 pub unsafe fn abort_internal() -> ! {
-    asm!("int $$0x29" :: "{ecx}"(7) ::: volatile); // 7 is FAST_FAIL_FATAL_APP_EXIT
-    ::intrinsics::unreachable();
+    #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+    {
+        asm!("int $$0x29" :: "{ecx}"(7) ::: volatile); // 7 is FAST_FAIL_FATAL_APP_EXIT
+        ::intrinsics::unreachable();
+    }
+    ::intrinsics::abort();
 }