Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 951918 - ERROR: sys-libs/gdbm-1.25::gentoo_prefix failed (compile phase)
Summary: ERROR: sys-libs/gdbm-1.25::gentoo_prefix failed (compile phase)
Status: UNCONFIRMED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All OS X
: Normal normal
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
: 952992 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-03-23 15:51 UTC by Askar Bektassov
Modified: 2025-04-01 22:02 UTC (History)
2 users (show)

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


Attachments
emerge --info (emerge.info,5.19 KB, text/plain)
2025-03-23 15:53 UTC, Askar Bektassov
Details
build.log (build.log,883 bytes, application/octet-stream)
2025-03-23 15:53 UTC, Askar Bektassov
Details
proposed patch (lock.c.patch,424 bytes, patch)
2025-03-23 15:56 UTC, Askar Bektassov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Askar Bektassov 2025-03-23 15:51:48 UTC
The function clock_nanosleep() is not available on macOS (it’s POSIX but not implemented in Darwin/macOS). This causes the build to fail when compiling lock.c.

Reproducible: Always

Steps to Reproduce:
emerge gdbm
Actual Results:  
/Users/askarbektassov/Gentoo/var/tmp/portage/sys-libs/gdbm-1.25/work/gdbm-1.25/src/lock.c:294:11: error: implicit declaration of function 'clock_nanosleep' [-Wimplicit-function-declaration]
  294 |       if (clock_nanosleep (CLOCK_REALTIME, 0, iv, &r))
      |           ^~~~~~~~~~~~~~~
make[3]: *** [Makefile:573: lock.lo] Error 1

Expected Results:  
successful compilation

macOS supports the nanosleep() function, which allows for high-resolution sleeping. While nanosleep() doesn’t support all features of clock_nanosleep(), it may serve as a suitable replacement in this specific case
Comment 1 Askar Bektassov 2025-03-23 15:53:06 UTC
Created attachment 922211 [details]
emerge --info
Comment 2 Askar Bektassov 2025-03-23 15:53:40 UTC
Created attachment 922212 [details]
build.log
Comment 3 Askar Bektassov 2025-03-23 15:56:05 UTC
Created attachment 922213 [details, diff]
proposed patch

Refactor clock_nanosleep() as nanosleep() on macOS
Comment 4 Fabian Groffen gentoo-dev 2025-03-23 16:07:42 UTC
Isn't gdbm already using gnulib by chance?
Comment 5 Askar Bektassov 2025-03-23 17:49:58 UTC
No idea. If so, then maybe I screwed something on my system.
Comment 6 Askar Bektassov 2025-03-24 08:27:44 UTC
I checked the ebuild, and it does not seems to rely on the pre-generated configure scripts. It looks like the upstream tarball didn’t include the clock_nanosleep fallback module from gnulib either.

askarbektassov@Askars-MBP ~/Gentoo/var/tmp/portage/sys-libs/gdbm-1.25/work/gdbm-1.25 $ grep -r gnulib
build-aux/ltmain.sh:# <https://github.com/gnulib-modules/bootstrap/issues>
build-aux/ltmain.sh:# <https://github.com/gnulib-modules/bootstrap/issues>
build-aux/config.guess:	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
m4/iconv.m4:  dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
Comment 7 Askar Bektassov 2025-03-24 08:28:33 UTC
(In reply to Askar Bektassov from comment #6)
> I checked the ebuild, and it does not seems to rely on the pre-generated
> configure scripts. It looks like the upstream tarball didn’t include the
> clock_nanosleep fallback module from gnulib either.
> 
> askarbektassov@Askars-MBP
> ~/Gentoo/var/tmp/portage/sys-libs/gdbm-1.25/work/gdbm-1.25 $ grep -r gnulib
> build-aux/ltmain.sh:# <https://github.com/gnulib-modules/bootstrap/issues>
> build-aux/ltmain.sh:# <https://github.com/gnulib-modules/bootstrap/issues>
> build-aux/config.guess:	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
> m4/iconv.m4:  dnl Also substitute ICONV_CONST in the gnulib generated
> <iconv.h>.

sorry, I meant "... and it does ONLY seem to rely..."
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-04-01 22:00:12 UTC
*** Bug 952992 has been marked as a duplicate of this bug. ***
Comment 9 Larry the Git Cow gentoo-dev 2025-04-01 22:02:10 UTC
The bug has been referenced in the following commit(s):

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

commit bce8bb0fcacadb2cf6c57f5ae0f69bf50c99f4e1
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-04-01 22:01:26 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-04-01 22:02:04 +0000

    profiles/prefix/darwin/macos: mask =sys-libs/gdbm-1.25
    
    Workaround for build failure on macOS. Still needs to be reported upstream
    but I don't have a macOS Prefix at the moment to do that, so leaving
    for someone else.
    
    Bug: https://bugs.gentoo.org/951918
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/prefix/darwin/macos/package.mask | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)