1 | #warning redirecting incorrect #include <sys/errno.h> to <errno.h> | ^~~~~~~ makehfs.c:40:10: fatal error: sys/sysctl.h: No such file or directory 40 | #include <sys/sysctl.h> | ^~~~~~~~~~~~~~ compilation terminated. ------------------------------------------------------------------- This is an unstable amd64 chroot image at a tinderbox (==build bot) name: 17.0_musl-20200328-141627 ------------------------------------------------------------------- Please see the tracker bug for details. gcc-config -l: [1] x86_64-gentoo-linux-musl-9.3.0 * clang version 10.0.0 Target: x86_64-gentoo-linux-musl Thread model: posix InstalledDir: /usr/lib/llvm/10/bin /usr/lib/llvm/10 10.0.0 Available Python interpreters, in order of preference: [1] python3.8 [2] python3.7 [3] python3.6 [4] python2.7 (fallback) Available Ruby profiles: [1] ruby24 (with Rubygems) [2] ruby25 (with Rubygems) * Available Rust versions: [1] rust-1.42.0 * timestamp of HEAD at this tinderbox image: /var/db/repos/gentoo Thu Apr 2 01:07:42 UTC 2020 /var/db/repos/musl Fri Mar 27 00:25:27 UTC 2020 emerge -qpvO sys-fs/diskdev_cmds [ebuild N ] sys-fs/diskdev_cmds-332.14_p1-r2
Created attachment 628812 [details] emerge-info.txt
Created attachment 628814 [details] emerge-history.txt
Created attachment 628816 [details] environment
Created attachment 628818 [details] etc.portage.tbz2
Created attachment 628820 [details] sys-fs:diskdev_cmds-332.14_p1-r2:20200402-021314.log
Created attachment 628822 [details] temp.tbz2
Can confirm the same error with glibc-2.32.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0e18040d345fe623061142cca2a8e0c43ff332e8 commit 0e18040d345fe623061142cca2a8e0c43ff332e8 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-08-19 20:43:21 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-08-19 20:43:34 +0000 sys-fs/diskdev_cmds: tweak for glibc-2.32 It does not fix build on musl but fixes build on glibc-2.32. Reported-by: Georg Rudoy Bug: https://bugs.gentoo.org/715862 Package-Manager: Portage-3.0.3, Repoman-3.0.0 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> sys-fs/diskdev_cmds/diskdev_cmds-332.14_p1-r3.ebuild | 1 + .../files/diskdev_cmds-332.14_p1-no-sysctl.patch | 12 ++++++++++++ 2 files changed, 13 insertions(+)
Created attachment 680971 [details, diff] fixes musl build This is a straightforward patch 1.) fixing warnings from musl's /usr/include/sys/errno.h 2.) stripping out __P function definitions from glibc's /usr/include/sys/cdefs.h (#define __P(args) args) 3.) #include <sys/types.h> where type u_char is used as far as the build is concerned. In the complete source package far more of this stuff above is lurking around but does not matter for the sole building of fsck_hfs and newfs_hfs. With the patch diskdev_cmds-332.14_p1-r4 builds fine on musl, also the patch does not break the glibc build.
(In reply to ernsteiswuerfel from comment #9) > Created attachment 680971 [details, diff] [details, diff] > fixes musl build > > This is a straightforward patch > 1.) fixing warnings from musl's /usr/include/sys/errno.h > 2.) stripping out __P function definitions from glibc's > /usr/include/sys/cdefs.h (#define __P(args) args) > 3.) #include <sys/types.h> where type u_char is used > > as far as the build is concerned. In the complete source package far more of > this stuff above is lurking around but does not matter for the sole building > of fsck_hfs and newfs_hfs. > > With the patch diskdev_cmds-332.14_p1-r4 builds fine on musl, also the patch > does not break the glibc build. The patch looks reasonable. I wonder if you could make it slightly shorter by using something like: #ifndef __P # __P(x) x #endif at the beginning of each file that uses __P. That way it should be easier to deal with conflicts when porting patch th newer versions if we ever decide to.
(In reply to Sergei Trofimovich from comment #10) > The patch looks reasonable. I wonder if you could make it slightly shorter > by using something like: > > #ifndef __P > # __P(x) x > #endif > > at the beginning of each file that uses __P. That way it should be easier to > deal with conflicts when porting patch th newer versions if we ever decide > to. Ah yes! I used the same wording as glibc's /usr/include/sys/cdefs.h does: #ifndef __P #define __P(args) args #endif And thanks for your very helpful Ebuild hacking tips!
Created attachment 681547 [details, diff] fixes musl build
(In reply to Sergei Trofimovich from comment #10) > at the beginning of each file that uses __P. That way it should be easier to > deal with conflicts when porting patch th newer versions if we ever decide > to. If we ever decide to port a new version here's a nice site to look at the different versions, upstream Apple does not provide: https://github.com/aosm/diskdev_cmds Though some other distribution deciced to stick to a specific version and sorta 'fork' it, not wanting to deal with Apple specifics: https://aur.archlinux.org/packages/hfsprogs/
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1dcb636abf0488aec91b2c22e6279ee53f8c18d4 commit 1dcb636abf0488aec91b2c22e6279ee53f8c18d4 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2021-01-06 21:50:53 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2021-01-06 21:51:33 +0000 sys-fs/diskdev_cmds: adapt to musl Reported-by: Toralf Förster Fixed-by: ernsteiswuerfel Closes: https://bugs.gentoo.org/715862 Package-Manager: Portage-3.0.12, Repoman-3.0.2 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> .../diskdev_cmds/diskdev_cmds-332.14_p1-r4.ebuild | 3 +- .../files/diskdev_cmds-332.14_p1-musl.patch | 79 ++++++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-)
(In reply to ernsteiswuerfel from comment #12) > Created attachment 681547 [details, diff] [details, diff] > fixes musl build Pushed as is. Thank you!