Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 690486 - =sys-apps/iproute2-5.2.0 fails to build on musl profile: devlink.c:28:10: fatal error: sys/queue.h: No such file or directory
Summary: =sys-apps/iproute2-5.2.0 fails to build on musl profile: devlink.c:28:10: fat...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2019-07-23 06:51 UTC by Sergei Trofimovich (RETIRED)
Modified: 2019-09-25 14:01 UTC (History)
3 users (show)

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


Attachments
sys-apps-iproute2-5.2.0-build.log (sys-apps-iproute2-5.2.0-build.log,138.45 KB, text/x-log)
2019-07-23 06:53 UTC, Sergei Trofimovich (RETIRED)
Details
0001-devlink-use-sys-queue.h-from-libbsd-as-a-fallback.patch (0001-devlink-use-sys-queue.h-from-libbsd-as-a-fallback.patch,2.45 KB, patch)
2019-07-24 08:20 UTC, Sergei Trofimovich (RETIRED)
Details | Diff
v2-0001-iproute2-devlink-port-from-sys-queue.h-to-list.h.patch (v2-0001-iproute2-devlink-port-from-sys-queue.h-to-list.h.patch,2.46 KB, patch)
2019-07-26 22:18 UTC, Sergei Trofimovich (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Trofimovich (RETIRED) gentoo-dev 2019-07-23 06:51:38 UTC
x86_64-gentoo-linux-musl-gcc -Wall -Wstrict-prototypes  -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wformat=2 -O2 -pipe -fdiagnostics-show-option -frecord-gcc-switches -g  -pipe -I../include -I../include/uapi -DRESOLVE_HOSTNAMES -DLIBDIR=\"/lib\" -DCONFDIR=\"/etc/iproute2\" -DNETNS_RUN_DIR=\"/var/run/netns\" -DNETNS_ETC_DIR=\"/etc/netns\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -O2 -pipe -fdiagnostics-show-option -frecord-gcc-switches -g -DHAVE_SETNS -DHAVE_LIBMNL   -c -o devlink.o devlink.c
x86_64-gentoo-linux-musl-gcc -Wall -Wstrict-prototypes  -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wformat=2 -O2 -pipe -fdiagnostics-show-option -frecord-gcc-switches -g  -pipe -I../include -I../include/uapi -DRESOLVE_HOSTNAMES -DLIBDIR=\"/lib\" -DCONFDIR=\"/etc/iproute2\" -DNETNS_RUN_DIR=\"/var/run/netns\" -DNETNS_ETC_DIR=\"/etc/netns\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -O2 -pipe -fdiagnostics-show-option -frecord-gcc-switches -g -DHAVE_SETNS -DHAVE_LIBMNL   -c -o mnlg.o mnlg.c
devlink.c:28:10: fatal error: sys/queue.h: No such file or directory
   28 | #include <sys/queue.h>
      |          ^~~~~~~~~~~~~
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2019-07-23 06:52:24 UTC
Portage 2.3.69 (python 3.6.9-final-0, default/linux/amd64/17.0/musl, gcc-9.1.0, musl-1.1.23, 5.2.0-rc5 x86_64)
=================================================================
System uname: Linux-5.2.0-rc5-x86_64-Intel-R-_Core-TM-_i7-2700K_CPU_@_3.50GHz-with-gentoo-2.6
KiB Mem:    31803904 total,   7044424 free
KiB Swap:          0 total,         0 free
sh bash 5.0_p7
ld GNU ld (Gentoo 2.31.1 p5) 2.31.1
ccache version 3.7.2 [enabled]
app-shells/bash:          5.0_p7::gentoo
dev-lang/perl:            5.30.0::gentoo
dev-lang/python:          2.7.16::gentoo, 3.4.8-r1::gentoo, 3.6.9::gentoo, 3.7.0::gentoo
dev-util/ccache:          3.7.2::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.41.2::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.69-r4::gentoo
sys-devel/automake:       1.13.4-r2::gentoo, 1.15.1-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.28-r2::gentoo, 2.31.1-r3::gentoo, 2.32-r1::gentoo
sys-devel/gcc:            8.2.0-r6::gentoo, 9.1.0-r1::gentoo
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: 5.1::gentoo (virtual/os-headers)
sys-libs/musl:            1.1.23::gentoo
Repositories:

gentoo
    location: /bound/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-gentoo-linux-musl"
CFLAGS="-O2 -pipe -fdiagnostics-show-option -frecord-gcc-switches -g"
CHOST="x86_64-gentoo-linux-musl"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
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 -pipe -g"
DISTDIR="/bound/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 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms splitdebug strict stricter test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://192.168.1.250 http://distfiles.gentoo.org"
INSTALL_MASK="charset.alias"
LANG="ru_RU.UTF-8"
LC_ALL=""
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j8"
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="/dev/shm"
USE="acl amd64 bindist bzip2 cli crypt cxx dri fortran iconv ipv6 libtirpc mmx ncurses nls nptl openmp pam pcre readline seccomp split-usr sse sse2 ssl tcpd test unicode xattr zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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" CPU_FLAGS_X86="mmx mmxext sse sse2" 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="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy 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, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2019-07-23 06:53:58 UTC
Created attachment 584150 [details]
sys-apps-iproute2-5.2.0-build.log
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2019-07-23 06:56:00 UTC
Last successfully installable version was 5.0.0:

# qlop -muv iproute2
2019-03-24T20:32:22 >>> sys-apps/iproute2-5.0.0
Comment 4 Michael 'veremitz' Everitt 2019-07-23 07:03:39 UTC
Does the version in ::musl fix it for you?

https://gitweb.gentoo.org/proj/musl.git/tree/sys-apps/iproute2

Needs a ver-bump, granted ...
Comment 5 Michael 'veremitz' Everitt 2019-07-23 13:19:31 UTC
Appears to be fixed via https://github.com/void-linux/void-packages/blob/master/srcpkgs/iproute2/patches/musl.patch

As supplied in #musl on Freenode IRC.
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2019-07-23 22:36:09 UTC
(In reply to Michael 'veremitz' Everitt from comment #4)
> Does the version in ::musl fix it for you?
> 
> https://gitweb.gentoo.org/proj/musl.git/tree/sys-apps/iproute2
> 
> Needs a ver-bump, granted ...

I don't see how that patch can help. sys/queue.h comes from libbsd. iproute2 does not use that on linux, but could.
Comment 7 Michael 'veremitz' Everitt 2019-07-23 23:58:59 UTC
(In reply to Sergei Trofimovich from comment #6)
> 
> I don't see how that patch can help. sys/queue.h comes from libbsd. iproute2
> does not use that on linux, but could.

Are you proposing a dependency on dev-libs/libbsd ?? Does this have any [undesirable] side-effects?
Comment 8 Michael 'veremitz' Everitt 2019-07-24 01:22:30 UTC
Looks like Adelie linux are using 'bsd-compat-headers' also .. https://code.foxkit.us/adelie/packages/blob/master/system/iproute2/APKBUILD#L13
Comment 9 Michael 'veremitz' Everitt 2019-07-24 01:28:40 UTC
The other [obvious] option is sys-libs/queue-standalone ...
Comment 10 Sergei Trofimovich (RETIRED) gentoo-dev 2019-07-24 06:37:27 UTC
(In reply to Michael 'veremitz' Everitt from comment #7)
> (In reply to Sergei Trofimovich from comment #6)
> > 
> > I don't see how that patch can help. sys/queue.h comes from libbsd. iproute2
> > does not use that on linux, but could.
> 
> Are you proposing a dependency on dev-libs/libbsd ?? Does this have any
> [undesirable] side-effects?

You might want to look at the actual ebuild we are talking about here:
    https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-apps/iproute2/iproute2-5.2.0.ebuild#n26

    RDEPEND="
        ...
        dev-libs/libbsd

And the ./configure file in original iproute2 tarball:
    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/tree/configure#n288

    check_strlcpy()
    {
    ....
    	if ${PKG_CONFIG} libbsd --exists; then
		echo 'CFLAGS += -DHAVE_LIBBSD' `${PKG_CONFIG} libbsd --cflags` >>$CONFIG
		echo 'LDLIBS +=' `${PKG_CONFIG} libbsd --libs` >> $CONFIG
		echo "no"
Comment 11 Sergei Trofimovich (RETIRED) gentoo-dev 2019-07-24 08:20:13 UTC
Created attachment 584284 [details, diff]
0001-devlink-use-sys-queue.h-from-libbsd-as-a-fallback.patch

Sent example patch upstream as https://lore.kernel.org/netdev/20190724081838.18198-1-slyfox@gentoo.org/T/#u
Comment 12 Jory A. Pratt gentoo-dev 2019-07-25 00:25:52 UTC
(In reply to Sergei Trofimovich from comment #11)
> Created attachment 584284 [details, diff] [details, diff]
> 0001-devlink-use-sys-queue.h-from-libbsd-as-a-fallback.patch
> 
> Sent example patch upstream as
> https://lore.kernel.org/netdev/20190724081838.18198-1-slyfox@gentoo.org/T/#u

this is wrong approach IMO.

sys-libs/queue-standalone-0.1-r1

This is your dep your missing.
Comment 13 Sergei Trofimovich (RETIRED) gentoo-dev 2019-07-25 06:33:34 UTC
(In reply to Jory A. Pratt from comment #12)
> (In reply to Sergei Trofimovich from comment #11)
> > Created attachment 584284 [details, diff] [details, diff] [details, diff]
> > 0001-devlink-use-sys-queue.h-from-libbsd-as-a-fallback.patch
> > 
> > Sent example patch upstream as
> > https://lore.kernel.org/netdev/20190724081838.18198-1-slyfox@gentoo.org/T/#u
> 
> this is wrong approach IMO.
> 
> sys-libs/queue-standalone-0.1-r1
> 
> This is your dep your missing.

I'm confused. sys-libs/queue-standalone-0.1-r1 is a header ripped directly from glibc. I'd like a solution that does not have to be carried downstream.
Comment 14 Sergei Trofimovich (RETIRED) gentoo-dev 2019-07-26 22:18:43 UTC
Created attachment 584756 [details, diff]
v2-0001-iproute2-devlink-port-from-sys-queue.h-to-list.h.patch

Upstream applied the following version of the patch:
    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=33267017faf1a188d1286f5c423454a060517e39
Comment 15 Sergei Trofimovich (RETIRED) gentoo-dev 2019-09-13 07:24:02 UTC
Comment on attachment 584756 [details, diff]
v2-0001-iproute2-devlink-port-from-sys-queue.h-to-list.h.patch

Obsoleting the patch as it had a flaw which was fixed in follow-up upstream commits.
Comment 16 Larry the Git Cow gentoo-dev 2019-09-25 14:01:26 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=07866a257c4ddf91baf828c5a02ac977d67ea855

commit 07866a257c4ddf91baf828c5a02ac977d67ea855
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2019-09-25 13:59:34 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2019-09-25 13:59:47 +0000

    sys-apps/iproute2: fix build on musl
    
    Closes: https://bugs.gentoo.org/690486
    Package-Manager: Portage-2.3.76, Repoman-2.3.17
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 .../iproute2-5.2.0-fix-sys-queue-h-on-musl.patch   | 83 ++++++++++++++++++++++
 sys-apps/iproute2/iproute2-5.2.0-r1.ebuild         |  1 +
 2 files changed, 84 insertions(+)