pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: at-spi2-core / _XOPEN_SOURCE



Patrick Welche <prlw1%welche.eu@localhost> writes:

> On -current/amd64, at-spi2-core is failing to build for me (with HAVE_GCC=14):
>
> ../atspi/atspi-event-listener.c: In function 'should_filter_window_events':
> ../atspi/atspi-event-listener.c:1039:3: error: implicit declaration of function 'timersub' [-Wimplicit-function-declaration]
>  1039 |   timersub (&cur_time, &window_filter_time, &elapsed_time);
>
> This is because it sets _XOPEN_SOURCE=700 (and _GNU_SOURCE) so
> <sys/featuretest.h> doesn't set _NETBSD_SOURCE, so once atspi includes
> <sys/time.h>, the timersub definition is not available.
>
> What is the "correct" solution?

Upstream is buggy and should be fixed.

When upstream sets _XOPEN_SOURCE=700 and _GNU_SOURCE, it is explicitly
asking that anything not required by XOPEN at level 700 be hidden.

It seems that timeradd is not specified by POSIX, so it's correct that
it's hidden.  Upstream adding _GNU_SOURCE is a workaround to restore a
big pile of GNU/glibc/Linuxy things (I've never been clear on how the
various bits of code in Linux relate).

Probably, it's a bug for upstream to define _XOPEN_SOURCE=700 in the
first place.  This seems to be added because a small number of platforms
don't conform to recent POSIX by default.  I believe the appropriate
courses of action for an upstream are one of:

  Define _XOPEN_SOURCE=700 (for POSIX 2008) and *only use* faclities
  that are required by POSIX 2008.  No Linux, GNU, or BSD extensions.

  Don't define any visibility defines.   If a platform is found that
  doesn't expose something required by POSIX and needed by default,
  then ifdef on that platform and define what needs to be defined,
  without imposing any of this on other platforms.

> In pkgsrc, define _NETBSD_SOURCE if OS = NetBSD ?

I have previously just patched out visibility defines as a bug.

If you add that, would be good to file it upsteam and add the URL in a
comment as this is basically a patch.  While it's good to fix things in
pkgsrc, I think it's good for upstream release to build on NetBSD
straightforwardly, and for upstreams to become aware of bugs.


Home | Main Index | Thread Index | Old Index