public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mathieu.malaterre at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/63368] New: undefined reference to `__sync_val_compare_and_swap_8'
Date: Thu, 25 Sep 2014 07:08:00 -0000	[thread overview]
Message-ID: <bug-63368-4@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2014-09-25  7:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-25  7:08 mathieu.malaterre at gmail dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-63368-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).