@@ -65,20 +65,27 @@ pub fn compile_executable(module: &CoreModule, output_path: &str) -> Result<(),
6565 // Create cranelift module
6666 let triple = if cfg ! ( target_arch = "aarch64" ) && cfg ! ( target_os = "macos" ) {
6767 // Use the proper ARM64 macOS triple
68- target_lexicon:: Triple :: from_str ( "aarch64-apple-darwin" ) . unwrap ( )
68+ target_lexicon:: Triple :: from_str ( "aarch64-apple-darwin" )
69+ . map_err ( |e| format ! ( "Error parsing triple: {}" , e) ) ?
6970 } else {
7071 Triple :: host ( )
7172 } ;
7273
7374 let mut settings = builder ( ) ;
74- settings. set ( "opt_level" , "none" ) . unwrap ( ) ;
75- settings. set ( "is_pic" , "true" ) . unwrap ( ) ;
75+ settings
76+ . set ( "opt_level" , "none" )
77+ . map_err ( |e| format ! ( "Error setting opt_level: {}" , e) ) ?;
78+ settings
79+ . set ( "is_pic" , "true" )
80+ . map_err ( |e| format ! ( "Error setting is_pic: {}" , e) ) ?;
7681 if cfg ! ( target_arch = "aarch64" ) {
7782 // Ensure proper alignment for ARM64
7883 settings
7984 . set ( "enable_heap_access_spectre_mitigation" , "false" )
80- . unwrap ( ) ;
81- settings. set ( "use_colocated_libcalls" , "false" ) . unwrap ( ) ;
85+ . map_err ( |e| format ! ( "Error setting heap_access_spectre_mitigation: {}" , e) ) ?;
86+ settings
87+ . set ( "use_colocated_libcalls" , "false" )
88+ . map_err ( |e| format ! ( "Error setting use_colocated_libcalls: {}" , e) ) ?;
8289 }
8390 let flags = Flags :: new ( settings) ;
8491
0 commit comments