Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 951911 - sys-libs/gdbm-1.25[musl]: unknown type name 'ssize_t'
Summary: sys-libs/gdbm-1.25[musl]: unknown type name 'ssize_t'
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2025-03-23 12:51 UTC by Holger Hoffstätte
Modified: 2025-03-25 03:45 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Hoffstätte 2025-03-23 12:51:48 UTC
Sorry to be the bearer of bad news right after the bump, but I was trying to update my musl chroot and got the following:

x86_64-pc-linux-musl-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/sys-libs/gdbm-1.25/work/gdbm-1.25/tools -I..  -DLOCALEDIR=\"/usr/share/locale\" -I/var/tmp/portage/sys-libs/gdbm-1.25/work/gdbm-1.25/src -I../src -I/var/tmp/portage/sys-libs/gdbm-1.25/work/gdbm-1.25/tools    -pipe -march=sandybridge -O2 -c -o wordwrap.o /var/tmp/portage/sys-libs/gdbm-1.25/work/gdbm-1.25/tools/wordwrap.c
In file included from /var/tmp/portage/sys-libs/gdbm-1.25/work/gdbm-1.25/tools/wordwrap.c:18:
/var/tmp/portage/sys-libs/gdbm-1.25/work/gdbm-1.25/tools/gdbmapp.h:74:30: error: unknown type name 'ssize_t'; did you mean 'size_t'?
   74 |                              ssize_t (*writer) (void *, const char *, size_t),
      |                              ^~~~~~~
      |                              size_t


Reproducible: Always

Steps to Reproduce:
1. try to emerge gdbm-1.25 on musl
2. failure
Comment 1 Holger Hoffstätte 2025-03-23 13:05:41 UTC
Tried to figure out where ssize_t has gone and apparently musl guards it behind a __NEED_ssize_t ifdef in /usr/include/bits/alltypes.h:

#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
typedef _Addr ssize_t;
#define __DEFINED_ssize_t
#endif

and _Addr was previously defined as long.

So I jammed a __NEED_ssize_t into the generated autoconf.h, after which it built and passed "make check".
Comment 2 Holger Hoffstätte 2025-03-24 07:42:55 UTC
Turns out the __NEED_ macros are in <sys/types.h> (because of course they are) and upstream has committed a fix at:

https://git.gnu.org.ua/gdbm.git/commit/?id=39ef0347f78ef691c9ad815360198f577043ce4c

I've verified that this fixes the build on musl.
Comment 3 Larry the Git Cow gentoo-dev 2025-03-25 03:45:11 UTC
The bug has been closed via the following commit(s):

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

commit 2f0c92570ad92ea2969b7e07f7d4870f8b7f750f
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-03-25 03:43:47 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-03-25 03:43:47 +0000

    sys-libs/gdbm: fix musl build
    
    Closes: https://bugs.gentoo.org/951911
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-libs/gdbm/files/gdbm-1.25-musl.patch | 22 ++++++++++++++++++++++
 sys-libs/gdbm/gdbm-1.25.ebuild           |  4 ++++
 2 files changed, 26 insertions(+)