Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 713390 - sys-fs/quota-4.06 : quota.h: fatal error: sys/cdefs.h: No such file or directory
Summary: sys-fs/quota-4.06 : quota.h: fatal error: sys/cdefs.h: No such file or directory
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo musl team
URL: https://sourceforge.net/p/linuxquota/...
Whiteboard: cdefs.h
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2020-03-19 11:11 UTC by Toralf Förster
Modified: 2022-01-13 10:25 UTC (History)
2 users (show)

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


Attachments
emerge-info.txt (emerge-info.txt,16.35 KB, text/plain)
2020-03-19 11:11 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,113.28 KB, text/plain)
2020-03-19 11:11 UTC, Toralf Förster
Details
environment (environment,59.38 KB, text/plain)
2020-03-19 11:11 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,12.55 KB, application/x-bzip)
2020-03-19 11:11 UTC, Toralf Förster
Details
logs.tbz2 (logs.tbz2,7.10 KB, application/x-bzip)
2020-03-19 11:11 UTC, Toralf Förster
Details
sys-fs:quota-4.05-r1:20200319-003313.log (sys-fs:quota-4.05-r1:20200319-003313.log,8.29 KB, text/plain)
2020-03-19 11:11 UTC, Toralf Förster
Details
temp.tbz2 (temp.tbz2,17.92 KB, application/x-bzip)
2020-03-19 11:12 UTC, Toralf Förster
Details
Patch to fix this compilation error (musl.patch,467 bytes, patch)
2021-03-12 10:53 UTC, Marco Rebhan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2020-03-19 11:11:39 UTC
x86_64-gentoo-linux-musl-gcc -DHAVE_CONFIG_H -I.     -O2 -pipe -march=native -fno-common -falign-functions=32:25:16 -Wall -fPIC -I/usr/include/et  -I/usr/include/ext2fs -I/usr/include/et   -c -o quota.o quota.c
In file included from quota.c:28:
quota.h:4:10: fatal error: sys/cdefs.h: No such file or directory
    4 | #include <sys/cdefs.h>
      |          ^~~~~~~~~~~~~
compilation terminated.

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.0_musl-20200316-165821

  -------------------------------------------------------------------

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.41.1 *

repository:
==> /var/db/repos/gentoo/metadata/timestamp.chk <==
Wed, 18 Mar 2020 13:38:27 +0000
emerge -qpvO sys-fs/quota
[ebuild  N    ] sys-fs/quota-4.05-r1  USE="nls tcpd -ldap -netlink -rpc"
Comment 1 Toralf Förster gentoo-dev 2020-03-19 11:11:42 UTC
Created attachment 622248 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2020-03-19 11:11:45 UTC
Created attachment 622250 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2020-03-19 11:11:48 UTC
Created attachment 622252 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2020-03-19 11:11:51 UTC
Created attachment 622254 [details]
etc.portage.tbz2
Comment 5 Toralf Förster gentoo-dev 2020-03-19 11:11:54 UTC
Created attachment 622256 [details]
logs.tbz2
Comment 6 Toralf Förster gentoo-dev 2020-03-19 11:11:57 UTC
Created attachment 622258 [details]
sys-fs:quota-4.05-r1:20200319-003313.log
Comment 7 Toralf Förster gentoo-dev 2020-03-19 11:12:00 UTC
Created attachment 622260 [details]
temp.tbz2
Comment 8 Michael 'veremitz' Everitt 2020-03-19 11:21:05 UTC
musl upstream has a FAQ entry specifically for this error:
https://wiki.musl-libc.org/faq.html#Q:-When-compiling-something-against-musl,-I-get-error-messages-about-%3Ccode%3Esys/cdefs.h%3C/code%3E

We will need to check/report upstream and patch affected code temporarily.
Comment 9 Marco Rebhan 2021-03-12 10:53:39 UTC
Created attachment 690975 [details, diff]
Patch to fix this compilation error

This workaround makes it compile, at least for quota 4.05; with 4.06 you hit another bug unfortunately (implicit declaration of function 'reallocarray') which I have no idea how to fix.
Comment 10 Jory A. Pratt gentoo-dev 2021-03-12 13:19:56 UTC
(In reply to 2xsaiko from comment #9)
> Created attachment 690975 [details, diff] [details, diff]
> Patch to fix this compilation error
> 
> This workaround makes it compile, at least for quota 4.05; with 4.06 you hit
> another bug unfortunately (implicit declaration of function 'reallocarray')
> which I have no idea how to fix.

refer to networkmanager in musl overlay for reallocarray fix.
Comment 11 Marco Rebhan 2021-03-12 13:57:00 UTC
(In reply to Jory A. Pratt from comment #10)
> refer to networkmanager in musl overlay for reallocarray fix.

Unfortunately the way the patch for networkmanager fixed it wasn't possible here, but I figured out what it was: reallocarray only exists since musl 1.2.2 which is ~amd64 only while I (mostly) have stable packages on this box. Updating musl makes it compile without issue.

So quota 4.06 should have a dependency on >=sys-libs/musl-1.2.2 but since it's not compilable because of the cdefs.h error without a patch anyway, I don't know if it makes sense to do that right now.
Comment 12 Agostino Sarubbo gentoo-dev 2022-01-12 11:25:21 UTC
tinderbox_musl has reproduced this issue with version 4.06 - Updating summary.
Comment 14 Larry the Git Cow gentoo-dev 2022-01-13 10:25:37 UTC
The bug has been closed via the following commit(s):

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

commit f4cae72bff7ab14e21f3f73f97308e0b035db769
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-01-13 10:25:21 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-01-13 10:25:28 +0000

    sys-fs/quota: fix build on musl
    
    Closes: https://bugs.gentoo.org/713390
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-fs/quota/files/quota-4.06-musl-cdefs.patch | 20 ++++++++++++++++++++
 sys-fs/quota/quota-4.06.ebuild                 | 18 ++++++++++--------
 2 files changed, 30 insertions(+), 8 deletions(-)