File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 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 {
2626 . expect ( "Couldn't read path from GCC" ) . trim ( ) . into ( )
2727}
2828
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 ( ) ;
3232 let mut pre_link_args = LinkArgs :: new ( ) ;
3333 pre_link_args. insert ( LinkerFlavor :: Ld , vec ! [
3434 format!( "-T{}/main_stat.ld" , l4re_lib_path) ,
@@ -68,7 +68,7 @@ pub fn opts() -> TargetOptions {
6868 format!( "{}/crtn.o" , l4re_lib_path) ,
6969 ] ) ;
7070
71- TargetOptions {
71+ Ok ( TargetOptions {
7272 executables : true ,
7373 has_elf_tls : false ,
7474 exe_allocation_crate : None ,
@@ -78,5 +78,5 @@ pub fn opts() -> TargetOptions {
7878 post_link_args,
7979 target_family : Some ( "unix" . to_string ( ) ) ,
8080 .. Default :: default ( )
81- }
81+ } )
8282}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use LinkerFlavor;
1212use target:: { Target , TargetResult } ;
1313
1414pub fn target ( ) -> TargetResult {
15- let mut base = super :: l4re_base:: opts ( ) ;
15+ let mut base = super :: l4re_base:: opts ( ) ? ;
1616 base. cpu = "x86-64" . to_string ( ) ;
1717 base. max_atomic_width = Some ( 64 ) ;
1818
You can’t perform that action at this time.
0 commit comments