public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/63368] New: undefined reference to `__sync_val_compare_and_swap_8'
@ 2014-09-25  7:08 mathieu.malaterre at gmail dot com
  2014-09-25  7:16 ` [Bug c/63368] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: mathieu.malaterre at gmail dot com @ 2014-09-25  7:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63368

            Bug ID: 63368
           Summary: undefined reference to `__sync_val_compare_and_swap_8'
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mathieu.malaterre at gmail dot com

If I am reading the online documentation properly:

https://gcc.gnu.org/onlinedocs/gcc-4.9.1/gcc/_005f_005fsync-Builtins.html#_005f_005fsync-Builtins

__sync_val_compare_and_swap on some targets will result in a function call
(where direct code generation is not available or not yet implemented). 

It seems to be happening in my testcase, however __sync_val_compare_and_swap_8
does not seems to be defined anywhere else.

Steps:

$ cat t.c 
#include <stdint.h>

int main()
{
  int64_t x = 0, y = 1; 
  y = __sync_val_compare_and_swap(&x, x, y);
  return 0;
}
$ gcc t.c
/tmp/cc6JIpFx.o: In function `main':
t.c:(.text+0x64): undefined reference to `__sync_val_compare_and_swap_8'
collect2: ld returned 1 exit status
$ gcc t.c -lgcc_s
/tmp/ccu3ReMZ.o: In function `main':
t.c:(.text+0x64): undefined reference to `__sync_val_compare_and_swap_8'
collect2: ld returned 1 exit status
$ gcc t.c -lgcc
/tmp/ccO8gyeR.o: In function `main':
t.c:(.text+0x64): undefined reference to `__sync_val_compare_and_swap_8'
collect2: ld returned 1 exit status


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-05-09  3:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-25  7:08 [Bug c/63368] New: undefined reference to `__sync_val_compare_and_swap_8' mathieu.malaterre at gmail dot com
2014-09-25  7:16 ` [Bug c/63368] " pinskia at gcc dot gnu.org
2014-09-25  7:31 ` [Bug c/63368] Provide an implementation for `__sync_val_compare_and_swap_8' on powerpc (32bits) mathieu.malaterre at gmail dot com
2014-09-25  7:34 ` pinskia at gcc dot gnu.org
2014-09-25  8:38 ` mathieu.malaterre at gmail dot com
2014-09-30  7:30 ` mathieu.malaterre at gmail dot com
2015-05-28 12:09 ` mathieu.malaterre at gmail dot com
2021-08-16 22:07 ` glaubitz at physik dot fu-berlin.de
2023-05-09  3:55 ` vital.had at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).