tools/setup: Auto-install check (viking)

This commit is contained in:
MonsterDruide1 2021-08-08 22:39:43 +02:00
parent 18152c5909
commit aa4231eff2
4 changed files with 9 additions and 8 deletions

1
.gitignore vendored
View File

@ -41,3 +41,4 @@ perf.data.old
# Tooling
/toolchain/clang-*
tools/check

View File

@ -154,7 +154,7 @@ public:
* Be sure to change the status column from `U` (undecompiled) to `O` (OK).
* Example: `0x00000071010c0d60,O,136,_ZN4ksys4util13TaskQueueBaseD1Ev`
7. **Compare the assembly** with `botw-check --source <mangled function name>`
7. **Compare the assembly** with `tools/check --source <mangled function name>`
* This will bring up a two-column diff. The code on the left is the original code; the code on the right is your version of the function.
* You may ignore address differences (which often show up in adrp+ldr pairs or bl or b).
@ -170,7 +170,7 @@ public:
* If there are still minor differences left, wrap the function in an `#ifdef NON_MATCHING`, add a comment to explain what is wrong, and change the status to `m` (minor difference) in the CSV.
* For major differences (lots of entirely red/green/blue lines in the diff), use a capital `M` (major difference) in place of `m`.
10. Before opening a PR, reformat the code with clang-format and run `botw-check`.
10. Before opening a PR, reformat the code with clang-format and run `tools/check`.
## Non-inlined functions
@ -199,8 +199,8 @@ This project sometimes uses small hacks to force particular code to be generated
## Project tools
* Check all decompiled functions for issues: `botw-check`
* To compare assembly: `botw-check <mangled function name>`
* Check all decompiled functions for issues: `tools/check`
* To compare assembly: `tools/check <mangled function name>`
* The function **must be listed in data/uking_functions.csv first**.
* To do so, search for the name or the address of function you have decompiled, and add the mangled function name to the last column.
* Pass the `--source` flag to show source code interleaved with assembly code.

View File

@ -158,8 +158,6 @@ Additionally, you'll also need:
2. Run `git submodule update --init --recursive`
3. Run `cargo install --path tools/common/viking`
Next, you'll need to acquire the **original 1.5.0 or 1.6.0 `main` NSO executable**.
* To dump it from a Switch, follow [the instructions on the wiki](https://zeldamods.org/wiki/Help:Dumping_games#Dumping_binaries_.28executable_files.29).
@ -167,8 +165,9 @@ Additionally, you'll also need:
* The decompressed 1.5.0 NSO has the following SHA256 hash: `d9fa308d0ee7c0ab081c66d987523385e1afe06f66731bbfa32628438521c106`
* If you have a compressed NSO or a 1.6.0 executable, don't worry about this.
4. Run `tools/common/setup.py [path to the NSO]`
3. Run `tools/common/setup.py [path to the NSO]`
* This will:
* install tools/check to check for differences in decompiled code
* convert the executable if necessary
* set up [Clang 4.0.1](https://releases.llvm.org/download.html#4.0.1) by downloading it from the official LLVM website
* create a build directory in `build/`
@ -184,7 +183,7 @@ ninja -C build
By default, Ninja will perform a multithreaded build. There is no need to pass -j manually.
To check whether everything built correctly, just run `botw-check` after the build completes.
To check whether everything built correctly, just run `tools/check` after the build completes.
## Contributing

View File

@ -83,6 +83,7 @@ def main():
help="Path to the original NSO (1.5.0 or 1.6.0, compressed or not)")
args = parser.parse_args()
setup.install_viking()
prepare_executable(args.original_nso)
setup.set_up_compiler("4.0.1")
setup.create_build_dir()