Skip to content

pthread_key_t errors on OpenBSD #12135

Closed
@euantorano

Description

@euantorano

Running tests on OpenBSD results in quite a lot of errors such as below:

Category: dll
Name: tests/dll/client.nim C --gc:boehm --threads:on
Action: run
Result: reNimcCrash
-------- Expected -------

--------- Given  --------
$ /home/administrator/build/Nim/bin/nim c --debuginfo --hints:on --define:useNimRtl --gc:boehm --threads:on --nimCache:nimcache/tests/dll/client.nim_b72fd7d9778886456f94711ee41aadba tests/
dll/client.nim
Hint: used config file '/home/administrator/build/Nim/config/nim.cfg' [Conf]
Hint: used config file '/home/administrator/build/Nim/tests/dll/client.nim.cfg' [Conf]
Hint: used config file '/home/administrator/build/Nim/config/config.nims' [Conf]
Hint: used config file '/home/administrator/build/Nim/tests/config.nims' [Conf]
Hint: system [Processing]
Hint: widestrs [Processing]
Hint: io [Processing]
Hint: client [Processing]
client.nim(24, 6) Hint: 'newOp' is declared but not used [XDeclaredButNotUsed]
client.nim(23, 6) Hint: 'newLit' is declared but not used [XDeclaredButNotUsed]
CC: stdlib_io.nim
CC: stdlib_system.nim
CC: client.nim
Error: execution of an external compiler program 'clang -c  -w -pthread -g  -I/home/administrator/build/Nim/lib -I/home/administrator/build/Nim/tests/dll -o /home/administrator/build/Nim/n
imcache/tests/dll/client.nim_b72fd7d9778886456f94711ee41aadba/stdlib_system.nim.c.o /home/administrator/build/Nim/nimcache/tests/dll/client.nim_b72fd7d9778886456f94711ee41aadba/stdlib_syst
em.nim.c' failed with exit code: 1

/home/administrator/build/Nim/nimcache/tests/dll/client.nim_b72fd7d9778886456f94711ee41aadba/stdlib_system.nim.c:174:1: error: unknown type name 'pthread_key_t'
pthread_key_t globalsSlot__ciXDZu9c27pHpCRMoz4RIgw;
^
1 error generated.

This is because pthread_key_t is defined in pthread.h on OpenBSD rather than in sys/types.h.

Possible Solution

As with #12109, a new posix_openbsd_amd64 module should be added to define pthread_key_t correctly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions