RE: __sync_-builtins cause undefined references on some sparc targets

2017-03-03 Thread Jan.Sommer

> -Original Message-
> From: gcc-ow...@gcc.gnu.org [mailto:gcc-ow...@gcc.gnu.org] On Behalf Of
> Eric Botcazou
> Sent: Monday, February 27, 2017 10:30 PM
> To: Jan Sommer
> Cc: gcc@gcc.gnu.org; de...@rtems.org
> Subject: Re: __sync_-builtins cause undefined references on some sparc targets
> 
> > Is there an easy way to remove the libbacktrace dependency?
> > Might something like that work?:
> > https://patchwork.ozlabs.org/patch/553017/
> 
> Yes, even better, simply arrange for the __sync and __atomic support tests of
> libbacktrace to fail on your target, possibly by using the same trick as HPUX.

Ok. I set libbacktrace_cv_sys_sync=no for my target and the undefined 
referenced disappeared.
However I am not sure I understand what that means now.
Is libbacktrace excluded from the build, or is it build but broken?

Cheers,

   Jan


> 
> --
> Eric Botcazou


Re: __sync_-builtins cause undefined references on some sparc targets

2017-03-03 Thread Eric Botcazou
> Is libbacktrace excluded from the build, or is it build but broken?

Neither, it's presumably falls back to __atomic.  No big deal in any case, 
since you'll presumably never use libbacktrace in practice.

-- 
Eric Botcazou


Re: __sync_-builtins cause undefined references on some sparc targets

2017-03-03 Thread Sebastian Huber

On 03/03/17 13:23, Eric Botcazou wrote:

Is libbacktrace excluded from the build, or is it build but broken?

Neither, it's presumably falls back to __atomic.  No big deal in any case,
since you'll presumably never use libbacktrace in practice.



We have (libgcc/config/gthr-rtems.h)

static inline int
__gthread_active_p (void)
{
  return 1;
}

and (libgfortran/runtime/backtrace.c)

void
show_backtrace (bool in_signal_handler)
{
  struct backtrace_state *lbstate;
  struct mystate state = { 0, false, in_signal_handler };

  lbstate = backtrace_create_state (NULL, __gthread_active_p (),
error_callback, NULL);

and (libgfortran/runtime/backtrace.c)

struct backtrace_state *
backtrace_create_state (const char *filename, int threaded,
backtrace_error_callback error_callback,
void *data)
{
  struct backtrace_state init_state;
  struct backtrace_state *state;

#ifndef HAVE_SYNC_FUNCTIONS
  if (threaded)
{
  error_callback (data, "backtrace library does not support 
threads", 0);

  return NULL;
}
#endif

So, I doubt this works for RTEMS.

I guess libgfortran needs an option to be a bit less verbose on some 
targets.


--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.