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

Closed
opened 2026-02-27 21:07:37 +03:00 by kerem · 6 comments
Owner

Originally created by @C0rn3j on GitHub (Dec 31, 2024).
Original GitHub issue: https://github.com/shadps4-emu/shadPS4/issues/1994

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

Originally created by @C0rn3j on GitHub (Dec 31, 2024). Original GitHub issue: https://github.com/shadps4-emu/shadPS4/issues/1994 ### Checklist - [X] I have searched for a similar issue in this repository and did not find one. - [ ] I am using an official build obtained from [releases](https://github.com/shadps4-emu/shadPS4/releases) or updated one of those builds using its in-app updater. ### Describe the Bug I am guessing this was introduced by #1869 ```cpp [ 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](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=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
kerem closed this issue 2026-02-27 21:07:37 +03:00
Author
Owner

@rharish101 commented on GitHub (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.

<!-- gh-comment-id:2566691121 --> @rharish101 commented on GitHub (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 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.
Author
Owner

@tomboylover93 commented on GitHub (Jan 1, 2025):

@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.

<!-- gh-comment-id:2567161866 --> @tomboylover93 commented on GitHub (Jan 1, 2025): @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.
Author
Owner

@C0rn3j commented on GitHub (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.

<!-- gh-comment-id:2567179425 --> @C0rn3j commented on GitHub (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.
Author
Owner

@tomboylover93 commented on GitHub (Jan 2, 2025):

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.

<!-- gh-comment-id:2567877495 --> @tomboylover93 commented on GitHub (Jan 2, 2025): 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.
Author
Owner

@Hermiten commented on GitHub (Jan 2, 2025):

Can you try @C0rn3j ? Thanks you :)

<!-- gh-comment-id:2567880536 --> @Hermiten commented on GitHub (Jan 2, 2025): Can you try @C0rn3j ? Thanks you :)
Author
Owner

@C0rn3j commented on GitHub (Jan 2, 2025):

Compiles, thanks!

<!-- gh-comment-id:2567897340 --> @C0rn3j commented on GitHub (Jan 2, 2025): Compiles, thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#688
No description provided.