Skip to content

pkcs11: add missing threads dependency#485

Merged
sarroutbi merged 1 commit intolatchset:masterfrom
oldium:fix/pkcs11-threads
Oct 6, 2024
Merged

pkcs11: add missing threads dependency#485
sarroutbi merged 1 commit intolatchset:masterfrom
oldium:fix/pkcs11-threads

Conversation

@oldium
Copy link
Copy Markdown
Contributor

@oldium oldium commented Oct 5, 2024

Fixes the following error when building for Debian 11:

FAILED: src/pins/pkcs11/clevis-pkcs11-afunix-socket-unlock
cc  -o src/pins/pkcs11/clevis-pkcs11-afunix-socket-unlock src/pins/pkcs11/clevis-pkcs11-afunix-socket-unlock.p/clevis-pkcs11-afunix-socket-unlock.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-z,now -g -O2 -ffile-prefix-map=/usr/src/clevis-21=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2
/usr/bin/ld: src/pins/pkcs11/clevis-pkcs11-afunix-socket-unlock.p/clevis-pkcs11-afunix-socket-unlock.c.o: in function `main':
./obj-x86_64-linux-gnu/../src/pins/pkcs11/clevis-pkcs11-afunix-socket-unlock.c:270: undefined reference to `pthread_create'
/usr/bin/ld: ./obj-x86_64-linux-gnu/../src/pins/pkcs11/clevis-pkcs11-afunix-socket-unlock.c:359: undefined reference to `pthread_kill'
/usr/bin/ld: ./obj-x86_64-linux-gnu/../src/pins/pkcs11/clevis-pkcs11-afunix-socket-unlock.c:361: undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status

Fixes the following error when building for Debian 11:

```
FAILED: src/pins/pkcs11/clevis-pkcs11-afunix-socket-unlock
cc  -o src/pins/pkcs11/clevis-pkcs11-afunix-socket-unlock src/pins/pkcs11/clevis-pkcs11-afunix-socket-unlock.p/clevis-pkcs11-afunix-socket-unlock.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-z,now -g -O2 -ffile-prefix-map=/usr/src/clevis-21=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2
/usr/bin/ld: src/pins/pkcs11/clevis-pkcs11-afunix-socket-unlock.p/clevis-pkcs11-afunix-socket-unlock.c.o: in function `main':
./obj-x86_64-linux-gnu/../src/pins/pkcs11/clevis-pkcs11-afunix-socket-unlock.c:270: undefined reference to `pthread_create'
/usr/bin/ld: ./obj-x86_64-linux-gnu/../src/pins/pkcs11/clevis-pkcs11-afunix-socket-unlock.c:359: undefined reference to `pthread_kill'
/usr/bin/ld: ./obj-x86_64-linux-gnu/../src/pins/pkcs11/clevis-pkcs11-afunix-socket-unlock.c:361: undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
```

Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
@sarroutbi
Copy link
Copy Markdown
Collaborator

Hello @oldium . Thanks for your PR.

May I ask why was not this detected by the corresponding GH action?

@oldium
Copy link
Copy Markdown
Contributor Author

oldium commented Oct 6, 2024

I have not checked this specifically earlier, but I found there were some recent changes in glibc and its integration of standard libraries. This article brings some details - https://developers.redhat.com/articles/2021/12/17/why-glibc-234-removed-libpthread.

@sarroutbi
Copy link
Copy Markdown
Collaborator

I have not checked this specifically earlier, but I found there were some recent changes in glibc and its integration of standard libraries. This article brings some details - https://developers.redhat.com/articles/2021/12/17/why-glibc-234-removed-libpthread.

OK. Thanks for the information

Copy link
Copy Markdown
Collaborator

@sarroutbi sarroutbi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR @oldium . Changes LGTM

@sarroutbi sarroutbi merged commit 9d854e9 into latchset:master Oct 6, 2024
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 this pull request may close these issues.

2 participants