@@ -14,7 +14,8 @@ fn main() {
14
14
let cargo_path = env:: var ( "CARGO" ) . expect ( "Missing CARGO environment variable" ) ;
15
15
let cargo = Path :: new ( & cargo_path) ;
16
16
17
- let manifest_dir_path = env:: var ( "CARGO_MANIFEST_DIR" ) . expect ( "Missing CARGO_MANIFEST_DIR environment variable" ) ;
17
+ let manifest_dir_path =
18
+ env:: var ( "CARGO_MANIFEST_DIR" ) . expect ( "Missing CARGO_MANIFEST_DIR environment variable" ) ;
18
19
let manifest_dir = Path :: new ( & manifest_dir_path) ;
19
20
20
21
// Find the objcopy binary
@@ -41,9 +42,7 @@ fn main() {
41
42
// Build stage 2
42
43
build_subproject (
43
44
Path :: new ( "src/real/stage_2" ) ,
44
- & [
45
- "second_stage" ,
46
- ] ,
45
+ & [ "second_stage" ] ,
47
46
"../i8086-real_mode.json" ,
48
47
& out_dir,
49
48
& objcopy,
@@ -59,8 +58,14 @@ fn build_subproject(
59
58
objcopy : & Path ,
60
59
cargo : & Path ,
61
60
) {
62
- let subproject_name = subproject_dir. file_stem ( ) . expect ( "Couldn't get subproject name" ) . to_str ( ) . expect ( "Subproject Name is not valid UTF-8" ) ;
63
- let target_file = Path :: new ( & target_file_path) . file_stem ( ) . expect ( "Couldn't get target file stem" ) ;
61
+ let subproject_name = subproject_dir
62
+ . file_stem ( )
63
+ . expect ( "Couldn't get subproject name" )
64
+ . to_str ( )
65
+ . expect ( "Subproject Name is not valid UTF-8" ) ;
66
+ let target_file = Path :: new ( & target_file_path)
67
+ . file_stem ( )
68
+ . expect ( "Couldn't get target file stem" ) ;
64
69
let target_dir = root_out_dir. join ( "target" ) . join ( & subproject_name) ;
65
70
66
71
// We have to export at least 1 symbol
@@ -98,9 +103,9 @@ fn build_subproject(
98
103
// Use passed objcopy
99
104
let mut objcopy_cmd = Command :: new ( objcopy) ;
100
105
101
- // Localize all symbols except those passed
106
+ // Localize all symbols except those passed
102
107
for symbol in global_symbols {
103
- objcopy_cmd. arg ( "-G" ) . arg ( symbol) ;
108
+ objcopy_cmd. arg ( "-G" ) . arg ( symbol) ;
104
109
}
105
110
106
111
// Pass the binary as argument
0 commit comments