-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
nimsuggest
: failed to build with clang
on musl libc
#20886
Comments
here is fix for nim 1.6.12: diff --git a/lib/system/threadlocalstorage.nim b/lib/system/threadlocalstorage.nim
--- a/lib/system/threadlocalstorage.nim
+++ b/lib/system/threadlocalstorage.nim
@@ -129,7 +129,7 @@ else:
when (defined(linux) or defined(nintendoswitch)) and defined(amd64):
type
SysThread* {.importc: "pthread_t",
- header: "<sys/types.h>" .} = distinct culong
+ header: "<sys/types.h>" .} = distinct pointer
Pthread_attr {.importc: "pthread_attr_t",
header: "<sys/types.h>".} = object
abi: array[56 div sizeof(clong), clong] with this change everything compiles fine i think this should be done somehow with when replacing with
|
hello, facing the same issue. Any updates on this one? |
…tinct (#24313) fixes #18896 fixes #20886 ```nim type PFile {.importc: "FILE*", header: "<stdio.h>".} = distinct pointer # import C's FILE* type; Nim will treat it as a new pointer type ``` This is an excerpt from the Nim manual. In the old Nim versions, it produces a void pointer type instead of the `FILE*` type that should have been generated. Because these C types tend to be opaque and adapt to changes on different platforms. It might affect the portability of Nim on various OS, i.e. `csource_v2` cannot build on the apline platform because of `Time` relies on Nim types instead of the `time_t` type. ref #18851 (cherry picked from commit 8be82c3)
facing this issue on Proposed change still works but now is in SysThread* {.importc: "pthread_t", header: "<sys/types.h>" .} = distinct pointer |
What happened?
failed to build
nimsuggest
withclang
onmusl libc
because of incorrect type ofThread.sys
in nim
SysThread
defined here:https://github.com/nim-lang/Nim/blob/v1.6.8/lib/system/threadlocalstorage.nim#L131
in
devel
branch it is defined asculong
:Nim/lib/std/private/threadtypes.nim
Lines 75 to 76 in 79b25a9
but in /usr/include/bits/alltypes.h it is defined as struct pointer:
Nim Version
trying to build:
nim-1.6.8
Current Standard Output Logs
Expected Standard Output Logs
No response
Possible Solution
No response
Additional Information
$
clang --version
clang version:
15.0.2
Target:
x86_64-gentoo-linux-musl
musl version:
1.2.3
The text was updated successfully, but these errors were encountered: