summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-05-05 01:49:44 +0200
committerGitHub <noreply@github.com>2020-05-05 01:49:44 +0200
commitc1b2fd2121091df67d6a298f535b2db83e67dde5 (patch)
tree4e1f57e299d1eb2b5c72ed1668d3f094e0aaa245 /src
parentfaccb0f07a50f1b19644938723f6cd2c6c5877c8 (diff)
parent6e77729ed5af41f87ffe8c8b7bd949b8b1d44f83 (diff)
downloadrust-c1b2fd2121091df67d6a298f535b2db83e67dde5.tar.gz
rust-c1b2fd2121091df67d6a298f535b2db83e67dde5.zip
Rollup merge of #71881 - IsaacWoods:master, r=petrochenkov
Correctly handle UEFI targets as Windows-like when emitting sections for LLVM bitcode

This handles UEFI handles when emitting inline assembly for sections containing LLVM bitcode. See details in #71880. I have locally confirmed that this change fixes compilation of projects using the `x86_64-unknown-uefi` target compiling with `cargo-xbuild`, but I am not very familiar with LLVM bitcode so this may not be the correct approach.

r? @alexcrichton as they wrote the initial LLVM bitcode emitting code?
Diffstat (limited to 'src')
-rw-r--r--src/librustc_codegen_llvm/back/write.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustc_codegen_llvm/back/write.rs b/src/librustc_codegen_llvm/back/write.rs
index 6d175fda45f..394e2f332cb 100644
--- a/src/librustc_codegen_llvm/back/write.rs
+++ b/src/librustc_codegen_llvm/back/write.rs
@@ -853,7 +853,9 @@ unsafe fn embed_bitcode(
         || cgcx.opts.target_triple.triple().starts_with("asmjs")
     {
         // nothing to do here
-    } else if cgcx.opts.target_triple.triple().contains("windows") {
+    } else if cgcx.opts.target_triple.triple().contains("windows")
+        || cgcx.opts.target_triple.triple().contains("uefi")
+    {
         let asm = "
             .section .llvmbc,\"n\"
             .section .llvmcmd,\"n\"