FS#59539 - [riscv64-linux-gnu-gcc] Cannot link programs with -pthread

Attached to Project: Community Packages
Opened by Jack Lloyd (randombit) - Monday, 06 August 2018, 17:46 GMT
Last edited by Toolybird (Toolybird) - Sunday, 04 December 2022, 04:58 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Felix Yan (felixonmars)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

Description:

RISCV64 requires libatomic for pthreads, but this lib is not provided by the current RISCV compiler packages.
So all programs that require -pthread fail to link.

For at least some programs, replacing -pthread with -lpthread seems to be sufficient.

Additional info:
* riscv64-linux-gnu-gcc 8.2.0-1
* riscv64-linux-gnu-binutils 2.31.1-1
* riscv64-linux-gnu-glibc 2.27-1
* riscv64-linux-gnu-linux-api-headers 4.16-1

Steps to reproduce:

$ echo "int main() {}" > main.c
$ riscv64-linux-gnu-gcc -pthread empty.c
/usr/lib/gcc/riscv64-linux-gnu/8.2.0/../../../../riscv64-linux-gnu/bin/ld: cannot find -latomic
collect2: error: ld returned 1 exit status
This task depends upon

Closed by  Toolybird (Toolybird)
Sunday, 04 December 2022, 04:58 GMT
Reason for closing:  Fixed
Additional comments about closing:  riscv64-linux-gnu-gcc 12.1.0-2

Loading...