Skip to content

Commit 8d9fdb7

Browse files
committed
rustc_target: Flip the default for TargetOptions::executables to true
Also change `executables` to true for linux-kernel and windows-uwp-gnu targets
1 parent 9fb32dc commit 8d9fdb7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+4
-53
lines changed

compiler/rustc_target/src/spec/aarch64_unknown_none.rs

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ pub fn target() -> Target {
1313
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
1414
linker: Some("rust-lld".into()),
1515
features: "+strict-align,+neon,+fp-armv8".into(),
16-
executables: true,
1716
relocation_model: RelocModel::Static,
1817
disable_redzone: true,
1918
max_atomic_width: Some(128),

compiler/rustc_target/src/spec/aarch64_unknown_none_softfloat.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ pub fn target() -> Target {
1414
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
1515
linker: Some("rust-lld".into()),
1616
features: "+strict-align,-neon,-fp-armv8".into(),
17-
executables: true,
1817
relocation_model: RelocModel::Static,
1918
disable_redzone: true,
2019
max_atomic_width: Some(128),

compiler/rustc_target/src/spec/apple_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pub fn opts(os: &'static str) -> TargetOptions {
2525
function_sections: false,
2626
dynamic_linking: true,
2727
linker_is_gnu: false,
28-
executables: true,
2928
families: cvs!["unix"],
3029
is_like_osx: true,
3130
default_dwarf_version: 2,

compiler/rustc_target/src/spec/apple_sdk_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ pub fn opts(os: &'static str, arch: Arch) -> TargetOptions {
5454
abi: target_abi(arch).into(),
5555
cpu: target_cpu(arch).into(),
5656
dynamic_linking: false,
57-
executables: true,
5857
link_env_remove: link_env_remove(arch),
5958
has_thread_local: false,
6059
..super::apple_base::opts(os)

compiler/rustc_target/src/spec/armebv7r_none_eabi.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ pub fn target() -> Target {
1414
abi: "eabi".into(),
1515
endian: Endian::Big,
1616
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
17-
executables: true,
1817
linker: Some("rust-lld".into()),
1918
relocation_model: RelocModel::Static,
2019
panic_strategy: PanicStrategy::Abort,

compiler/rustc_target/src/spec/armebv7r_none_eabihf.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ pub fn target() -> Target {
1414
abi: "eabihf".into(),
1515
endian: Endian::Big,
1616
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
17-
executables: true,
1817
linker: Some("rust-lld".into()),
1918
relocation_model: RelocModel::Static,
2019
panic_strategy: PanicStrategy::Abort,

compiler/rustc_target/src/spec/armv6k_nintendo_3ds.rs

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ pub fn target() -> Target {
2323
abi: "eabihf".into(),
2424
linker_flavor: LinkerFlavor::Gcc,
2525
cpu: "mpcore".into(),
26-
executables: true,
2726
families: cvs!["unix"],
2827
linker: Some("arm-none-eabi-gcc".into()),
2928
relocation_model: RelocModel::Static,

compiler/rustc_target/src/spec/armv7a_none_eabi.rs

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ pub fn target() -> Target {
2222
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
2323
linker: Some("rust-lld".into()),
2424
features: "+v7,+thumb2,+soft-float,-neon,+strict-align".into(),
25-
executables: true,
2625
relocation_model: RelocModel::Static,
2726
disable_redzone: true,
2827
max_atomic_width: Some(64),

compiler/rustc_target/src/spec/armv7a_none_eabihf.rs

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ pub fn target() -> Target {
1313
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
1414
linker: Some("rust-lld".into()),
1515
features: "+v7,+vfp3,-d32,+thumb2,-neon,+strict-align".into(),
16-
executables: true,
1716
relocation_model: RelocModel::Static,
1817
disable_redzone: true,
1918
max_atomic_width: Some(64),

compiler/rustc_target/src/spec/armv7r_none_eabi.rs

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ pub fn target() -> Target {
1313
options: TargetOptions {
1414
abi: "eabi".into(),
1515
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
16-
executables: true,
1716
linker: Some("rust-lld".into()),
1817
relocation_model: RelocModel::Static,
1918
panic_strategy: PanicStrategy::Abort,

compiler/rustc_target/src/spec/armv7r_none_eabihf.rs

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ pub fn target() -> Target {
1313
options: TargetOptions {
1414
abi: "eabihf".into(),
1515
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
16-
executables: true,
1716
linker: Some("rust-lld".into()),
1817
relocation_model: RelocModel::Static,
1918
panic_strategy: PanicStrategy::Abort,

compiler/rustc_target/src/spec/avr_gnu_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ pub fn target(target_cpu: &'static str, mmcu: &'static str) -> Target {
1616
exe_suffix: ".elf".into(),
1717

1818
linker: Some("avr-gcc".into()),
19-
executables: true,
2019
eh_frame_header: false,
2120
pre_link_args: TargetOptions::link_args(LinkerFlavor::Gcc, &[mmcu]),
2221
late_link_args: TargetOptions::link_args(LinkerFlavor::Gcc, &["-lgcc"]),

compiler/rustc_target/src/spec/bpf_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ pub fn opts(endian: Endian) -> TargetOptions {
77
endian,
88
linker_flavor: LinkerFlavor::BpfLinker,
99
atomic_cas: false,
10-
executables: true,
1110
dynamic_linking: true,
1211
no_builtins: true,
1312
panic_strategy: PanicStrategy::Abort,

compiler/rustc_target/src/spec/dragonfly_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ pub fn opts() -> TargetOptions {
44
TargetOptions {
55
os: "dragonfly".into(),
66
dynamic_linking: true,
7-
executables: true,
87
families: cvs!["unix"],
98
has_rpath: true,
109
position_independent_executables: true,

compiler/rustc_target/src/spec/freebsd_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ pub fn opts() -> TargetOptions {
44
TargetOptions {
55
os: "freebsd".into(),
66
dynamic_linking: true,
7-
executables: true,
87
families: cvs!["unix"],
98
has_rpath: true,
109
position_independent_executables: true,

compiler/rustc_target/src/spec/fuchsia_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ pub fn opts() -> TargetOptions {
2323
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
2424
linker: Some("rust-lld".into()),
2525
dynamic_linking: true,
26-
executables: true,
2726
families: cvs!["unix"],
2827
pre_link_args,
2928
pre_link_objects: crt_objects::new(&[

compiler/rustc_target/src/spec/haiku_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ pub fn opts() -> TargetOptions {
44
TargetOptions {
55
os: "haiku".into(),
66
dynamic_linking: true,
7-
executables: true,
87
families: cvs!["unix"],
98
relro_level: RelroLevel::Full,
109
..Default::default()

compiler/rustc_target/src/spec/hermit_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ pub fn opts() -> TargetOptions {
1010
os: "hermit".into(),
1111
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
1212
linker: Some("rust-lld".into()),
13-
executables: true,
1413
has_thread_local: true,
1514
pre_link_args,
1615
panic_strategy: PanicStrategy::Abort,

compiler/rustc_target/src/spec/hexagon_unknown_linux_musl.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ pub fn target() -> Target {
1111
base.has_rpath = true;
1212
base.linker_is_gnu = false;
1313
base.dynamic_linking = true;
14-
base.executables = true;
1514

1615
base.c_enum_min_bits = 8;
1716

compiler/rustc_target/src/spec/illumos_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ pub fn opts() -> TargetOptions {
2727
TargetOptions {
2828
os: "illumos".into(),
2929
dynamic_linking: true,
30-
executables: true,
3130
has_rpath: true,
3231
families: cvs!["unix"],
3332
is_like_solaris: true,

compiler/rustc_target/src/spec/l4re_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ pub fn opts() -> TargetOptions {
55
os: "l4re".into(),
66
env: "uclibc".into(),
77
linker_flavor: LinkerFlavor::L4Bender,
8-
executables: true,
98
panic_strategy: PanicStrategy::Abort,
109
linker: Some("l4-bender".into()),
1110
linker_is_gnu: false,

compiler/rustc_target/src/spec/linux_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ pub fn opts() -> TargetOptions {
44
TargetOptions {
55
os: "linux".into(),
66
dynamic_linking: true,
7-
executables: true,
87
families: cvs!["unix"],
98
has_rpath: true,
109
position_independent_executables: true,

compiler/rustc_target/src/spec/mipsel_sony_psp.rs

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ pub fn target() -> Target {
1818
vendor: "sony".into(),
1919
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
2020
cpu: "mips2".into(),
21-
executables: true,
2221
linker: Some("rust-lld".into()),
2322
relocation_model: RelocModel::Static,
2423

compiler/rustc_target/src/spec/mipsel_unknown_none.rs

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ pub fn target() -> Target {
1717
cpu: "mips32r2".into(),
1818
features: "+mips32r2,+soft-float,+noabicalls".into(),
1919
max_atomic_width: Some(32),
20-
executables: true,
2120
linker: Some("rust-lld".into()),
2221
panic_strategy: PanicStrategy::Abort,
2322
relocation_model: RelocModel::Static,

compiler/rustc_target/src/spec/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1212,8 +1212,7 @@ pub struct TargetOptions {
12121212
pub dynamic_linking: bool,
12131213
/// If dynamic linking is available, whether only cdylibs are supported.
12141214
pub only_cdylib: bool,
1215-
/// Whether executables are available on this target. iOS, for example, only allows static
1216-
/// libraries. Defaults to false.
1215+
/// Whether executables are available on this target. Defaults to true.
12171216
pub executables: bool,
12181217
/// Relocation model to use in object file. Corresponds to `llc
12191218
/// -relocation-model=$relocation_model`. Defaults to `Pic`.
@@ -1520,7 +1519,7 @@ impl Default for TargetOptions {
15201519
features: "".into(),
15211520
dynamic_linking: false,
15221521
only_cdylib: false,
1523-
executables: false,
1522+
executables: true,
15241523
relocation_model: RelocModel::Pic,
15251524
code_model: None,
15261525
tls_model: TlsModel::GeneralDynamic,

compiler/rustc_target/src/spec/msp430_none_elf.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ pub fn target() -> Target {
99

1010
options: TargetOptions {
1111
c_int_width: "16".into(),
12-
executables: true,
1312

1413
// The LLVM backend currently can't generate object files. To
1514
// workaround this LLVM generates assembly files which then we feed

compiler/rustc_target/src/spec/msvc_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ pub fn opts() -> TargetOptions {
77

88
TargetOptions {
99
linker_flavor: LinkerFlavor::Msvc,
10-
executables: true,
1110
is_like_windows: true,
1211
is_like_msvc: true,
1312
lld_flavor: LldFlavor::Link,

compiler/rustc_target/src/spec/netbsd_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ pub fn opts() -> TargetOptions {
44
TargetOptions {
55
os: "netbsd".into(),
66
dynamic_linking: true,
7-
executables: true,
87
families: cvs!["unix"],
98
no_default_libraries: false,
109
has_rpath: true,

compiler/rustc_target/src/spec/nvptx64_nvidia_cuda.rs

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ pub fn target() -> Target {
2626

2727
// Needed to use `dylib` and `bin` crate types and the linker.
2828
dynamic_linking: true,
29-
executables: true,
3029

3130
// Avoid using dylib because it contain metadata not supported
3231
// by LLVM NVPTX backend.

compiler/rustc_target/src/spec/openbsd_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ pub fn opts() -> TargetOptions {
44
TargetOptions {
55
os: "openbsd".into(),
66
dynamic_linking: true,
7-
executables: true,
87
families: cvs!["unix"],
98
has_rpath: true,
109
abi_return_struct_as_int: true,

compiler/rustc_target/src/spec/redox_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ pub fn opts() -> TargetOptions {
55
os: "redox".into(),
66
env: "relibc".into(),
77
dynamic_linking: true,
8-
executables: true,
98
families: cvs!["unix"],
109
has_rpath: true,
1110
position_independent_executables: true,

compiler/rustc_target/src/spec/riscv32i_unknown_none_elf.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ pub fn target() -> Target {
1414
cpu: "generic-rv32".into(),
1515
max_atomic_width: Some(0),
1616
atomic_cas: false,
17-
executables: true,
1817
panic_strategy: PanicStrategy::Abort,
1918
relocation_model: RelocModel::Static,
2019
emit_debug_gdb_scripts: false,

compiler/rustc_target/src/spec/riscv32im_unknown_none_elf.rs

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ pub fn target() -> Target {
1515
max_atomic_width: Some(0),
1616
atomic_cas: false,
1717
features: "+m".into(),
18-
executables: true,
1918
panic_strategy: PanicStrategy::Abort,
2019
relocation_model: RelocModel::Static,
2120
emit_debug_gdb_scripts: false,

compiler/rustc_target/src/spec/riscv32imac_unknown_none_elf.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ pub fn target() -> Target {
1414
cpu: "generic-rv32".into(),
1515
max_atomic_width: Some(32),
1616
features: "+m,+a,+c".into(),
17-
executables: true,
1817
panic_strategy: PanicStrategy::Abort,
1918
relocation_model: RelocModel::Static,
2019
emit_debug_gdb_scripts: false,

compiler/rustc_target/src/spec/riscv32imac_unknown_xous_elf.rs

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ pub fn target() -> Target {
1515
cpu: "generic-rv32".into(),
1616
max_atomic_width: Some(32),
1717
features: "+m,+a,+c".into(),
18-
executables: true,
1918
panic_strategy: PanicStrategy::Abort,
2019
relocation_model: RelocModel::Static,
2120
..Default::default()

compiler/rustc_target/src/spec/riscv32imc_esp_espidf.rs

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ pub fn target() -> Target {
2626
atomic_cas: true,
2727

2828
features: "+m,+c".into(),
29-
executables: true,
3029
panic_strategy: PanicStrategy::Abort,
3130
relocation_model: RelocModel::Static,
3231
emit_debug_gdb_scripts: false,

compiler/rustc_target/src/spec/riscv32imc_unknown_none_elf.rs

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ pub fn target() -> Target {
1515
max_atomic_width: Some(0),
1616
atomic_cas: false,
1717
features: "+m,+c".into(),
18-
executables: true,
1918
panic_strategy: PanicStrategy::Abort,
2019
relocation_model: RelocModel::Static,
2120
emit_debug_gdb_scripts: false,

compiler/rustc_target/src/spec/riscv64gc_unknown_none_elf.rs

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ pub fn target() -> Target {
1515
cpu: "generic-rv64".into(),
1616
max_atomic_width: Some(64),
1717
features: "+m,+a,+f,+d,+c".into(),
18-
executables: true,
1918
panic_strategy: PanicStrategy::Abort,
2019
relocation_model: RelocModel::Static,
2120
code_model: Some(CodeModel::Medium),

compiler/rustc_target/src/spec/riscv64imac_unknown_none_elf.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ pub fn target() -> Target {
1414
cpu: "generic-rv64".into(),
1515
max_atomic_width: Some(64),
1616
features: "+m,+a,+c".into(),
17-
executables: true,
1817
panic_strategy: PanicStrategy::Abort,
1918
relocation_model: RelocModel::Static,
2019
code_model: Some(CodeModel::Medium),

compiler/rustc_target/src/spec/solaris_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ pub fn opts() -> TargetOptions {
44
TargetOptions {
55
os: "solaris".into(),
66
dynamic_linking: true,
7-
executables: true,
87
has_rpath: true,
98
families: cvs!["unix"],
109
is_like_solaris: true,

compiler/rustc_target/src/spec/solid_base.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pub fn opts(kernel: &str) -> TargetOptions {
55
TargetOptions {
66
os: format!("solid_{}", kernel).into(),
77
vendor: "kmc".into(),
8+
executables: false,
89
frame_pointer: FramePointer::NonLeaf,
910
has_thread_local: true,
1011
..Default::default()

compiler/rustc_target/src/spec/thumb_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ pub fn opts() -> TargetOptions {
3434
// See rust-lang/rfcs#1645 for a discussion about these defaults
3535
TargetOptions {
3636
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
37-
executables: true,
3837
// In most cases, LLD is good enough
3938
linker: Some("rust-lld".into()),
4039
// Because these devices have very little resources having an unwinder is too onerous so we

compiler/rustc_target/src/spec/vxworks_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ pub fn opts() -> TargetOptions {
88
linker: Some("wr-c++".into()),
99
exe_suffix: ".vxe".into(),
1010
dynamic_linking: true,
11-
executables: true,
1211
families: cvs!["unix"],
1312
has_rpath: true,
1413
has_thread_local: true,

compiler/rustc_target/src/spec/wasm_base.rs

-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ pub fn options() -> TargetOptions {
6262
dynamic_linking: true,
6363
only_cdylib: true,
6464

65-
// This means we'll just embed a `#[start]` function in the wasm module
66-
executables: true,
67-
6865
// relatively self-explanatory!
6966
exe_suffix: ".wasm".into(),
7067
dll_prefix: "".into(),

compiler/rustc_target/src/spec/windows_gnu_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ pub fn opts() -> TargetOptions {
6767
function_sections: false,
6868
linker: Some("gcc".into()),
6969
dynamic_linking: true,
70-
executables: true,
7170
dll_prefix: "".into(),
7271
dll_suffix: ".dll".into(),
7372
exe_suffix: ".exe".into(),

compiler/rustc_target/src/spec/windows_gnullvm_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ pub fn opts() -> TargetOptions {
2020
abi: "llvm".into(),
2121
linker: Some("clang".into()),
2222
dynamic_linking: true,
23-
executables: true,
2423
dll_prefix: "".into(),
2524
dll_suffix: ".dll".into(),
2625
exe_suffix: ".exe".into(),

compiler/rustc_target/src/spec/windows_uwp_gnu_base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ pub fn opts() -> TargetOptions {
2424
TargetOptions {
2525
abi: "uwp".into(),
2626
vendor: "uwp".into(),
27-
executables: false,
2827
limit_rdylib_exports: false,
2928
late_link_args,
3029
late_link_args_dynamic,

compiler/rustc_target/src/spec/x86_64_fortanix_unknown_sgx.rs

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ pub fn target() -> Target {
6262
vendor: "fortanix".into(),
6363
abi: "fortanix".into(),
6464
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
65-
executables: true,
6665
linker: Some("rust-lld".into()),
6766
max_atomic_width: Some(64),
6867
cpu: "x86-64".into(),

0 commit comments

Comments
 (0)