Bug 280324 - editors/emacs-devel: build failure on current
Summary: editors/emacs-devel: build failure on current
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: emacs@FreeBSD.org (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-17 08:33 UTC by Benjamin Jacobs
Modified: 2024-07-19 00:53 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (emacs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Jacobs 2024-07-17 08:33:06 UTC
Hello,

Without NATIVECOMP, emacs-devel@nox fails to build on a poudriere jail version 15.0-CURRENT 1500020, with this error:


timespec-sub.c:38:12: error: operand argument to checked integer operation must be an integer type other than plain 'char', 'bool', bit-precise, or an enumeration ('bool' invalid)
   38 |   if (v == ckd_sub (&rs, rs, borrow))
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/stdckdint.h:24:37: note: expanded from macro 'ckd_sub'
   24 |         (_Bool)__builtin_sub_overflow((a), (b), (result))
      |                                            ^~~
1 error generated.


This simple patch allows the build to succeed.

--- lib/timespec-sub.c.orig     2024-07-17 08:05:02 UTC
+++ lib/timespec-sub.c
@@ -35,7 +35,7 @@ timespec_sub (struct timespec a, struct timespec b)
   time_t rs;
   int rns;
   bool v = ckd_sub (&rs, a.tv_sec, b.tv_sec);
-  if (v == ckd_sub (&rs, rs, borrow))
+  if (v == ckd_sub (&rs, rs, borrow ? 1 : 0))
     rns = nsdiff + TIMESPEC_HZ * borrow;
   else
     {
Comment 1 Joseph Mingrone freebsd_committer freebsd_triage 2024-07-18 19:55:12 UTC
Thanks for submitting.  After updating my main-tracking poudriere jail, I can now reproduce the issue.  It affects the default 'full' flavor as well.

However, it looks like upstream fixed the problem in 831539542f90c2844418c8b0657f4c050a3d9dfb.

I'll update the port to a recent upstream snapshot.
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-07-19 00:51:11 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ab38662b61bb89d8b71069e92266af27bc3acea5

commit ab38662b61bb89d8b71069e92266af27bc3acea5
Author:     Joseph Mingrone <jrm@FreeBSD.org>
AuthorDate: 2024-07-19 00:45:08 +0000
Commit:     Joseph Mingrone <jrm@FreeBSD.org>
CommitDate: 2024-07-19 00:49:05 +0000

    editors/emacs-devel: Update to 2024-07-18 snapshot

    This update pulls in a fix for a build error that occurred when the
    NATIVECOMP option was off.

    PR:             280324
    Reported by:    Benjamin Jacobs <freebsd@dev.thsi.be>
    Sponsored by:   The FreeBSD Foundation

 editors/emacs-devel/Makefile | 4 ++--
 editors/emacs-devel/distinfo | 8 +++-----
 2 files changed, 5 insertions(+), 7 deletions(-)
Comment 3 Joseph Mingrone freebsd_committer freebsd_triage 2024-07-19 00:53:43 UTC
Update with a fix committed to the main branch of the ports tree.  Thanks again.