Created attachment 444880 [details] build.log media-libs/libpng-1.6.25 fails to build on amd64-fbsd. 1.6.24 builds fine. A Google search suggests that #define __BSD_VISIBLE 1 is needed somewhere. x86_64-gentoo-freebsd10.3-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/media-libs/libpng-1.6.25/work/libpng-1.6.25 -D__BSD_VISIBLE=1 -O2 -pipe -march=btver1 -c -o contrib/tools/pngcp.o /var/tmp/portage/media-libs/libpng-1.6.25/work/libpng-1.6.25/contrib/tools/pngcp.c In file included from /usr/include/zconf.h:452:0, from /usr/include/zlib.h:34, from /var/tmp/portage/media-libs/libpng-1.6.25/work/libpng-1.6.25/pngtest.c:82: /usr/include/unistd.h:576:27: error: unknown type name ‘u_long’ int strtofflags(char **, u_long *, u_long *); ^ /usr/include/unistd.h:576:37: error: unknown type name ‘u_long’ int strtofflags(char **, u_long *, u_long *); ^ gmake[1]: *** [Makefile:1122: pngtest.o] Error 1 # emerge --info Portage 2.3.0 (python 3.4.5-final-0, default/bsd/fbsd/amd64/10.3, gcc-5.4.0, freebsd-lib-10.3-r1, 10.3-r4-Gentoo amd64) ================================================================= System uname: FreeBSD-10.3-r4-Gentoo-amd64-64bit-ELF KiB Mem: 3883016 total KiB Swap: 8388608 total Timestamp of repository gentoo: Fri, 02 Sep 2016 14:15:01 +0000 sh sh ld GNU ld (Gentoo 2.26.1 p1.0) 2.26.1 app-shells/bash: 4.3_p46::gentoo dev-lang/perl: 5.24.0-r1::gentoo dev-lang/python: 2.7.12::gentoo, 3.4.5::gentoo dev-util/cmake: 3.6.1::gentoo dev-util/pkgconfig: 0.29.1::gentoo sys-apps/baselayout: 2.2-r1::gentoo sys-apps/openrc: 0.21.4::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69-r2::gentoo sys-devel/automake: 1.14.1-r1::gentoo, 1.15-r2::gentoo sys-devel/binutils: 2.25.1-r1::gentoo, 2.26.1::gentoo sys-devel/gcc: 4.9.3::gentoo, 5.4.0::gentoo sys-devel/gcc-config: 1.8-r1::gentoo sys-devel/libtool: 2.4.6-r2::gentoo sys-devel/make: 4.2.1::gentoo sys-freebsd/freebsd-lib: 10.3-r1::gentoo (virtual/os-headers) Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.de.gentoo.org/gentoo-portage priority: -1000 local location: /usr/local/portage masters: gentoo priority: 0 ACCEPT_KEYWORDS="amd64-fbsd ~amd64-fbsd" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-gentoo-freebsd10.3" CFLAGS="-O2 -pipe -march=btver1" CHOST="x86_64-gentoo-freebsd10.3" CONFIG_PROTECT="/boot/device.hints /etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo" CXXFLAGS="-O2 -pipe -march=btver1" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs chflags config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersync" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://ftp.spline.inf.fu-berlin.de/mirrors/gentoo/" INSTALL_MASK="/usr/lib/systemd" LANG="en_GB.UTF-8" LDFLAGS="" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" USE="X a52 aac acl acpi amd64-fbsd berkdb bluetooth branding cairo cdda cdr consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode exif fam firefox flac gdbm gif glamor gstreamer gtk iconv ipv6 jpeg lcms libnotify mad mmx mmxext mng modules mp3 mp4 mpeg multilib ncurses nls ogg opengl oss pam pango pcre pdf png ppds python2 qt3support qt4 readline sdl spell sse sse2 ssl startup-notification svg tcpd tiff truetype udisks unicode upower usb vorbis webp wxwidgets x264 xattr xcb xml xv xvid zfs zlib" ABI_X86="64" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext popcnt sse sse2 sse3 ssse3 sse4a" ELIBC="FreeBSD" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse" KERNEL="FreeBSD" L10N="de en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby23" USERLAND="BSD" VIDEO_CARDS="radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
http://lists.freebsd.org/pipermail/freebsd-standards/2004-March/000474.html says that __BSD_VISIBLE is some implementation detail and should not be used by applications. I don't see any __BSD_VISIBLE in the libpng tarball, it also does not appear in the ebuild. Why is it then on the command line? sys-freebsd/freebsd-lib/files/freebsd-lib-7.1-types.h-fix.patch also looks relevant.
Created attachment 444996 [details] build.log I added -D__BSD_VISIBLE to CPPFLAGS to see whether it would change anything, and forgot to remove it. The problem exists without that flag too.
Backing out this change from sys-freebsd/freebsd-lib makes libpng compile. Thanks for the pointer.
I confirmed the issue. I'll open Pull Request to remove ${PN}-7.1-types.h-fix.patch in a few days.
emerge -e @world completed... I think no problem drop this patch. I opened PR, please see See Also URL.
commit 33e94eb4f087951e0edda7402095f02c56db08f2 (HEAD -> master, origin/master, origin/HEAD) Author: Yuta Satoh <nigoro.dev@gmail.com> AuthorDate: Wed Sep 7 21:26:24 2016 +0900 Commit: Patrice Clement <monsieurp@gentoo.org> CommitDate: Wed Sep 7 17:36:06 2016 +0200 sys-freebsd/freebsd-sources: Drop freebsd-sources-7.1-types.h-fix.patch. Gentoo-Bug: https://bugs.gentoo.org/592776 Closes: https://github.com/gentoo/gentoo/pull/2270 Signed-off-by: Patrice Clement <monsieurp@gentoo.org> sys-freebsd/freebsd-lib/freebsd-lib-10.3-r1.ebuild | 648 --------------------- sys-freebsd/freebsd-lib/freebsd-lib-10.3-r2.ebuild | 647 ++++++++++++++++++++ .../freebsd-sources/freebsd-sources-10.3-r4.ebuild | 175 ------ .../freebsd-sources/freebsd-sources-10.3-r5.ebuild | 174 ++++++ 4 files changed, 821 insertions(+), 823 deletions(-) delete mode 100644 sys-freebsd/freebsd-lib/freebsd-lib-10.3-r1.ebuild create mode 100644 sys-freebsd/freebsd-lib/freebsd-lib-10.3-r2.ebuild delete mode 100644 sys-freebsd/freebsd-sources/freebsd-sources-10.3-r4.ebuild create mode 100644 sys-freebsd/freebsd-sources/freebsd-sources-10.3-r5.ebuild Commited to the tree. Thanks!