public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* __sync_-builtins cause undefined references on some sparc targets
@ 2017-02-27 15:55 Jan.Sommer
  2017-02-27 21:08 ` Eric Botcazou
  0 siblings, 1 reply; 7+ messages in thread
From: Jan.Sommer @ 2017-02-27 15:55 UTC (permalink / raw)
  To: gcc; +Cc: devel

Hello,

I compiled the gcc 6.3.0 for the leon2 processor for RTEMS (i.e. sparc-rtems4.12-*). When linking a fortran program for the leon2 processor I get undefined references for `__sync_bool_compare_and_swap_4' (see below).
According to the discussion on the rtems mailinglist the __sync_*-operations are legacy and __atomic_*-operations should be used instead or to quote:

"This __sync_() stuff seems to be used in several places in GCC. So, changing libbacktrace is probably not enough. We need a general solution for the __sync_() builtins on RTEMS. I don't think GCC can be changed to emit __atomic_() calls for the __sync_() builtins (I would still try to ask). The libgcc or libatomic is probably a good place to add them for RTEMS as functions implemented via __atomic_() builtins."

Could someone give me some recommendations on what would be the best solution to fix the problem and maybe some pointers on how to start?

I put the rtems mailinglist CC, so they can comment as well.


sparc-rtems4.12-gcc -B../../../../../leon2/lib/ -specs bsp_specs -qrtems -mcpu=cypress -mhard-float -O2 -g -ffunction-sections -fdata-sections -Wall -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs  -Wl,--gc-sections  -mcpu=cypress -mhard-float   -o ticker.exe init.o tasks.o -L/localdata/somm_ja/rtems-fortran/install/bsps/4.12/sparc/sparc-rtems4.12/leon2/lib/ -llapack -lrefblas -ltmglib -lcblas -lm -lgfortran -lgcc
/localdata/somm_ja/rtems-fortran/install/tools/4.12/sparc/lib/gcc/sparc-rtems4.12/6.3.0/libgfortran.a(elf.o): In function `backtrace_initialize':
/localdata/somm_ja/rtems-fortran/rtems-source-builder/rtems/build/sparc-rtems4.12-gcc-6.3.0-newlib-2.5.0-x86_64-linux-gnu-1/build/sparc-rtems4.12/libbacktrace/../../../gcc-6.3.0/libbacktrace/elf.c:960: undefined reference to `__sync_bool_compare_and_swap_4'
/localdata/somm_ja/rtems-fortran/install/tools/4.12/sparc/lib/gcc/sparc-rtems4.12/6.3.0/libgfortran.a(elf.o): In function `elf_add_syminfo_data':
/localdata/somm_ja/rtems-fortran/rtems-source-builder/rtems/build/sparc-rtems4.12-gcc-6.3.0-newlib-2.5.0-x86_64-linux-gnu-1/build/sparc-rtems4.12/libbacktrace/../../../gcc-6.3.0/libbacktrace/elf.c:456: undefined reference to `__sync_bool_compare_and_swap_4'
/localdata/somm_ja/rtems-fortran/install/tools/4.12/sparc/lib/gcc/sparc-rtems4.12/6.3.0/libgfortran.a(dwarf.o): In function `backtrace_dwarf_add':
/localdata/somm_ja/rtems-fortran/rtems-source-builder/rtems/build/sparc-rtems4.12-gcc-6.3.0-newlib-2.5.0-x86_64-linux-gnu-1/build/sparc-rtems4.12/libbacktrace/../../../gcc-6.3.0/libbacktrace/dwarf.c:3030: undefined reference to `__sync_bool_compare_and_swap_4'
collect2: error: ld returned 1 exit status
Makefile:627: recipe for target 'ticker.exe' failed
make: *** [ticker.exe] Error 1

Best regards,

   Jan


Deutsches Zentrum für Luft- und Raumfahrt e. V. (DLR)
German Aerospace Center
Simulation and Software Technology | Software for Space Systems and Interactive Visualization | Lilienthalplatz 7 | 38108 Braunschweig | Germany

Jan Sommer
Telephone +49 531 295-2494 | Telefax 0531 295-2767 | jan.sommer@dlr.de
DLR.de/SC


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

end of thread, other threads:[~2017-03-03 12:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-27 15:55 __sync_-builtins cause undefined references on some sparc targets Jan.Sommer
2017-02-27 21:08 ` Eric Botcazou
2017-02-27 21:14   ` Jan Sommer
2017-02-27 21:29     ` Eric Botcazou
2017-03-03 12:07       ` Jan.Sommer
2017-03-03 12:23         ` Eric Botcazou
2017-03-03 12:35           ` Sebastian Huber

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).