After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 791608 - Cannot build at-spi2-core with meson on FreeBSD because of -D_POSIX_C_SOURCE
Cannot build at-spi2-core with meson on FreeBSD because of -D_POSIX_C_SOURCE
Status: RESOLVED FIXED
Product: at-spi
Classification: Platform
Component: at-spi2-core
unspecified
Other FreeBSD
: Normal normal
: ---
Assigned To: At-spi maintainer(s)
At-spi maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-12-14 12:10 UTC by Ting-Wei Lan
Modified: 2018-03-03 17:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
meson: Specify version when defining _POSIX_C_SOURCE (1.03 KB, patch)
2017-12-14 12:13 UTC, Ting-Wei Lan
committed Details | Review

Description Ting-Wei Lan 2017-12-14 12:10:50 UTC
Using -D_POSIX_C_SOURCE on FreeBSD means POSIX 1003.1-1988 with pre-C89 environment, which hides va_copy in C99 and causes linking error:

[1/52] Compiling C object 'dbind/dbind@sta/dbind.c.o'.
../../source/at-spi2-core/dbind/dbind.c:58:3: warning: implicit declaration of function 'gettimeofday' is invalid in C99 [-Wimplicit-function-declaration]
  gettimeofday (&tv, NULL);
  ^
../../source/at-spi2-core/dbind/dbind.c:144:3: warning: implicit declaration of function 'va_copy' is invalid in C99 [-Wimplicit-function-declaration]
  va_copy (args_demarshal, args);
  ^
2 warnings generated.
[6/52] Linking target dbind/dbind-test.
FAILED: dbind/dbind-test
clang  -o dbind/dbind-test 'dbind/dbind-test@exe/dbtest.c.o' 'dbind/dbind-test@exe/.._atspi_atspi-gmain.c.o' -L/home/lantw44/gnome/devinstall/lib -L/usr/local/lib -Wl,--no-undefined -Wl,--as-needed -march=corei7 -B/home/lantw44/.local/bin -pipe -g3 -O0 -Wl,--start-group dbind/libdbind.a -L/usr/local/lib -ldbus-1 -L/home/lantw44/gnome/devinstall/lib -lglib-2.0 -lintl -Wl,--end-group -L/usr/local/lib -ldbus-1 -L/home/lantw44/gnome/devinstall/lib -lglib-2.0 -lintl
dbind/libdbind.a(dbind.c.o): In function `dbind_method_call_reentrant_va':
/home/lantw44/gnome/build/at-spi2-core/../../source/at-spi2-core/dbind/dbind.c:144: undefined reference to `va_copy'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 1 Ting-Wei Lan 2017-12-14 12:13:46 UTC
Created attachment 365530 [details] [review]
meson: Specify version when defining _POSIX_C_SOURCE

FreeBSD libc assumes defining _POSIX_C_SOURCE without specifying a
version means a pre-C89 environment with the oldest version of POSIX
standard, IEEE Std 1003.1-1988, causing va_copy in C99 to be hidden.
To resolve this problem, simply provide a version number when
defining _POSIX_C_SOURCE.
Comment 2 Ting-Wei Lan 2018-03-01 17:22:26 UTC
Ping ... at-spi2-core still fails to build on FreeBSD because of this problem.
Comment 3 Mike Gorse 2018-03-03 17:26:39 UTC
Thanks for the patch. Pushed to master as commit ef43d2