Skip to content

Conversation

@r-value
Copy link
Contributor

@r-value r-value commented Mar 28, 2022

This fixes build on RISC-V with glibc 2.34+.

The main cause is that since glibc 2.34, there is no need to pass a -pthread to use std::thread, but std::atomic won't work without one of -pthread and -latomic flag on RISC-V.

std::atomic is referenced in file qcoro/task.h as std::atomic<bool> QCoro::detail::TaskPromiseBase::mResumeAwaiter and std::atomic<bool> QCoro::detail::TaskPromiseBase::mDestroyHandle. It's also referenced in tests/testhttpserver.h so I linked network tests against libatomic, too.

This patch is tested on rv64gc(qemu).

@github-actions
Copy link
Contributor

github-actions bot commented Mar 28, 2022

Unit Test Results

  6 files  ±0    6 suites  ±0   2m 50s ⏱️ -1s
13 tests ±0  13 ✔️ ±0  0 💤 ±0  0 ±0 
74 runs  ±0  74 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 312f2fc. ± Comparison against base commit f572a0c.

♻️ This comment has been updated with latest results.

Check libatomic and link QCoro against it if necessary.
r-value added a commit to r-value/archriscv-packages that referenced this pull request Mar 28, 2022
 + Adapt patch to latest release
 + Better approach for atomic operations
 + Changes upstreamed in qcoro/qcoro#52
felixonmars pushed a commit to felixonmars/archriscv-packages that referenced this pull request Mar 28, 2022
 + Adapt patch to latest release
 + Better approach for atomic operations
 + Changes upstreamed in qcoro/qcoro#52
@danvratil danvratil merged commit d8e2f3a into qcoro:main Mar 28, 2022
@danvratil
Copy link
Collaborator

Thanks for the patch!

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