Issue #3222 has been reported by mneumann.

----------------------------------------
Bug #3222: gcc - undefined reference to '__atomic_load' (missing libatomic?)
http://bugs.dragonflybsd.org/issues/3222

* Author: mneumann
* Status: New
* Priority: Normal
* Assignee: 
* Category: Userland
* Target version: master
----------------------------------------
I can't compile the following C11 program:

// atomic_test.c
#include <stdio.h>
#include <complex.h>
#include <stdatomic.h>

int main(void)
{
    _Atomic long double _Complex x; 
    printf("(%Lf,%Lf)\n",creall(x), cimagl(x));
    return 0;
}

> cc -std=c11 atomic_test.c
/tmp//ccTm73vw.o:atomic_test.c:function main: error: undefined reference to 
'__atomic_load'
/tmp//ccTm73vw.o:atomic_test.c:function main: error: undefined reference to 
'__atomic_load'
collect2: error: ld returned 1 exit status

On my Linux system, I can link in -latomic:

> cc -std=c11 atomic_test.c -latomic

But it seems this got removed from DragonFly's gcc8. I try to compile the Pony 
compiler ponyc,
which requires these atomic ops.




-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://bugs.dragonflybsd.org/my/account

Reply via email to