Crackdown 2 Error on Compile
$ clang++ -o CD2.exe ppc_func_mapping.cpp ppc_recomp.*.cpp -std=c++20 -Wno-deprecated -O2 -mssse3 -msse4.1 -mavx
ppc_recomp.209.cpp:4490:29: error: use of undeclared label 'loc_82C3A908'
4490 | if (ctx.ctr.u32 == 0) goto loc_82C3A908;
| ^
ppc_recomp.209.cpp:4493:29: error: use of undeclared label 'loc_82C3A904'
4493 | if (ctx.ctr.u32 == 0) goto loc_82C3A904;
| ^
2 errors generated.
Not sure if this is something fixable, trying to comment out those two lines since it doesn't seem to have any other reference but yea I'm hoping in time this will be fixed, if anyone has a suggestion let me know thanks.
ld.lld: error: undefined symbol: __imp__NetDll_XNetXnAddrToMachineId(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
>>> referenced by C:/msys64/tmp/ppc_recomp-59c578.o:(sub_82AEDA98(PPCContext&, unsigned char*))
ld.lld: error: undefined symbol: __imp__XamVoiceCreate(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
>>> referenced by C:/msys64/tmp/ppc_recomp-5a216e.o:(__declspec(dllimport) _sub_82BD9D58)
ld.lld: error: undefined symbol: __imp__MmQueryAllocationSize(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
>>> referenced by C:/msys64/tmp/ppc_recomp-c597b8.o:(sub_828C04D8(PPCContext&, unsigned char*))
ld.lld: error: undefined symbol: __imp__KeQuerySystemTime(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
>>> referenced by C:/msys64/tmp/ppc_recomp-c597b8.o:(sub_828C1580(PPCContext&, unsigned char*))
>>> referenced by C:/msys64/tmp/ppc_recomp-c768da.o:(sub_828C2E10(PPCContext&, unsigned char*))
>>> referenced 6 more times
ld.lld: error: undefined symbol: __imp__StfsCreateDevice(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
ld.lld: error: undefined symbol: __imp__KeTlsGetValue(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
>>> referenced by C:/msys64/tmp/ppc_recomp-a524ee.o:(__declspec(dllimport) _sub_82920748)
>>> referenced by C:/msys64/tmp/ppc_recomp-a524ee.o:(sub_82920768(PPCContext&, unsigned char*))
>>> referenced 4 more times
ld.lld: error: undefined symbol: __imp__KeTlsAlloc(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
>>> referenced by C:/msys64/tmp/ppc_recomp-a524ee.o:(sub_82920768(PPCContext&, unsigned char*))
>>> referenced by C:/msys64/tmp/ppc_recomp-878aa5.o:(sub_82E8C3D8(PPCContext&, unsigned char*))
>>> referenced 1 more times
ld.lld: error: undefined symbol: __imp__XamEnumerate(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
>>> referenced by C:/msys64/tmp/ppc_recomp-c768da.o:(sub_828C2C60(PPCContext&, unsigned char*))
ld.lld: error: undefined symbol: __imp__XMsgCancelIORequest(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
>>> referenced by C:/msys64/tmp/ppc_recomp-c768da.o:(sub_828C2C10(PPCContext&, unsigned char*))
>>> referenced by C:/msys64/tmp/ppc_recomp-5a216e.o:(__declspec(dllimport) _sub_82BD9580)
>>> referenced 1 more times
ld.lld: error: undefined symbol: __imp__XamNotifyCreateListener(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
>>> referenced by C:/msys64/tmp/ppc_recomp-c768da.o:(sub_828C2A28(PPCContext&, unsigned char*))
>>> referenced by C:/msys64/tmp/ppc_recomp-5a216e.o:(__declspec(dllimport) _sub_82BD7E38)
ld.lld: error: undefined symbol: __imp__RtlInitializeCriticalSectionAndSpinCount(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
>>> referenced by C:/msys64/tmp/ppc_recomp-f06630.o:(sub_82B10238(PPCContext&, unsigned char*))
>>> referenced by C:/msys64/tmp/ppc_recomp-aa3d88.o:(sub_82B37A98(PPCContext&, unsigned char*))
>>> referenced 12 more times
ld.lld: error: undefined symbol: __imp__VdQueryVideoMode(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
>>> referenced by C:/msys64/tmp/ppc_recomp-9142e5.o:(sub_82892668(PPCContext&, unsigned char*))
>>> referenced by C:/msys64/tmp/ppc_recomp-9142e5.o:(sub_82894020(PPCContext&, unsigned char*))
>>> referenced 1 more times
ld.lld: error: undefined symbol: __imp__RtlRaiseException(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
>>> referenced by C:/msys64/tmp/ppc_recomp-c768da.o:(sub_828CD6F8(PPCContext&, unsigned char*))
>>> referenced by C:/msys64/tmp/ppc_recomp-c768da.o:(__declspec(dllimport) _sub_828CD700)
>>> referenced 3 more times
ld.lld: error: undefined symbol: __imp__MmSetAddressProtect(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
>>> referenced by C:/msys64/tmp/ppc_recomp-c597b8.o:(sub_828C04E0(PPCContext&, unsigned char*))
ld.lld: error: undefined symbol: __imp__RtlCompareMemoryUlong(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
>>> referenced by C:/msys64/tmp/ppc_recomp-c768da.o:(sub_828CBEB8(PPCContext&, unsigned char*))
>>> referenced by C:/msys64/tmp/ppc_recomp-c768da.o:(sub_828CBEB8(PPCContext&, unsigned char*))
>>> referenced 6 more times
ld.lld: error: undefined symbol: __imp__XAudioRegisterRenderDriverClient(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
>>> referenced by C:/msys64/tmp/ppc_recomp-5a60c9.o:(sub_82CDDB80(PPCContext&, unsigned char*))
ld.lld: error: undefined symbol: __imp__IoDismountVolume(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
>>> referenced by C:/msys64/tmp/ppc_recomp-c768da.o:(sub_828C2260(PPCContext&, unsigned char*))
>>> referenced by C:/msys64/tmp/ppc_recomp-c768da.o:(sub_828C2260(PPCContext&, unsigned char*))
ld.lld: error: undefined symbol: __imp__XGetVideoMode(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
>>> referenced by C:/msys64/tmp/ppc_recomp-5848fe.o:(sub_822A13C0(PPCContext&, unsigned char*))
>>> referenced by C:/msys64/tmp/ppc_recomp-5848fe.o:(sub_822A7D28(PPCContext&, unsigned char*))
>>> referenced 7 more times
ld.lld: error: undefined symbol: __imp__XGetGameRegion(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
>>> referenced by C:/msys64/tmp/ppc_recomp-f6f093.o:(sub_8281DF18(PPCContext&, unsigned char*))
>>> referenced by C:/msys64/tmp/ppc_recomp-49fa86.o:(__declspec(dllimport) _sub_82822918)
>>> referenced 5 more times
ld.lld: error: undefined symbol: __imp__XamLoaderSetLaunchData(PPCContext&, unsigned char*)
>>> referenced by C:/msys64/tmp/ppc_func_mapping-95c3fa.o:(PPCFuncMappings)
>>> referenced by C:/msys64/tmp/ppc_recomp-c273dd.o:(sub_82378A68(PPCContext&, unsigned char*))
ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
This follows after compilation process ends. This is with the previous comment's lines commented out in the code.
Not sure about your first issue. Function boundary issues?
As for the second one, you'll need to implement these imports in a separate .cpp file. Some example discussions:
https://github.com/hedge-dev/XenonRecomp/issues/96#issuecomment-2709101684 https://github.com/hedge-dev/XenonRecomp/issues/32#issuecomment-2728088982