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

Doesn't build on musl systems #65

Closed
CamilleScholtz opened this issue Dec 18, 2020 · 4 comments · May be fixed by #96
Closed

Doesn't build on musl systems #65

CamilleScholtz opened this issue Dec 18, 2020 · 4 comments · May be fixed by #96

Comments

@CamilleScholtz
Copy link

the following patch fixes this:

diff --git a/src/libhsakmt.h b/src/libhsakmt.h
index 1cae43a..37d72b3 100644
--- a/src/libhsakmt.h
+++ b/src/libhsakmt.h
@@ -32,6 +32,10 @@
 #include <stdint.h>
 #include <limits.h>
 
+#ifdef PAGE_SIZE
+#undef PAGE_SIZE
+#endif
+
 extern int kfd_fd;
 extern unsigned long kfd_open_count;
 extern bool hsakmt_forked;
diff --git a/src/topology.c b/src/topology.c
index 36ef987..d0b487e 100644
--- a/src/topology.c
+++ b/src/topology.c
@@ -34,6 +34,7 @@
 
 #include <errno.h>
 #include <sys/sysinfo.h>
+#include <sys/param.h>
 
 #include "libhsakmt.h"
 #include "fmm.h"
@fxkamd
Copy link
Contributor

fxkamd commented Dec 18, 2020

Excuse my ignorance. What's a musl system?

If there is a conflict between our global variable PAGE_SIZE and a macro defined in a header file, it may be cleaner to rename our variable to something like g_page_size.

@CamilleScholtz
Copy link
Author

musl is an alternative to glibc: https://musl.libc.org/

I don't know much about C and especially not these kind of global variables, that's why I made this an issue instead of PR.

Some more info about PAGE_SIZE in musl:

@notmentaloutlaw
Copy link

Do you perhaps have a fix for 5.6?

Unfortunately I am getting errors on my system

@AngryLoki
Copy link
Contributor

PAGE_SIZE is a reserved symbolic name of <limits.h>[1], so it is not an issue that can be fixed on musl side.

There is an open bug in Gentoo[2] on ROCT-Thunk-Interface (one of multiple).

[1] https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html
[2] https://bugs.gentoo.org/830944

AngryLoki added a commit to AngryLoki/ROCT-Thunk-Interface that referenced this issue Mar 9, 2024
This allows to build ROCT-Thunk-Interface for Alpine Linux, Gentoo with musl profile and so on.

List of changes:
* Fix redefinition of PAGE_SIZE from limits.h
* Use NAME_MAX from limits.h

Closes ROCm#65

Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
AngryLoki added a commit to AngryLoki/gentoo that referenced this issue Mar 9, 2024
gentoo-bot pushed a commit to gentoo/gentoo that referenced this issue Mar 10, 2024
…d 6.0.0

Upstream PR: ROCm/ROCT-Thunk-Interface#96
Upstream bug: ROCm/ROCT-Thunk-Interface#65
Closes: https://bugs.gentoo.org/830944
Closes: https://bugs.gentoo.org/715434
Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
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 a pull request may close this issue.

4 participants