Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 Apr 2022 08:10:18 +0000
From:      bugzilla-noreply@freebsd.org
To:        java@FreeBSD.org
Subject:   [Bug 262845] java/openjdk13 java/openjdk14 java/openjdk15 java/openjdk16 java/openjdk17: fix build with clang 14
Message-ID:  <bug-262845-8522-qpqBuRo93T@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-262845-8522@https.bugs.freebsd.org/bugzilla/>
References:  <bug-262845-8522@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262845

--- Comment #4 from commit-hook@FreeBSD.org ---
A commit in branch main references this bug:

URL:
https://cgit.FreeBSD.org/ports/commit/?id=3De406118f774154589b91dc8d84f7f03=
20766d5a4

commit e406118f774154589b91dc8d84f7f0320766d5a4
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-03-26 19:47:44 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-04-04 07:56:40 +0000

    java/openjdk13 java/openjdk14 java/openjdk15 java/openjdk16 java/openjd=
k17
java/openjdk17-jre: fix build with clang 14

    During an exp-run for llvm 14 (see bug 261742), it turned out that
    java/openjdk13 and java/openjdk17 fail to build with clang 14 (but this
    also affects openjdk14 through 16):

    =3D=3D=3D Output from failing command(s) repeated here =3D=3D=3D
    * For target hotspot_variant-server_libjvm_objs_serviceThread.o:
=20=20=20
/wrkdirs/usr/ports/java/openjdk13/work/jdk13u-jdk-13.0.10-5-1/src/hotspot/s=
hare/runtime/serviceThread.cpp:133:15:
error: use of bitwise '|' with boolean operands
[-Werror,-Wbitwise-instead-of-logical]
          while (((sensors_changed =3D LowMemoryDetector::has_pending_reque=
sts())
|
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=20=20=20
/wrkdirs/usr/ports/java/openjdk13/work/jdk13u-jdk-13.0.10-5-1/src/hotspot/s=
hare/runtime/serviceThread.cpp:133:15:
note: cast one or both operands to int to silence this warning
=20=20=20
/wrkdirs/usr/ports/java/openjdk13/work/jdk13u-jdk-13.0.10-5-1/src/hotspot/s=
hare/runtime/serviceThread.cpp:133:15:
error: use of bitwise '|' with boolean operands
[-Werror,-Wbitwise-instead-of-logical]
          while (((sensors_changed =3D LowMemoryDetector::has_pending_reque=
sts())
|
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=20=20=20
/wrkdirs/usr/ports/java/openjdk13/work/jdk13u-jdk-13.0.10-5-1/src/hotspot/s=
hare/runtime/serviceThread.cpp:133:15:
note: cast one or both operands to int to silence this warning
=20=20=20
/wrkdirs/usr/ports/java/openjdk13/work/jdk13u-jdk-13.0.10-5-1/src/hotspot/s=
hare/runtime/serviceThread.cpp:133:15:
error: use of bitwise '|' with boolean operands
[-Werror,-Wbitwise-instead-of-logical]
          while (((sensors_changed =3D LowMemoryDetector::has_pending_reque=
sts())
|
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=20=20=20
/wrkdirs/usr/ports/java/openjdk13/work/jdk13u-jdk-13.0.10-5-1/src/hotspot/s=
hare/runtime/serviceThread.cpp:133:15:
note: cast one or both operands to int to silence this warning
=20=20=20
/wrkdirs/usr/ports/java/openjdk13/work/jdk13u-jdk-13.0.10-5-1/src/hotspot/s=
hare/runtime/serviceThread.cpp:133:15:
error: use of bitwise '|' with boolean operands
[-Werror,-Wbitwise-instead-of-logical]
          while (((sensors_changed =3D LowMemoryDetector::has_pending_reque=
sts())
|
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       ... (rest of output omitted)

    Although the warning is normally an indication of a potential problem,
    in this case a comment just before the affected code explictly mentions
    the reason for using bitwise '|' instead of logical '||':

          // Process all available work on each (outer) iteration, rather t=
han
          // only the first recognized bit of work, to avoid frequently true
early
          // tests from potentially starving later work.  Hence the use of
          // arithmetic-or to combine results; we don't want short-circuiti=
ng.

    (See
=20=20=20
<https://github.com/openjdk/jdk/blob/master/src/hotspot/share/runtime/servi=
ceThread.cpp#L140>)

    Therefore, we should suppress -Wbitwise-instead-of-logical for clang 14
    and higher.

    PR:             262845
    Approved by:    portmgr (build fix blanket)
    MFH:            2022Q2

 java/openjdk13/Makefile | 7 ++++++-
 java/openjdk14/Makefile | 7 ++++++-
 java/openjdk15/Makefile | 7 ++++++-
 java/openjdk16/Makefile | 7 ++++++-
 java/openjdk17/Makefile | 7 ++++++-
 5 files changed, 30 insertions(+), 5 deletions(-)

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-262845-8522-qpqBuRo93T>