1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-20 00:21:35 +00:00
freebsd-ports/java
Dimitry Andric 3822416493 java/openjdk*: work around UB in markOopDesc, fix builds with clang 13
During an exp-run for llvm 13 (see bug 258209), it turned out that
java/openjdk11 through openjdk13 fail to build with clang 13:

=== Output from failing command(s) repeated here ===
* For target jdk__packages_attribute.done:

These crashes are all caused by the markOop/markOopDesc classes, which
are used to keep track of objects, and which are 'marked' using the low
few bits. (See
https://github.com/openjdk/jdk13u/blob/master/src/hotspot/share/oops/markOop.hpp
).

After some laborious bisecting, I found out that these crashes start
occuring after the upstream commit https://github.com
/llvm/llvm-project/commit/16d03818412 (Return "[CGCall] Annotate this
argument with alignment").

What happens afterwards, is that clang considers the "this" pointer to
always be aligned to the alignment of the actual object, and then
masking or adding a few low bits is not working as expected.

The reason openjdk14 and higher work fine with clang 13, and don't crash
similarly, is that the OpenJDK people completely redid the
markOop/markOopDesc classes in
ae5615c614
("8229258: Rework markOop and markOopDesc into a simpler mark word value
carrier"). E.g, the markOopDesc class was renamed to markWord, and
*stores* a pointer-like value instead of *being* a pointer-like value.
This is a much safer way of handling things.

However, this upstream commit is *very* large, as are a few of its
follow-ups, which is probably the reason why it has not been backported
to JDKs <= 13. I tried manually backporting it, but got lost in many
nasty patch conflicts and problems.

As a workaround, build openjdk8 through 13 with clang12 from the
devel/llvm12 port, for the time being.

In addition, allow openjdk14 through 17 to be built with clang 13, by
adding -Wno-unused-but-set-parameter to the compilation flags.

PR:		258954
Approved by:	maintainer timeout (2 weeks)
MFH:		2021Q4
2021-10-16 14:22:03 +02:00
..
apache-bcel *: fix tab vs. space issues, and comments according to the guide. 2021-10-16 11:51:39 +02:00
apache-commons-beanutils
apache-commons-cli
apache-commons-codec
apache-commons-collections
apache-commons-dbcp java/apache-commons-dbcp: Update MASTER_SITES 2021-10-11 20:52:45 +02:00
apache-commons-discovery java/apache-commons-discovery: Update MASTER_SITES, deprecate and set expiration date to 2022-03-31 2021-10-14 10:30:54 +02:00
apache-commons-httpclient
apache-commons-lang
apache-commons-lang3 java/apache-commons-lang3: Upgrade to 3.12.0 2021-10-09 15:55:11 -07:00
apache-commons-logging
apache-commons-pool
apache-commons-primitives java/apache-commons-primitives: Update MASTER_SITES, deprecate and set expiration date to 2022-03-31 2021-10-10 10:51:52 +02:00
aparapi
avis
berkeley-db
bluej
bootstrap-openjdk6
bootstrap-openjdk8
bootstrap-openjdk11
bouncycastle
bouncycastle15
cos
cryptix-jce
dbvis
eclipse
eclipse-cdt
eclipse-drjava
eclipse-ecj
eclipse-EPIC
eclipse-findbugs
eclipse-pydev *: fix tab vs. space issues, and comments according to the guide. 2021-10-16 11:51:39 +02:00
eclipse-shelled
hamcrest
icedtea-web
infobus
intellij
intellij-fsnotifier
intellij-pty4j
intellij-rubymine java/intellij-rubymine: update to 2021.2.3 2021-10-15 23:33:05 +02:00
intellij-ultimate
jad
jai
jakarta-oro
jasmin
jattach
java3d
java-cup
java-getopt
java-subversion
java-zoneinfo java/java-zoneinfo: Update to 2021b 2021-10-13 23:14:28 -07:00
javahelp
javamail
javavmwrapper
jaxen
jcalendar
jcckit
jcommon
jd-gui
jdk8-doc
jdk11-doc
jdk12-doc
jdom
jflex
jfreechart
jgraph
jgraphx
jikes
jlex
jlint
jmf
jode
jrosetta
jta
jtiger
jump
junit
jxgrabkey
lightweight-java-profiler
linux-oracle-jdk18
linux-oracle-jre18
linux-oracle-serverjre10
mmake
mx4j
netbeans java/netbeans: Add CPE information 2021-10-08 11:21:27 +00:00
netcomponents
netrexx
netty
openjdk7 *: fix tab vs. space issues, and comments according to the guide. 2021-10-16 11:51:39 +02:00
openjdk7-jre
openjdk8 java/openjdk*: work around UB in markOopDesc, fix builds with clang 13 2021-10-16 14:22:03 +02:00
openjdk8-jre
openjdk11 java/openjdk*: work around UB in markOopDesc, fix builds with clang 13 2021-10-16 14:22:03 +02:00
openjdk11-jre
openjdk12 java/openjdk*: work around UB in markOopDesc, fix builds with clang 13 2021-10-16 14:22:03 +02:00
openjdk13 java/openjdk*: work around UB in markOopDesc, fix builds with clang 13 2021-10-16 14:22:03 +02:00
openjdk14 java/openjdk*: work around UB in markOopDesc, fix builds with clang 13 2021-10-16 14:22:03 +02:00
openjdk15 java/openjdk*: work around UB in markOopDesc, fix builds with clang 13 2021-10-16 14:22:03 +02:00
openjdk16 java/openjdk*: work around UB in markOopDesc, fix builds with clang 13 2021-10-16 14:22:03 +02:00
openjdk17 java/openjdk*: work around UB in markOopDesc, fix builds with clang 13 2021-10-16 14:22:03 +02:00
openjfx14
phpeclipse
proguard
sablevm
sablevm-classpath
servingxml
sigar
springframework
springframework31
sqlitejdbc
trove4j
veditor
visualvm
wildfly10
wildfly11
wildfly12
wildfly13
wildfly14
wildfly15
wildfly16
wildfly17
wildfly18
wildfly90
Makefile