parent
d7e1bb5ff4
commit
a7a1bf81d7
9 changed files with 11 additions and 11 deletions
|
@ -180,7 +180,6 @@ debugging_opts!(
|
||||||
GC,
|
GC,
|
||||||
PRINT_LINK_ARGS,
|
PRINT_LINK_ARGS,
|
||||||
PRINT_LLVM_PASSES,
|
PRINT_LLVM_PASSES,
|
||||||
LTO,
|
|
||||||
AST_JSON,
|
AST_JSON,
|
||||||
AST_JSON_NOEXPAND,
|
AST_JSON_NOEXPAND,
|
||||||
LS,
|
LS,
|
||||||
|
@ -219,7 +218,6 @@ pub fn debugging_opts_map() -> Vec<(&'static str, &'static str, u64)> {
|
||||||
("print-llvm-passes",
|
("print-llvm-passes",
|
||||||
"Prints the llvm optimization passes being run",
|
"Prints the llvm optimization passes being run",
|
||||||
PRINT_LLVM_PASSES),
|
PRINT_LLVM_PASSES),
|
||||||
("lto", "Perform LLVM link-time optimizations", LTO),
|
|
||||||
("ast-json", "Print the AST as JSON and halt", AST_JSON),
|
("ast-json", "Print the AST as JSON and halt", AST_JSON),
|
||||||
("ast-json-noexpand", "Print the pre-expansion AST as JSON and halt", AST_JSON_NOEXPAND),
|
("ast-json-noexpand", "Print the pre-expansion AST as JSON and halt", AST_JSON_NOEXPAND),
|
||||||
("ls", "List the symbols defined by a library crate", LS),
|
("ls", "List the symbols defined by a library crate", LS),
|
||||||
|
@ -353,6 +351,8 @@ cgoptions!(
|
||||||
"system linker to link outputs with"),
|
"system linker to link outputs with"),
|
||||||
link_args: Vec<String> = (Vec::new(), parse_list,
|
link_args: Vec<String> = (Vec::new(), parse_list,
|
||||||
"extra arguments to pass to the linker (space separated)"),
|
"extra arguments to pass to the linker (space separated)"),
|
||||||
|
lto: bool = (false, parse_bool,
|
||||||
|
"perform LLVM link-time optimizations"),
|
||||||
target_cpu: String = ("generic".to_string(), parse_string,
|
target_cpu: String = ("generic".to_string(), parse_string,
|
||||||
"select target processor (llc -mcpu=help for details)"),
|
"select target processor (llc -mcpu=help for details)"),
|
||||||
target_feature: String = ("".to_string(), parse_string,
|
target_feature: String = ("".to_string(), parse_string,
|
||||||
|
|
|
@ -168,7 +168,7 @@ impl Session {
|
||||||
self.debugging_opt(config::PRINT_LLVM_PASSES)
|
self.debugging_opt(config::PRINT_LLVM_PASSES)
|
||||||
}
|
}
|
||||||
pub fn lto(&self) -> bool {
|
pub fn lto(&self) -> bool {
|
||||||
self.debugging_opt(config::LTO)
|
self.opts.cg.lto
|
||||||
}
|
}
|
||||||
pub fn no_landing_pads(&self) -> bool {
|
pub fn no_landing_pads(&self) -> bool {
|
||||||
self.debugging_opt(config::NO_LANDING_PADS)
|
self.debugging_opt(config::NO_LANDING_PADS)
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// compile-flags: -Z lto -C prefer-dynamic
|
// compile-flags: -C lto -C prefer-dynamic
|
||||||
|
|
||||||
// error-pattern: cannot prefer dynamic linking
|
// error-pattern: cannot prefer dynamic linking
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
extern crate cross_crate_debuginfo_type_uniquing;
|
extern crate cross_crate_debuginfo_type_uniquing;
|
||||||
|
|
||||||
// no-prefer-dynamic
|
// no-prefer-dynamic
|
||||||
// compile-flags:-g -Zlto
|
// compile-flags:-g -C lto
|
||||||
|
|
||||||
pub struct C;
|
pub struct C;
|
||||||
pub fn p() -> C {
|
pub fn p() -> C {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
all:
|
all:
|
||||||
$(RUSTC) foo.rs --crate-type=rlib
|
$(RUSTC) foo.rs --crate-type=rlib
|
||||||
$(RUSTC) bar.rs --crate-type=staticlib -Zlto -L. -o $(TMPDIR)/libbar.a
|
$(RUSTC) bar.rs --crate-type=staticlib -C lto -L. -o $(TMPDIR)/libbar.a
|
||||||
$(CC) foo.c -lbar -o $(call RUN_BINFILE,foo) $(EXTRACFLAGS)
|
$(CC) foo.c -lbar -o $(call RUN_BINFILE,foo) $(EXTRACFLAGS)
|
||||||
$(call RUN,foo)
|
$(call RUN,foo)
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
CC := $(CC:-g=)
|
CC := $(CC:-g=)
|
||||||
|
|
||||||
all:
|
all:
|
||||||
$(RUSTC) foo.rs -Z lto
|
$(RUSTC) foo.rs -C lto
|
||||||
$(CC) bar.c -lfoo -o $(call RUN_BINFILE,bar) $(EXTRACFLAGS) -lstdc++
|
$(CC) bar.c -lfoo -o $(call RUN_BINFILE,bar) $(EXTRACFLAGS) -lstdc++
|
||||||
$(call RUN,bar)
|
$(call RUN,bar)
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
all:
|
all:
|
||||||
$(RUSTC) lib.rs
|
$(RUSTC) lib.rs
|
||||||
$(RUSTC) main.rs -Z lto
|
$(RUSTC) main.rs -C lto
|
||||||
$(call RUN,main)
|
$(call RUN,main)
|
||||||
|
|
|
@ -14,5 +14,5 @@ all: $(DOTEST)
|
||||||
dotest:
|
dotest:
|
||||||
env
|
env
|
||||||
$(RUSTC) lib.rs
|
$(RUSTC) lib.rs
|
||||||
$(RUSTC) main.rs -Z lto
|
$(RUSTC) main.rs -C lto
|
||||||
$(call RUN,main)
|
$(call RUN,main)
|
||||||
|
|
|
@ -8,11 +8,11 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// Check that we can use `-Z lto` when linking against libraries that were
|
// Check that we can use `-C lto` when linking against libraries that were
|
||||||
// separately compiled.
|
// separately compiled.
|
||||||
|
|
||||||
// aux-build:sepcomp_lib.rs
|
// aux-build:sepcomp_lib.rs
|
||||||
// compile-flags: -Z lto
|
// compile-flags: -C lto
|
||||||
// no-prefer-dynamic
|
// no-prefer-dynamic
|
||||||
|
|
||||||
extern crate sepcomp_lib;
|
extern crate sepcomp_lib;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue