File tree Expand file tree Collapse file tree 5 files changed +22
-2
lines changed Expand file tree Collapse file tree 5 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -290,6 +290,7 @@ LLVM_VERSION_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --version)
290
290
LLVM_BINDIR_$(1 ) =$$(shell "$$(LLVM_CONFIG_$(1 ) ) " --bindir)
291
291
LLVM_INCDIR_$(1 ) =$$(shell "$$(LLVM_CONFIG_$(1 ) ) " --includedir)
292
292
LLVM_LIBDIR_$(1 ) =$$(shell "$$(LLVM_CONFIG_$(1 ) ) " --libdir)
293
+ LLVM_LIBDIR_RUSTFLAGS_$(1 ) =-L "$$(LLVM_LIBDIR_$(1 ) ) "
293
294
LLVM_LIBS_$(1 ) =$$(shell "$$(LLVM_CONFIG_$(1 ) ) " --libs $$(LLVM_COMPONENTS ) )
294
295
LLVM_LDFLAGS_$(1 ) =$$(shell "$$(LLVM_CONFIG_$(1 ) ) " --ldflags)
295
296
# On FreeBSD, it may search wrong headers (that are for pre-installed LLVM),
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
84
84
$$(subst @,,$$(STAGE$(1 ) _T_$(2 ) _H_$(3 ) ) ) \
85
85
$$(RUST_LIB_FLAGS_ST$(1 ) ) \
86
86
-L "$$(RT_OUTPUT_DIR_$(2 ) ) " \
87
- -L " $$(LLVM_LIBDIR_ $(2 ) ) " \
87
+ $$(LLVM_LIBDIR_RUSTFLAGS_ $(2 ) ) \
88
88
$$(LLVM_STDCPP_RUSTFLAGS_$(2 ) ) \
89
89
$$(RUSTFLAGS_$(4 ) ) \
90
90
--out-dir $$(@D ) \
Original file line number Diff line number Diff line change @@ -372,7 +372,7 @@ $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
372
372
$(Q ) CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3 ) ) \
373
373
$$(subst @,,$$(STAGE$(1 ) _T_$(2 ) _H_$(3 ) ) ) -o $$@ $$< --test \
374
374
-L "$$(RT_OUTPUT_DIR_$(2 ) ) " \
375
- -L " $$(LLVM_LIBDIR_ $(2 ) ) " \
375
+ $$(LLVM_LIBDIR_RUSTFLAGS_ $(2 ) ) \
376
376
$$(RUSTFLAGS_$(4 ) )
377
377
378
378
endef
Original file line number Diff line number Diff line change 10
10
11
11
use std:: slice;
12
12
use std:: path:: { Path , PathBuf } ;
13
+ use session:: early_error;
13
14
14
15
#[ derive( Clone , Debug ) ]
15
16
pub struct SearchPaths {
@@ -50,6 +51,9 @@ impl SearchPaths {
50
51
} else {
51
52
( PathKind :: All , path)
52
53
} ;
54
+ if path. is_empty ( ) {
55
+ early_error ( "empty search path given via `-L`" ) ;
56
+ }
53
57
self . paths . push ( ( kind, PathBuf :: new ( path) ) ) ;
54
58
}
55
59
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
+ // compile-flags:-L native=
12
+ // error-pattern: empty search path given via `-L`
13
+
14
+ fn main ( ) {
15
+ }
You can’t perform that action at this time.
0 commit comments