|
9 | 9 | // the timer-interrupt. Device-drivers are required to use polling-based models. Furthermore, all
|
10 | 10 | // code runs in the same environment, no process separation is supported.
|
11 | 11 |
|
12 |
| -use crate::spec::{base, LinkerFlavor, Lld, MaybeLazy}; |
| 12 | +use crate::spec::{base, LinkerFlavor, Lld}; |
13 | 13 | use crate::spec::{PanicStrategy, StackProbeType, TargetOptions};
|
14 | 14 |
|
15 | 15 | pub fn opts() -> TargetOptions {
|
16 | 16 | let mut base = base::msvc::opts();
|
17 | 17 |
|
18 |
| - base.pre_link_args = MaybeLazy::lazy(|| { |
19 |
| - TargetOptions::link_args( |
20 |
| - LinkerFlavor::Msvc(Lld::No), |
21 |
| - &[ |
22 |
| - // Non-standard subsystems have no default entry-point in PE+ files. We have to define |
23 |
| - // one. "efi_main" seems to be a common choice amongst other implementations and the |
24 |
| - // spec. |
25 |
| - "/entry:efi_main", |
26 |
| - // COFF images have a "Subsystem" field in their header, which defines what kind of |
27 |
| - // program it is. UEFI has 3 fields reserved, which are EFI_APPLICATION, |
28 |
| - // EFI_BOOT_SERVICE_DRIVER, and EFI_RUNTIME_DRIVER. We default to EFI_APPLICATION, |
29 |
| - // which is very likely the most common option. Individual projects can override this |
30 |
| - // with custom linker flags. |
31 |
| - // The subsystem-type only has minor effects on the application. It defines the memory |
32 |
| - // regions the application is loaded into (runtime-drivers need to be put into |
33 |
| - // reserved areas), as well as whether a return from the entry-point is treated as |
34 |
| - // exit (default for applications). |
35 |
| - "/subsystem:efi_application", |
36 |
| - ], |
37 |
| - ) |
38 |
| - }); |
| 18 | + base.pre_link_args = TargetOptions::link_args( |
| 19 | + LinkerFlavor::Msvc(Lld::No), |
| 20 | + &[ |
| 21 | + // Non-standard subsystems have no default entry-point in PE+ files. We have to define |
| 22 | + // one. "efi_main" seems to be a common choice amongst other implementations and the |
| 23 | + // spec. |
| 24 | + "/entry:efi_main", |
| 25 | + // COFF images have a "Subsystem" field in their header, which defines what kind of |
| 26 | + // program it is. UEFI has 3 fields reserved, which are EFI_APPLICATION, |
| 27 | + // EFI_BOOT_SERVICE_DRIVER, and EFI_RUNTIME_DRIVER. We default to EFI_APPLICATION, |
| 28 | + // which is very likely the most common option. Individual projects can override this |
| 29 | + // with custom linker flags. |
| 30 | + // The subsystem-type only has minor effects on the application. It defines the memory |
| 31 | + // regions the application is loaded into (runtime-drivers need to be put into |
| 32 | + // reserved areas), as well as whether a return from the entry-point is treated as |
| 33 | + // exit (default for applications). |
| 34 | + "/subsystem:efi_application", |
| 35 | + ], |
| 36 | + ); |
39 | 37 |
|
40 | 38 | TargetOptions {
|
41 | 39 | os: "uefi".into(),
|
|
0 commit comments