Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 677746 - dev-libs/libbsd-0.9.1 on musl - src/flopen.c:60:14: error: 'O_CREAT' undeclared
Summary: dev-libs/libbsd-0.9.1 on musl - src/flopen.c:60:14: error: 'O_CREAT' undeclared
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Freedesktop bugs
URL: https://cgit.freedesktop.org/libbsd/c...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-11 19:47 UTC by eroen
Modified: 2019-02-12 23:58 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,18.88 KB, text/plain)
2019-02-11 19:47 UTC, eroen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description eroen 2019-02-11 19:47:28 UTC
Created attachment 564836 [details]
build.log

libtool: compile:  aarch64-linux-musl-gcc -DHAVE_CONFIG_H -I.. -isystem /var/tmp/portage/dev-libs/libbsd-0.9.1/work/libbsd-0.9.1/include/bsd/ -include ../config.h -DLIBBSD_OVERLAY -DLIBBSD_DISABLE_DEPRECATED -D__REENTRANT -O2 -c /var/tmp/portage/dev-libs/libbsd-0.9.1/work/libbsd-0.9.1/src/flopen.c  -fPIC -DPIC -o .libs/flopen.o
/var/tmp/portage/dev-libs/libbsd-0.9.1/work/libbsd-0.9.1/src/flopen.c: In function 'vflopenat':
/var/tmp/portage/dev-libs/libbsd-0.9.1/work/libbsd-0.9.1/src/flopen.c:60:14: error: 'O_CREAT' undeclared (first use in this function); did you mean 'S_IREAD'?
  if (flags & O_CREAT) {
              ^~~~~~~
              S_IREAD
/var/tmp/portage/dev-libs/libbsd-0.9.1/work/libbsd-0.9.1/src/flopen.c:60:14: note: each undeclared identifier is reported only once for each function it appears in
/var/tmp/portage/dev-libs/libbsd-0.9.1/work/libbsd-0.9.1/src/flopen.c:65:21: error: 'O_NONBLOCK' undeclared (first use in this function); did you mean 'ENOTBLK'?
         if (flags & O_NONBLOCK)
                     ^~~~~~~~~~
                     ENOTBLK
/var/tmp/portage/dev-libs/libbsd-0.9.1/work/libbsd-0.9.1/src/flopen.c:68:19: error: 'O_TRUNC' undeclared (first use in this function)
  trunc = (flags & O_TRUNC);
                   ^~~~~~~
/var/tmp/portage/dev-libs/libbsd-0.9.1/work/libbsd-0.9.1/src/flopen.c:72:13: warning: implicit declaration of function 'openat'; did you mean 'flopenat'? [-Wimplicit-function-declaration]
   if ((fd = openat(dirfd, path, flags, mode)) == -1)
             ^~~~~~
             flopenat
/var/tmp/portage/dev-libs/libbsd-0.9.1/work/libbsd-0.9.1/src/flopen.c: In function 'flopen':
/var/tmp/portage/dev-libs/libbsd-0.9.1/work/libbsd-0.9.1/src/flopen.c:130:18: error: 'AT_FDCWD' undeclared (first use in this function)
  ret = vflopenat(AT_FDCWD, path, flags, ap);
                  ^~~~~~~~
make[2]: *** [Makefile:638: flopen.lo] Error 1
make[2]: Leaving directory '/var/tmp/portage/dev-libs/libbsd-0.9.1/work/libbsd-0.9.1-.arm64/src'
make[1]: *** [Makefile:409: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/dev-libs/libbsd-0.9.1/work/libbsd-0.9.1-.arm64'
make: *** [Makefile:341: all] Error 2
 * ERROR: dev-libs/libbsd-0.9.1::gentoo failed (compile phase):
 *   emake failed


This is fixed by an upstream commit:
https://cgit.freedesktop.org/libbsd/commit/src/flopen.c?id=13c32916b4baab58d93940d57fea9ff0777f1931

There is a similar patch in the musl overlay.
Comment 1 eroen 2019-02-11 19:48:54 UTC
localhost /var/log # emerge --info '=dev-libs/libbsd-0.9.1::gentoo'
Portage 2.3.59 (python 3.7.0-final-0, hardened/linux/musl/arm64, gcc-8.2.0, musl-1.1.21, 4.20.3-gentoo aarch64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.20.3-gentoo-aarch64-with-gentoo-2.6
KiB Mem:     2045596 total,    309912 free
KiB Swap:          0 total,         0 free
Timestamp of repository musl: Mon, 11 Feb 2019 12:23:39 +0000
Head commit of repository musl: 485859f56570ef03316513ac8d56f96d08dacf3a

Timestamp of repository gentoo: Mon, 11 Feb 2019 15:00:01 +0000
Head commit of repository gentoo: 43731c08c9e73683b9d59f3fa4735e5f8c1adde4
sh bash 5.0_p2
ld GNU ld (Gentoo 2.31.1 p5) 2.31.1
app-shells/bash:          5.0_p2::gentoo
dev-lang/perl:            5.28.0::gentoo
dev-lang/python:          3.7.0::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.40.3::gentoo
sys-apps/sandbox:         2.13::musl
sys-devel/autoconf:       2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1-r3::gentoo
sys-devel/gcc:            8.2.0-r6::musl
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.20::gentoo (virtual/os-headers)
sys-libs/musl:            1.1.21::gentoo
Repositories:

musl
    location: /var/db/repos/musl
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/musl.git
    masters: gentoo
    priority: 100

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: 200
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: no
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24

ACCEPT_KEYWORDS="arm64 ~arm64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="aarch64-linux-musl"
CFLAGS="-O2"
CHOST="aarch64-linux-musl"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="charset.alias"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j1"
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="arm64 cli crypt cxx dri fortran hardened iconv ipv6 minimal ncurses nptl openmp pic pie readline seccomp ssl ssp unicode xattr" 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="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="musl" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python3_7" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="dummy fbdev v4l" 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, LANG, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

localhost /var/log # emerge -pqv '=dev-libs/libbsd-0.9.1::gentoo'
[ebuild   R   ] dev-libs/libbsd-0.9.1 [0.9.1] USE="-static-libs"
Comment 2 Anthony Basile gentoo-dev 2019-02-12 13:55:46 UTC
(In reply to eroen from comment #0)
> 
> This is fixed by an upstream commit:
> https://cgit.freedesktop.org/libbsd/commit/src/flopen.
> c?id=13c32916b4baab58d93940d57fea9ff0777f1931
> 
> There is a similar patch in the musl overlay.

Correct.  Since its not my package, I didn't add the patch, but if the freedesktop team would let me, I'd be more than happy to add that to the tree.  It relieves some of the pressure on the musl overlay.
Comment 3 Mike Gilbert gentoo-dev 2019-02-12 15:58:12 UTC
(In reply to Anthony Basile from comment #2)
> Correct.  Since its not my package, I didn't add the patch, but if the
> freedesktop team would let me, I'd be more than happy to add that to the
> tree.  It relieves some of the pressure on the musl overlay.

I can't imagine any reasonable objection to back-porting a patch that has been applied upstream. Just do it.

Also, it's helpful if you actually file bug reports about such issues instead of silently fixing them in some overlay any not telling anybody.
Comment 4 Anthony Basile gentoo-dev 2019-02-12 22:57:54 UTC
(In reply to Mike Gilbert from comment #3)
> (In reply to Anthony Basile from comment #2)
> > Correct.  Since its not my package, I didn't add the patch, but if the
> > freedesktop team would let me, I'd be more than happy to add that to the
> > tree.  It relieves some of the pressure on the musl overlay.
> 
> I can't imagine any reasonable objection to back-porting a patch that has
> been applied upstream. Just do it.

When the fix got into the musl overlay, it wasn't yet upstream

> 
> Also, it's helpful if you actually file bug reports about such issues
> instead of silently fixing them in some overlay any not telling anybody.

musl has recently grown in popularity, and I think its time to empty out the overlay and get the fixes in the tree.  A lot of stuff in the overlay went in when musl was not popular and indeed had many issues.  So I'm not disagreeing with you here, but explaining why a lot of these fixes didn't go directly to the tree.
Comment 5 Anthony Basile gentoo-dev 2019-02-12 23:58:51 UTC
okay this is in the tree, and off the overlay.