Bug 280560 - java/openjdk11: fix build with clang 19
Summary: java/openjdk11: fix build with clang 19
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-java (Nobody)
URL:
Keywords:
Depends on:
Blocks: 280562
  Show dependency treegraph
 
Reported: 2024-08-01 16:08 UTC by Dimitry Andric
Modified: 2024-08-07 16:53 UTC (History)
0 users

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


Attachments
java/openjdk11: fix build with clang 19 (1.91 KB, patch)
2024-08-01 16:08 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2024-08-01 16:08:31 UTC
Clang 19 is now more strict about undefined integral expressions used as
constants in enum, which results in errors compiling java/openjdk11,
similar to:

    /wrkdirs/usr/ports/java/openjdk11/work/jdk11u-jdk-11.0.24-8-1/src/jdk.pack/share/native/common-unpack/constants.h:206:33: error: expression is not an integral constant expression
      206 |     AO_UNUSED_MBZ             = (-1)<<13, // options bits reserved for future use.
          |                                 ^~~~~~~~
    /wrkdirs/usr/ports/java/openjdk11/work/jdk11u-jdk-11.0.24-8-1/src/jdk.pack/share/native/common-unpack/constants.h:206:37: note: left shift of negative value -1
      206 |     AO_UNUSED_MBZ             = (-1)<<13, // options bits reserved for future use.
          |                                     ^

Replace the negative value with ~0u to fix this error.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2024-08-01 16:08:56 UTC
Created attachment 252426 [details]
java/openjdk11: fix build with clang 19
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-08-07 16:47:28 UTC
A commit in branch main references this bug:

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

commit d2ae63c6feffda05eb643520dd851451ee337f53
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-08-01 11:41:40 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-08-07 16:44:21 +0000

    java/openjdk11: fix build with clang 19

    Clang 19 is now more strict about undefined integral expressions used as
    constants in enum, which results in errors compiling java/openjdk11,
    similar to:

        /wrkdirs/usr/ports/java/openjdk11/work/jdk11u-jdk-11.0.24-8-1/src/jdk.pack/share/native/common-unpack/constants.h:206:33: error: expression is not an integral constant expression
          206 |     AO_UNUSED_MBZ             = (-1)<<13, // options bits reserved for future use.
              |                                 ^~~~~~~~
        /wrkdirs/usr/ports/java/openjdk11/work/jdk11u-jdk-11.0.24-8-1/src/jdk.pack/share/native/common-unpack/constants.h:206:37: note: left shift of negative value -1
          206 |     AO_UNUSED_MBZ             = (-1)<<13, // options bits reserved for future use.
              |                                     ^

    Replace the negative value with ~0u to fix this error.

    PR:             280560
    Approved by:    glewis (maintainer)
    MFH:            2024Q3

 ...-src_jdk.pack_share_native_common-unpack_constants.h (new) | 11 +++++++++++
 1 file changed, 11 insertions(+)
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-08-07 16:52:31 UTC
A commit in branch 2024Q3 references this bug:

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

commit 6bd6dc4ea51f59381fbc5eb84b0e883bc297270c
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-08-01 11:41:40 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-08-07 16:51:45 +0000

    java/openjdk11: fix build with clang 19

    Clang 19 is now more strict about undefined integral expressions used as
    constants in enum, which results in errors compiling java/openjdk11,
    similar to:

        /wrkdirs/usr/ports/java/openjdk11/work/jdk11u-jdk-11.0.24-8-1/src/jdk.pack/share/native/common-unpack/constants.h:206:33: error: expression is not an integral constant expression
          206 |     AO_UNUSED_MBZ             = (-1)<<13, // options bits reserved for future use.
              |                                 ^~~~~~~~
        /wrkdirs/usr/ports/java/openjdk11/work/jdk11u-jdk-11.0.24-8-1/src/jdk.pack/share/native/common-unpack/constants.h:206:37: note: left shift of negative value -1
          206 |     AO_UNUSED_MBZ             = (-1)<<13, // options bits reserved for future use.
              |                                     ^

    Replace the negative value with ~0u to fix this error.

    PR:             280560
    Approved by:    glewis (maintainer)
    MFH:            2024Q3

    (cherry picked from commit d2ae63c6feffda05eb643520dd851451ee337f53)

 ...-src_jdk.pack_share_native_common-unpack_constants.h (new) | 11 +++++++++++
 1 file changed, 11 insertions(+)