Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 690426 - sys-apps/gentoo-functions-0.12: fails to build on musl-1.1.23
Summary: sys-apps/gentoo-functions-0.12: fails to build on musl-1.1.23
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: William Hubbs
Depends on:
Blocks: glibc-sysmacros
  Show dependency tree
Reported: 2019-07-22 05:19 UTC by Georgy Yakovlev
Modified: 2020-10-08 02:17 UTC (History)
2 users (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Georgy Yakovlev gentoo-dev 2019-07-22 05:19:30 UTC
A commit landed to musl recently:

TLDR: they no longer #include <sys/sysmacros.h>
in sys/types.h

thus gentoo-functions fails to build on musl-1.1.23


consoletype.c: In function 'check_devnode':
consoletype.c:60:8: warning: implicit declaration of function 'major' [-Wimplicit-function-declaration]
  maj = major(sb.st_rdev);
/usr/lib/gcc/x86_64-gentoo-linux-musl/8.3.0/../../../../x86_64-gentoo-linux-musl/bin/ld: /tmp/portage/sys-apps/gentoo-functions-0.12/temp/ccNhcnoC.o: in function `main':
consoletype.c:(.text.startup+0x15a): undefined reference to `major'
collect2: error: ld returned 1 exit status
make: *** [<builtin>: consoletype] Error 1
Comment 1 Jory A. Pratt gentoo-dev 2019-08-22 02:15:14 UTC
This is only an issue for musl due to the GLIBC define in headers.h. This should be assigned to the maintainers and not the musl team.
Comment 2 Anthony Basile gentoo-dev 2019-08-23 15:43:58 UTC
The correct header to include for the macros major()/minor() is <sys/sysmacros.h>.  This is correct for any libc and I've added the change to gentoo-functions.  See

@WilliamH  Do you want to cut a new release of gentoo-functinos.  I've tested on glibc and older versions of musl.  It doesn't break backward compat and it is needed going forward.
Comment 3 Anthony Basile gentoo-dev 2019-08-24 00:23:13 UTC
I've added the fix to the musl overlay as a stop gap until it hits the main tree:
Comment 4 Larry the Git Cow gentoo-dev 2020-10-08 02:17:25 UTC
The bug has been closed via the following commit(s):

commit 7b05fe46328060611df260888d7aa05d9347eda0
Author:     Georgy Yakovlev <>
AuthorDate: 2020-10-08 02:15:31 +0000
Commit:     Georgy Yakovlev <>
CommitDate: 2020-10-08 02:16:29 +0000

    sys-apps/gentoo-functions: drop, ::gentoo version works fine.
    Signed-off-by: Georgy Yakovlev <>

 sys-apps/gentoo-functions/Manifest                 |  1 -
 .../files/gentoo-functions-sysmacros.patch         | 32 ----------------------
 .../gentoo-functions/gentoo-functions-0.12.ebuild  | 32 ----------------------
 sys-apps/gentoo-functions/metadata.xml             | 21 --------------
 4 files changed, 86 deletions(-)