File tree Expand file tree Collapse file tree 6 files changed +73
-10
lines changed
test/run-make/use-extern-for-plugins Expand file tree Collapse file tree 6 files changed +73
-10
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: b4c965ee803a4521d8b4575f634e036f93e408f3
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 3a96d6a9818fe2affc98a187fb1065120458cee9
5
- refs/heads/try: 4583272bf5054e84c4c59ba3b9334a52cfcf5208
5
+ refs/heads/try: 8661b3dc0fbb9e21b94266ba62e23cebb8f0603f
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
8
8
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
Original file line number Diff line number Diff line change @@ -370,9 +370,8 @@ impl<'a> Context<'a> {
370
370
// must be loaded via -L plus some filtering.
371
371
if self . hash . is_none ( ) {
372
372
self . should_match_name = false ;
373
- match self . find_commandline_library ( ) {
374
- Some ( l) => return Some ( l) ,
375
- None => { }
373
+ if let Some ( s) = self . sess . opts . externs . get ( self . crate_name ) {
374
+ return self . find_commandline_library ( s) ;
376
375
}
377
376
self . should_match_name = true ;
378
377
}
@@ -619,12 +618,7 @@ impl<'a> Context<'a> {
619
618
( t. options . dll_prefix . clone ( ) , t. options . dll_suffix . clone ( ) )
620
619
}
621
620
622
- fn find_commandline_library ( & mut self ) -> Option < Library > {
623
- let locs = match self . sess . opts . externs . get ( self . crate_name ) {
624
- Some ( s) => s,
625
- None => return None ,
626
- } ;
627
-
621
+ fn find_commandline_library ( & mut self , locs : & [ String ] ) -> Option < Library > {
628
622
// First, filter out all libraries that look suspicious. We only accept
629
623
// files which actually exist that have the correct naming scheme for
630
624
// rlibs/dylibs.
Original file line number Diff line number Diff line change
1
+ -include ../tools.mk
2
+
3
+ HOST := $(shell $(RUSTC ) -vV | grep 'host:' | sed 's/host: //')
4
+ ifeq ($(findstring i686,$(HOST ) ) ,i686)
5
+ TARGET := $(subst i686,x86_64,$(HOST ) )
6
+ else
7
+ TARGET := $(subst x86_64,i686,$(HOST ) )
8
+ endif
9
+
10
+ all :
11
+ $(RUSTC ) foo.rs -C extra-filename=-host
12
+ $(RUSTC ) bar.rs -C extra-filename=-targ --target $(TARGET )
13
+ $(RUSTC ) baz.rs --extern a=$(TMPDIR ) /liba-targ.rlib --target $(TARGET )
Original file line number Diff line number Diff line change
1
+ // Copyright 2015 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
+ #![ feature( no_std) ]
12
+ #![ no_std]
13
+ #![ crate_type = "lib" ]
14
+ #![ crate_name = "a" ]
15
+
16
+ #[ macro_export]
17
+ macro_rules! bar {
18
+ ( ) => ( )
19
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2015 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
+ #![ feature( no_std) ]
12
+ #![ no_std]
13
+ #![ crate_type = "lib" ]
14
+
15
+ #[ macro_use]
16
+ extern crate a;
17
+
18
+ bar ! ( ) ;
Original file line number Diff line number Diff line change
1
+ // Copyright 2015 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
+ #![ feature( no_std) ]
12
+ #![ no_std]
13
+ #![ crate_type = "lib" ]
14
+ #![ crate_name = "a" ]
15
+
16
+ #[ macro_export]
17
+ macro_rules! foo {
18
+ ( ) => ( )
19
+ }
You can’t perform that action at this time.
0 commit comments