diff --git a/rust/.cargo/config.toml b/rust/.cargo/config.toml index 3c29a9632..6b16ee362 100644 --- a/rust/.cargo/config.toml +++ b/rust/.cargo/config.toml @@ -1,8 +1,9 @@ [build] dep-info-basedir = ".." -target = "mipsel-sony-psx.json" +target = "mipsel-sony-psx" +rustflags = ["-Crelocation-model=static", "-Cdefault-linker-libraries=no"] -[target."mipsel-sony-psx.json"] +[target."mipsel-sony-psx"] linker = "mips-elf-ld" [unstable] diff --git a/rust/mipsel-sony-psx.json b/rust/mipsel-sony-psx.json deleted file mode 100644 index 097a52b60..000000000 --- a/rust/mipsel-sony-psx.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "arch": "mips", - "cpu": "mips1", - "data-layout": "e-m:m-p:32:32-i8:8:32-i16:16:32-i32:32-n32-S32", - "emit-debug-gdb-scripts": false, - "executables": false, - "features": "+soft-float,+noabicalls", - "linker": "rust-lld", - "linker-flavor": "ld.lld", - "llvm-target": "mipsel-unknown-none", - "relocation-model": "static", - "target-pointer-width": "32", - "panic-strategy": "abort", - "singlethread": true, - "dynamic-linking": false, - "function-sections": true, - "trap-unreachable": false -} diff --git a/tools/ld_from_yaml.py b/tools/ld_from_yaml.py index db21932df..1279d1115 100755 --- a/tools/ld_from_yaml.py +++ b/tools/ld_from_yaml.py @@ -46,13 +46,16 @@ SECTIONS {{ ENTRY({entry})""") args = [ - args.ld_bin, + args.ld_bin, # "-o", args.output, "-EL", "--script", args.linker_script_output, "--warn-section-align", + "--no-warn-mismatch", # TODO: Might be worth considering some mismatches? + "--warn-common", + "--warn-constructors" ] + objs subprocess.run(args) @@ -65,4 +68,4 @@ if __name__ == "__main__": parser.add_argument("--ld-bin", dest="ld_bin", type=str, required=True) args = parser.parse_args() - main(args) \ No newline at end of file + main(args)