Skip to content

Commit 88af668

Browse files
committed
Some renaming
1 parent 8e9f565 commit 88af668

File tree

7 files changed

+14
-42
lines changed

7 files changed

+14
-42
lines changed

real_mode/.cargo/config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[build]
2-
target = "x86_64-bootloader.json"
2+
target = "x86-32bit.json"

real_mode/build.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ fn main() {
88
let llvm_tools = LlvmTools::new().expect("LLVM tools not found");
99
let objcopy = llvm_tools.tool(&exe("llvm-objcopy")).expect("llvm-objcopy not found");
1010

11-
build_subproject(Path::new("first_stage"), &["_start", "print_char"], &out_dir, &objcopy);
12-
build_subproject(Path::new("real_mode"), &["second_stage"], &out_dir, &objcopy);
11+
build_subproject(Path::new("first_stage"), &["_start", "print_char"], "x86-16bit.json", &out_dir, &objcopy);
12+
build_subproject(Path::new("real_mode"), &["second_stage"], "x86-16bit.json", &out_dir, &objcopy);
1313
}
1414

15-
fn build_subproject(dir: &Path, global_symbols: &[&str], out_dir: &str, objcopy: &Path) {
15+
fn build_subproject(dir: &Path, global_symbols: &[&str], target: &str, out_dir: &str, objcopy: &Path) {
1616
let dir_name = dir.file_name().unwrap().to_str().unwrap();
1717
let manifest_path = dir.join("Cargo.toml");
1818
let out_path = Path::new(&out_dir);
@@ -23,7 +23,7 @@ fn build_subproject(dir: &Path, global_symbols: &[&str], out_dir: &str, objcopy:
2323
cmd.arg("xbuild").arg("--release");
2424
cmd.arg("--verbose");
2525
cmd.arg(format!("--manifest-path={}", manifest_path.display()));
26-
cmd.arg(format!("--target={}", dir.join("x86_64-target.json").display()));
26+
cmd.arg(format!("--target={}", dir.join(target).display()));
2727
cmd.arg("-Z").arg("unstable-options");
2828
cmd.arg("--out-dir").arg(&out_dir);
2929
cmd.arg("--target-dir").arg(out_path.join("target").join(dir_name));
@@ -41,12 +41,15 @@ fn build_subproject(dir: &Path, global_symbols: &[&str], out_dir: &str, objcopy:
4141
let status = cmd.status().unwrap();
4242
assert!(status.success());
4343

44+
/*
45+
// FIXME: it seems like this messes up relocations
4446
// convert to ELF64
4547
let mut cmd = Command::new(objcopy);
4648
cmd.arg("-I").arg("elf32-i386").arg("-O").arg("elf64-x86-64");
47-
cmd.arg(out_path.join(format!("lib{}.a", dir_name)));
49+
cmd.arg(out_path.join(format!("lib{}.a", dir_name)));
4850
let status = cmd.status().unwrap();
4951
assert!(status.success());
52+
*/
5053

5154
// emit linker flags
5255
println!("cargo:rustc-link-search=native={}", out_dir);

real_mode/first_stage/x86_64-target.json renamed to real_mode/first_stage/x86-16bit.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
"linker-flavor": "ld.lld",
88
"linker": "rust-lld",
99
"llvm-target": "i386-unknown-none-code16",
10-
"pre-link-args": {
11-
"ld.lld": [
12-
"-Tlinker.ld"
13-
]
14-
},
1510
"max-atomic-width": 64,
1611
"position-independent-executables": false,
1712
"disable-redzone": true,

real_mode/real_mode/x86_64-target.json renamed to real_mode/real_mode/x86-16bit.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
"linker-flavor": "ld.lld",
88
"linker": "rust-lld",
99
"llvm-target": "i386-unknown-none-code16",
10-
"pre-link-args": {
11-
"ld.lld": [
12-
"-Tlinker.ld"
13-
]
14-
},
1510
"max-atomic-width": 64,
1611
"position-independent-executables": false,
1712
"disable-redzone": true,

real_mode/tmp-libreal_mode.a

Whitespace-only changes.

real_mode/x86_64-bootloader-real-mode.json renamed to real_mode/x86-32bit.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
"executables": true,
77
"linker-flavor": "ld.lld",
88
"linker": "rust-lld",
9-
"llvm-target": "i386-unknown-none-code16",
109
"pre-link-args": {
11-
"ld.lld": [
12-
"-Tlinker.ld"
13-
]
14-
},
10+
"ld.lld": [
11+
"--script=linker.ld"
12+
]
13+
},
14+
"llvm-target": "i386-unknown-none",
1515
"max-atomic-width": 64,
1616
"position-independent-executables": false,
1717
"disable-redzone": true,

real_mode/x86_64-bootloader.json

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)