Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 712582 - sys-fs/zerofree-1.1.1 : /.../ext2fs.h: error: unknown type name dev_t
Summary: sys-fs/zerofree-1.1.1 : /.../ext2fs.h: error: unknown type name dev_t
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Joshua Kinard
Keywords: PATCH
Depends on:
Blocks: missing-musl-includes
  Show dependency tree
Reported: 2020-03-14 22:31 UTC by Toralf Förster
Modified: 2020-11-11 22:01 UTC (History)
1 user (show)

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

emerge-info.txt (emerge-info.txt,15.40 KB, text/plain)
2020-03-14 22:31 UTC, Toralf Förster
emerge-history.txt (emerge-history.txt,89.55 KB, text/plain)
2020-03-14 22:31 UTC, Toralf Förster
environment (environment,53.38 KB, text/plain)
2020-03-14 22:31 UTC, Toralf Förster
etc.portage.tbz2 (etc.portage.tbz2,11.72 KB, application/x-bzip)
2020-03-14 22:31 UTC, Toralf Förster
sys-fs:zerofree-1.1.1:20200314-215947.log (sys-fs:zerofree-1.1.1:20200314-215947.log,2.20 KB, text/plain)
2020-03-14 22:31 UTC, Toralf Förster
temp.tbz2 (temp.tbz2,14.16 KB, application/x-bzip)
2020-03-14 22:31 UTC, Toralf Förster
include sys/types.h (types.patch,284 bytes, patch)
2020-03-17 01:03 UTC, Jory A. Pratt
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-14 22:31:40 UTC
x86_64-gentoo-linux-musl-gcc -O2 -pipe -march=native -fno-common -falign-functions=32:25:16 -O2 -pipe -march=native -fno-common -falign-functions=32:25:16 -Wl,-O1 -Wl,--as-needed -o zerofree zerofree.c  -lext2fs
In file included from zerofree.c:20:
/usr/include/ext2fs/ext2fs.h:1360:39: error: unknown type name dev_t; did you mean div_t?
 1360 | extern char *ext2fs_find_block_device(dev_t device);
      |                                       ^~~~~
      |                                       div_t


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


gcc-config -l:
 [1] x86_64-gentoo-linux-musl-9.2.0 *
 [2] 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
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 *
The following VMs are available for generation-2:

==> /var/db/repos/gentoo/metadata/timestamp.chk <==
Sat, 14 Mar 2020 20:38:58 +0000
emerge -qpvO sys-fs/zerofree
[ebuild  N    ] sys-fs/zerofree-1.1.1
Comment 1 Toralf Förster gentoo-dev 2020-03-14 22:31:42 UTC
Created attachment 619228 [details]
Comment 2 Toralf Förster gentoo-dev 2020-03-14 22:31:45 UTC
Created attachment 619230 [details]
Comment 3 Toralf Förster gentoo-dev 2020-03-14 22:31:48 UTC
Created attachment 619232 [details]
Comment 4 Toralf Förster gentoo-dev 2020-03-14 22:31:51 UTC
Created attachment 619234 [details]
Comment 5 Toralf Förster gentoo-dev 2020-03-14 22:31:54 UTC
Created attachment 619236 [details]
Comment 6 Toralf Förster gentoo-dev 2020-03-14 22:31:57 UTC
Created attachment 619238 [details]
Comment 7 Toralf Förster gentoo-dev 2020-03-16 16:12:19 UTC
The first attempt to tinderbox a musl image failed at all.

I'll mass close therefore all filed bug reports of the last days related to this tinderbox image.

Please feel free to re-open if you think that the bug is real in musl and not fixed by the musl overlay.
Comment 8 Joshua Kinard gentoo-dev 2020-03-17 00:32:26 UTC
Actually, this might actually be a thing.  <sys/types.h> needs to be included in the right place:

See here:

And this looks like a code snippet that might fix:

Won't have time to test for a good while, though.  IF you can check it on your tinderbox, let me know.
Comment 9 Jory A. Pratt gentoo-dev 2020-03-17 01:03:39 UTC
Created attachment 620732 [details, diff]
include sys/types.h

Here is the proper patch, you do not need to ifndef the header, it should have been included for proper posix compliance.
Comment 10 Larry the Git Cow gentoo-dev 2020-11-11 22:01:08 UTC
The bug has been closed via the following commit(s):

commit 9d92a6f0bddaa8cb87fbad32caa69b9089905f55
Author:     Joshua Kinard <>
AuthorDate: 2020-11-11 21:59:25 +0000
Commit:     Joshua Kinard <>
CommitDate: 2020-11-11 22:00:46 +0000

    sys-fs/zerofree: Fix musl compile error
    Added a patch to fix a compile error in musl environments and remove
    the older 1.0.4 ebuild.
    Signed-off-by: Joshua Kinard <>
    Package-Manager: Portage-3.0.9, Repoman-3.0.2

 sys-fs/zerofree/Manifest                           |  1 -
 .../files/zerofree-include-sys_types.patch         | 10 +++++++
 sys-fs/zerofree/zerofree-1.0.4.ebuild              | 35 ----------------------
 sys-fs/zerofree/zerofree-1.1.1.ebuild              |  5 ++++
 4 files changed, 15 insertions(+), 36 deletions(-)