File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,9 @@ fn get_path_or(filename: &str) -> String {
26
26
. expect ( "Couldn't read path from GCC" ) . trim ( ) . into ( )
27
27
}
28
28
29
- pub fn opts ( ) -> TargetOptions {
30
- let l4re_lib_path = env:: var_os ( "L4RE_LIBDIR" ) . expect ( "Unable to find L4Re \
31
- library directory: L4RE_LIBDIR not set.") . into_string ( ) . unwrap ( ) ;
29
+ pub fn opts ( ) -> Result < TargetOptions , String > {
30
+ let l4re_lib_path = env:: var_os ( "L4RE_LIBDIR" ) . ok_or ( "Unable to find L4Re \
31
+ library directory: L4RE_LIBDIR not set.") ? . into_string ( ) . unwrap ( ) ;
32
32
let mut pre_link_args = LinkArgs :: new ( ) ;
33
33
pre_link_args. insert ( LinkerFlavor :: Ld , vec ! [
34
34
format!( "-T{}/main_stat.ld" , l4re_lib_path) ,
@@ -68,7 +68,7 @@ pub fn opts() -> TargetOptions {
68
68
format!( "{}/crtn.o" , l4re_lib_path) ,
69
69
] ) ;
70
70
71
- TargetOptions {
71
+ Ok ( TargetOptions {
72
72
executables : true ,
73
73
has_elf_tls : false ,
74
74
exe_allocation_crate : None ,
@@ -78,5 +78,5 @@ pub fn opts() -> TargetOptions {
78
78
post_link_args,
79
79
target_family : Some ( "unix" . to_string ( ) ) ,
80
80
.. Default :: default ( )
81
- }
81
+ } )
82
82
}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use LinkerFlavor;
12
12
use target:: { Target , TargetResult } ;
13
13
14
14
pub fn target ( ) -> TargetResult {
15
- let mut base = super :: l4re_base:: opts ( ) ;
15
+ let mut base = super :: l4re_base:: opts ( ) ? ;
16
16
base. cpu = "x86-64" . to_string ( ) ;
17
17
base. max_atomic_width = Some ( 64 ) ;
18
18
You can’t perform that action at this time.
0 commit comments