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

[APP BUG]: Build broken on gcc due to issues in some of the amdgpu files #1994

Closed
1 of 2 tasks
C0rn3j opened this issue Dec 31, 2024 · 6 comments
Closed
1 of 2 tasks

Comments

@C0rn3j
Copy link
Contributor

C0rn3j commented Dec 31, 2024

Checklist

  • I have searched for a similar issue in this repository and did not find one.
  • I am using an official build obtained from releases or updated one of those builds using its in-app updater.

Describe the Bug

I am guessing this was introduced by #1869

[ 35%] Building CXX object CMakeFiles/shadps4.dir/src/qt_gui/elf_viewer.cpp.o
In file included from /home/c0rn3j/.cache/paru/clone/shadps4-git/src/shadps4/src/video_core/amdgpu/liverpool.h:25,
                 from /home/c0rn3j/.cache/paru/clone/shadps4-git/src/shadps4/src/video_core/renderer_vulkan/vk_presenter.h:8,
                 from /home/c0rn3j/.cache/paru/clone/shadps4-git/src/shadps4/src/imgui/renderer/imgui_core.cpp:17:
/home/c0rn3j/.cache/paru/clone/shadps4-git/src/shadps4/src/video_core/amdgpu/resource.h: In function ‘AmdGpu::CompMapping AmdGpu::RemapComponents(DataFormat, CompMapping)’:
/home/c0rn3j/.cache/paru/clone/shadps4-git/src/shadps4/src/video_core/amdgpu/resource.h:88:9: error: could not convert ‘{components.AmdGpu::CompMapping::b, components.AmdGpu::CompMapping::g, components.AmdGpu::CompMapping::r, components.AmdGpu::CompMapping::a}’ from ‘<brace-enclosed initializer list>’ to ‘AmdGpu::CompMapping’
   88 |         };
      |         ^
      |         |
      |         <brace-enclosed initializer list>
/home/c0rn3j/.cache/paru/clone/shadps4-git/src/shadps4/src/video_core/amdgpu/resource.h:96:9: error: could not convert ‘{components.AmdGpu::CompMapping::a, components.AmdGpu::CompMapping::b, components.AmdGpu::CompMapping::g, components.AmdGpu::CompMapping::r}’ from ‘<brace-enclosed initializer list>’ to ‘AmdGpu::CompMapping’
   96 |         };
      |         ^
      |         |
      |         <brace-enclosed initializer list>
/home/c0rn3j/.cache/paru/clone/shadps4-git/src/shadps4/src/video_core/amdgpu/liverpool.h: At global scope:
/home/c0rn3j/.cache/paru/clone/shadps4-git/src/shadps4/src/video_core/amdgpu/liverpool.h:892:34: error: declaration of ‘AmdGpu::DataFormat AmdGpu::Liverpool::ColorBuffer::DataFormat() const’ changes meaning of ‘DataFormat’ [-Wchanges-meaning]
  892 |         [[nodiscard]] DataFormat DataFormat() const {
      |                                  ^~~~~~~~~~
/home/c0rn3j/.cache/paru/clone/shadps4-git/src/shadps4/src/video_core/amdgpu/liverpool.h:892:23: note: used here to mean ‘enum class AmdGpu::DataFormat’
  892 |         [[nodiscard]] DataFormat DataFormat() const {
      |                       ^~~~~~~~~~
In file included from /home/c0rn3j/.cache/paru/clone/shadps4-git/src/shadps4/src/video_core/amdgpu/liverpool.h:23:
/home/c0rn3j/.cache/paru/clone/shadps4-git/src/shadps4/src/video_core/amdgpu/types.h:117:12: note: declared here
  117 | enum class DataFormat : u32 {
      |            ^~~~~~~~~~
[ 35%] Building CXX object CMakeFiles/shadps4.dir/src/qt_gui/main_window_themes.cpp.o

Reproduction Steps

Attempt to build AUR/shadps4-git -> this error

Judging by the Ubuntu CI passing on this, I am guessing something here on Arch is more strict. Seems to be clang vs gcc

I could not spot anything off about the recent changes vs the PKGBUILD other than having an extra cubeb dependency, which should be completely irrelevant to this issue.

Expected Behavior

No response

Specify OS Version

Arch Linux

@rharish101
Copy link

rharish101 commented Dec 31, 2024

I modified the PKGBUILD to build shadPS4 with Clang instead of GCC, and it builds (and runs well). Here is the diff for the PKGBUILD:

diff --git a/PKGBUILD b/PKGBUILD
index c4687d7..f12e71a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -19,7 +19,7 @@ depends=(
 makedepends=(
 	'boost>=1.84'
 	'cmake>=3.16.3'
-	'cubeb'
+	'clang'
 	'ffmpeg>=2:5.1.2'
 	'fmt>=10.2'
 	'git'
@@ -87,6 +87,8 @@ build() {
 	cmake -B build -S $_pkgname \
 		-DCMAKE_BUILD_TYPE=Release \
 		-DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
+		-DCMAKE_CXX_COMPILER=clang++ \
+		-DCMAKE_C_COMPILER=clang \
 		-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
 		-DCMAKE_INSTALL_PREFIX=/usr \
 		-DCMAKE_SKIP_INSTALL_RPATH=ON \
@@ -102,7 +104,6 @@ package() {
 		'libavcodec.so'
 		'libavformat.so'
 		'libavutil.so'
-		'libcubeb.so'
 		'libfmt.so'
 		'libpng16.so'
 		'libswresample.so'

Therefore, I think the title should be renamed to reference that it is a GCC vs Clang problem.

@C0rn3j C0rn3j changed the title [APP BUG]: Build broken on Arch Linux due to issues in some of the amdgpu files [APP BUG]: Build broken on gcc due to issues in some of the amdgpu files Dec 31, 2024
@tomboylover93
Copy link
Contributor

@abouvier You maintain the shadps4-git PKGBUILD, so you should look into replacing the default compiler with Clang as outlined above. It would be good practice as well as it is recommended over GCC.

@C0rn3j
Copy link
Contributor Author

C0rn3j commented Jan 1, 2025

I think an actual solution would be to have a CI job that compiles with GCC, to catch these before they're merged.

This isn't the first time this has happened - #1729

Unless shad wants to explicitly drop gcc support, it's good that the environments vary, more testing happens that way.

@tomboylover93
Copy link
Contributor

Since PR #2000 got merged this should be fixed. I've taken the idea of a GCC CI job into consideration and will open a PR for it later.

@Hermiten
Copy link
Collaborator

Hermiten commented Jan 2, 2025

Can you try @C0rn3j ? Thanks you :)

@C0rn3j
Copy link
Contributor Author

C0rn3j commented Jan 2, 2025

Compiles, thanks!

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

No branches or pull requests

4 participants