Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linkage error on debug build with clang-13 #11470

Merged
merged 1 commit into from Jan 31, 2022

Conversation

sandrain
Copy link
Contributor

Debug build with clang-13 fails with "undefined references" to the
static const members in spu_channel class. This patch replaces the const
definitions with constexpr constants.

The following is the output when the build fails:

$ CC=clang CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Debug ../rpcs3 && make
...
[100%] Building CXX object rpcs3/CMakeFiles/rpcs3.dir/Input/mm_joystick_handler.cpp.o
[100%] Building CXX object rpcs3/CMakeFiles/rpcs3.dir/Input/pad_thread.cpp.o
[100%] Building CXX object rpcs3/CMakeFiles/rpcs3.dir/Input/xinput_pad_handler.cpp.o
[100%] Linking CXX executable ../bin/rpcs3
/usr/bin/x86_64-pc-linux-gnu-ld: Emu/librpcs3_emu.a(SPUASMJITRecompiler.cpp.o): in function `operator()':
/home/hyogi/workspace/rpcs3/rpcs3/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp:1358: undefined reference to `spu_channel::off_count'
/usr/bin/x86_64-pc-linux-gnu-ld: /home/hyogi/workspace/rpcs3/rpcs3/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp:1531: undefined reference to `spu_channel::off_count'
/usr/bin/x86_64-pc-linux-gnu-ld: Emu/librpcs3_emu.a(SPUASMJITRecompiler.cpp.o): in function `spu_recompiler::WRCH(spu_opcode_t)':
/home/hyogi/workspace/rpcs3/rpcs3/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp:2309: undefined reference to `spu_channel::off_count'
/usr/bin/x86_64-pc-linux-gnu-ld: /home/hyogi/workspace/rpcs3/rpcs3/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp:2324: undefined reference to `spu_channel::off_count'
/usr/bin/x86_64-pc-linux-gnu-ld: /home/hyogi/workspace/rpcs3/rpcs3/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp:2391: undefined reference to `spu_channel::off_count'
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [rpcs3/CMakeFiles/rpcs3.dir/build.make:479: bin/rpcs3] Error 1
make[1]: *** [CMakeFiles/Makefile2:28936: rpcs3/CMakeFiles/rpcs3.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Debug build with clang-13 fails with "undefined references" to the
static const members in spu_channel class. This patch replaces the const
definitions with constexpr constants.
@Nekotekina
Copy link
Member

Thank you!

@Nekotekina Nekotekina merged commit 3a80467 into RPCS3:master Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants