Skip to content

Compilation Errors for XenonRecomp Results with g++ and Clang #18

@aupennington

Description

@aupennington

Summary

When utilizing XenonRecomp, I learned that a few instructions in the games I tested were not implemented. When I compile them in g++, it complains about calls for functions that weren't declared (further detailed below). Initially, I was under the belief these missing function declarations were due to these unimplemented instructions. However, reviewing the documentation notates that g++ is not recommended. Regardless, another game (that admittedly also utilizes missing instructions; these instructions are completely different from the one I'm primarily wanting to get running) also produced the same compilation errors. Compiling with Clang produces a different set of errors altogether. I wanted to highlight it below and ask for any insight if at all possible.

Unimplemented Instructions

The following instructions appear to not be implemented in recompiler.cpp at this time:

  • dcbst
  • frsqrte

Compilation Error with G++

The following function calls are generated, but the functions themselves aren't declared in scope:

  • __builtin_rotateleft32
  • __builtin_rotateleft64
  • __builtin_assume

Compilation Errors with Clang

The following are needed target features:

  • sse4.1
  • avx

The following is another error that slightly varied:
always_inline function '__mm_shuffle_epi8' requires target feature 'ssse3', but would be inlined into function [this varies but generally follows the naming scheme of '__imp__sub__HEXHERE'] that is compiled without support for 'ssse3'

======================
Steps Performed:

Note: Any new users reading this may be tempted to follow below exactly. However, please know that you will not inherently produce good results (and these may have resulted in my issue). For instance, the XenonAnalyse will not produce a working .toml file for all games (as games may utilize patterns that the pattern check isn't familiar with as noted here)

  1. Ensured WSL was installed; I utilize Win 10
  2. Download repository (git clone https://github.com/hedge-dev/XenonRecomp.git in CMD)
  3. Installed Clang 18.1.8
  4. Ensured CMake was installed using cmake --version in CMD; I had to install it on their website
  5. Downloaded all submodules in CMD in root repository (utilized git submodules --init; I haven't utilized submodules before admittedly so I may need to use update in the future too)
  6. Compiled entirety of project in VS utilizing Clang v. 18.1.8.
  7. Ran XenonAnalyse.exe [Game's default.XEX Path] [Where You Want the Jump Table .TOML File] in CMD. Jump Table .TOML file successfully created.
  8. Created new config.toml file for my game specifically. I did remove the patch_file_path assignment as I have no patch for my game.
  9. Ran XenonRecomp.exe [the config .toml file] [path to ppc_context.h in XenonUtil] in CMD
  10. Navigated to C:/XboxRecompileProject/GAME/Output
  11. Attempted to compile once with g++. This compilation complained that functions were not declared.
  12. Attempted to compile again with Clang. Received errors about what was shared above.

GAME_Config.toml

[main]
file_path = "C:/XboxRecompileProject/GAME/default.xex"
patched_file_path = "C:/XboxRecompileProject/GAME/default_patched.xex"
out_directory_path = "C:/XboxRecompileProject/GAME/Output"
switch_table_file_path = "GAME_JT.toml"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions