Skip to content
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

Build fix for archs where 64-bit __sync operators are not implemented. #395

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

julianaito
Copy link

On my OpenBSD/macppc box, wrk fails to build at linking time:

stats.c:(.text+0xb20): undefined reference to __sync_fetch_and_add_8
stats.c:(.text+0xb30): undefined reference to __sync_fetch_and_add_8
stats.c:(.text+0xb70): undefined reference to __sync_val_compare_and_swap_8
stats.c:(.text+0xbe4): undefined reference to __sync_val_compare_and_swap_8

On some platforms, like ppc32, gcc does not implement legacy 64 __sync_* functions, it instead supports __atomic_* ones, introduced from gcc-4.8.

I've simply fixed the build by applying the same technique used in atomicvar.h where there is already a dual support of __sync_* and __atomic_*, and used an existing Debian patch, that i've synced against master.

(cc @fcambus)

Add __atomic_* function support on top of __sync ones.
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.

1 participant