Bug 250270

Summary: java/openjdk12 java/openjdk13 java/openjdk14 java/openjdk15: Fix build with clang 11
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: freebsd-java (Nobody) <java>
Status: New ---    
Severity: Affects Some People CC: emaste, glewis, pi, yasu
Priority: --- Flags: glewis: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 248756    
Attachments:
Description Flags
Fix java/openjdk12 build with clang 11
none
Fix java/openjdk13 build with clang 11
none
Fix java/openjdk14 build with clang 11
none
Fix java/openjdk15 build with clang 11 none

Description Dimitry Andric freebsd_committer 2020-10-11 10:57:41 UTC
Created attachment 218660 [details]
Fix java/openjdk12 build with clang 11

As reported on the freebsd-ports mailing list, java/openjdk1[2-5] do not build with clang 11, which is in 13-CURRENT.

For openjdk 12 through 14, this is due to duplicated symbols, and because clang 11 (like gcc 10) defaults to -fno-common now.

For openjdk 12 through 15, there is also a problem in the return type of the awt wrapper for the Xlib XSynchronize(3) function: since this returns a pointer, the return type should be a jlong, not a jint.

In this bug I will post patches for each of these openjdk versions.
Comment 1 Dimitry Andric freebsd_committer 2020-10-11 10:58:40 UTC
Created attachment 218661 [details]
Fix java/openjdk13 build with clang 11
Comment 2 Dimitry Andric freebsd_committer 2020-10-11 10:58:59 UTC
Created attachment 218662 [details]
Fix java/openjdk14 build with clang 11
Comment 3 Dimitry Andric freebsd_committer 2020-10-11 10:59:18 UTC
Created attachment 218663 [details]
Fix java/openjdk15 build with clang 11
Comment 4 Greg Lewis freebsd_committer 2020-10-13 21:17:54 UTC
I've only built openjdk12, but the changes are identical for all of them, so this looks good to me.  Upstream I've pulled the changes from jdk15 back into 14, 13, and 12.  I haven't pulled in the X wrapper changes yet.
Comment 5 Dimitry Andric freebsd_committer 2020-10-13 21:25:27 UTC
(In reply to Greg Lewis from comment #4)
> Upstream I've pulled the changes from jdk15 back into 14, 13, and 12.  I haven't pulled in the X wrapper changes yet.

Thanks!