Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/rustc_target/src/spec/msvc_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub fn opts() -> TargetOptions {
pre_link_args,
abi_return_struct_as_int: true,
emit_debug_gdb_scripts: false,
eh_frame_header: false,

// Currently this is the only supported method of debuginfo on MSVC
// where `*.pdb` files show up next to the final artifact.
Expand Down
7 changes: 6 additions & 1 deletion compiler/rustc_target/src/spec/uefi_msvc_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// the timer-interrupt. Device-drivers are required to use polling-based models. Furthermore, all
// code runs in the same environment, no process separation is supported.

use crate::spec::{LinkerFlavor, Lld, PanicStrategy, StackProbeType, TargetOptions};
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, StackProbeType, TargetOptions};

pub fn opts() -> TargetOptions {
let mut base = super::msvc_base::opts();
Expand All @@ -34,6 +34,11 @@ pub fn opts() -> TargetOptions {
],
);

base.add_pre_link_args(
LinkerFlavor::Unix(Cc::Yes),
&["-Wl,--entry=efi_main", "-Wl,--subsystem=efi_application"],
);

TargetOptions {
os: "uefi".into(),
linker_flavor: LinkerFlavor::Msvc(Lld::Yes),
Expand Down