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 786306 - build failure on freebsd
build failure on freebsd
Status: RESOLVED FIXED
Product: gdk-pixbuf
Classification: Platform
Component: general
git master
Other FreeBSD
: Normal blocker
: ---
Assigned To: gdk-pixbuf-maint
gdk-pixbuf-maint
Depends on:
Blocks:
 
 
Reported: 2017-08-15 08:27 UTC by Benoît Dejean
Modified: 2017-10-05 15:42 UTC
See Also:
GNOME target: ---
GNOME version: 3.25/3.26


Attachments
proposed fix for FreeBSD (1.76 KB, patch)
2017-09-20 17:36 UTC, Benoît Dejean
none Details | Review
tests: Fix read-only to mutable on FreeBSD (2.20 KB, patch)
2017-10-05 15:39 UTC, Bastien Nocera
committed Details | Review

Description Benoît Dejean 2017-08-15 08:27:58 UTC
Hello,

on FreeBSD 11.1, with clang 4.0.0, build produces warnings and eventually errors about undeclared <math.h> functions such as lrint or round. _POSIX_C_SOURCE defaults to 199009 on this platform which predates these C99 functions, which are then excluded by the CPP.

So you need to either set a value to _POSIX_C_SOURCE
or you may simply just drop it, with _DEFAULT_SOURCE and may be even the c99 flag (unless you really want to stick to that version and prohibit C11 stuff).
Comment 1 Benoît Dejean 2017-08-20 11:35:12 UTC
Setting _POSIX_C_SOURCE to 200809L would fix the build except for tests/pixbuf-readonly-to-mutable.c because undefined MAP_ANON (easy to replace with a fd to /dev/zero) and undefined _SC_PAGE_SIZE for which I'm not able to find a solution.
Comment 2 Benoît Dejean 2017-09-14 18:05:46 UTC
Hi, this still blocking on 3.26.
Comment 3 Bastien Nocera 2017-09-19 10:17:46 UTC
I'd need a patch to fix this.
Comment 4 Benoît Dejean 2017-09-20 17:36:08 UTC
Created attachment 360145 [details] [review]
proposed fix for FreeBSD

I'm not sure if the question is for me because it's up to the maintainer to chose which standards he wants to stick with, but here's something that works on FreeBSD.

- I bump the POSIX requirement to build everything by bringing in the C99 math functions
- I fix one example by using the correct sysconf argument (Linux man says that it's an alias) and mapping /dev/zero instead of MAP_ANON (I could not find it in any standard supporting thi macro).

Tested only on FreeBSD 11.1 with clang 4.0 (I believe that anyone running clang on linux would also be able to reproduce this):
- build OK
- system-monitor runs fine
Comment 5 Bastien Nocera 2017-10-05 15:39:58 UTC
Created attachment 360970 [details] [review]
tests: Fix read-only to mutable on FreeBSD
Comment 6 Bastien Nocera 2017-10-05 15:42:41 UTC
Attachment 360970 [details] pushed as f133b06 - tests: Fix read-only to mutable on FreeBSD