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

Compiling fails on Musl-libC - error with NULL type; #357

Closed
SpidFightFR opened this issue Apr 3, 2024 · 2 comments
Closed

Compiling fails on Musl-libC - error with NULL type; #357

SpidFightFR opened this issue Apr 3, 2024 · 2 comments
Assignees
Labels
assigned The issue is assigned to engineer

Comments

@SpidFightFR
Copy link

SpidFightFR commented Apr 3, 2024

Hello, while compiling amdvlk from source for the Void-Linux distribution, the maintainers (thank you Johnnynator on the Void repo for your precious help !) noticed a small issue while compiling with musl-libc.

In the file pal/src/core/hw/gfxip/gfx9/gfx9UniversalCmdBuffer.cpp:

at lines 10155 and 10167, the usage of NULL, makes an error as it's interpreted as std::nullptr_t instead of a long unsigned integer as usually expected.

The GlibC compiler seems kinda tolerant to this, as the compiling process goes through without issue.
however Musl stops right through.

According to Johnny's help and my tests, replacing NULL, by 0UL, in both places, seems to fix the issue.

Just in case, we both also made a git patch for our Voidlinux compiler, it will be linked to this issue, for convenience.

amdvlk-fix-musl-build.patch
diff --git a/pal/src/core/hw/gfxip/gfx9/gfx9UniversalCmdBuffer.cpp b/pal/src/core/hw/gfxip/gfx9/gfx9UniversalCmdBuffer.cpp
index 2d62ec3ef..e14ccbb9c 100644
--- a/pal/src/core/hw/gfxip/gfx9/gfx9UniversalCmdBuffer.cpp
+++ b/pal/src/core/hw/gfxip/gfx9/gfx9UniversalCmdBuffer.cpp
@@ -10152,7 +10152,7 @@ uint32 UniversalCmdBuffer::BuildExecuteIndirectIb2Packets(
                                                                                      drawIndexReg,
                                                                                      1,
                                                                                      pParamData[cmdIndex].argBufSize,
-                                                                                     NULL,
+                                                                                     0UL,
                                                                                      PacketPredicate(),
                                                                                      usesLegacyMsFastLaunch,
                                                                                      pDeCmdIb2Space);
@@ -10164,7 +10164,7 @@ uint32 UniversalCmdBuffer::BuildExecuteIndirectIb2Packets(
                                                                                       drawIndexReg,
                                                                                       1,
                                                                                       pParamData[cmdIndex].argBufSize,
-                                                                                      NULL,
+                                                                                      0UL,
                                                                                       PacketPredicate(),
                                                                                       usesLegacyMsFastLaunch,
                                                                                       pDeCmdIb2Space);

Best regards - SpidFightFR

@qiaojbao
Copy link
Collaborator

Thanks, I will make a PR for this.

@qiaojbao qiaojbao self-assigned this Apr 10, 2024
@qiaojbao qiaojbao added the assigned The issue is assigned to engineer label Apr 10, 2024
@qiaojbao
Copy link
Collaborator

GPUOpen-Drivers/pal#98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned The issue is assigned to engineer
Projects
None yet
Development

No branches or pull requests

2 participants