File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ use std::libc;
1919
2020pub fn run ( sess : session:: Session , llmod : ModuleRef ,
2121 tm : TargetMachineRef , reachable : & [ ~str ] ) {
22+ if sess. prefer_dynamic ( ) {
23+ sess. err ( "cannot prefer dynamic linking when performing LTO" ) ;
24+ sess. note ( "only 'staticlib' and 'bin' outputs are supported with LTO" ) ;
25+ sess. abort_if_errors ( ) ;
26+ }
27+
2228 // Make sure we actually can run LTO
2329 let outputs = sess. outputs . borrow ( ) ;
2430 for output in outputs. get ( ) . iter ( ) {
Original file line number Diff line number Diff line change 1+ // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+ // file at the top-level directory of this distribution and at
3+ // http://rust-lang.org/COPYRIGHT.
4+ //
5+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+ // option. This file may not be copied, modified, or distributed
9+ // except according to those terms.
10+
11+ // compile-flags: -Z lto -Z prefer-dynamic
12+
13+ // error-pattern: cannot prefer dynamic linking
14+
15+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments