JDK-8304291 : [AIX] Broken build after JDK-8301998
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 21
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: aix
  • Submitted: 2023-03-15
  • Updated: 2023-06-14
  • Resolved: 2023-04-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 17 JDK 20 JDK 21
11.0.20Fixed 17.0.8Fixed 20.0.2Fixed 21 b20Fixed
Related Reports
Duplicate :  
Relates :  
Description
Harfbuzz version 7.0.1 does not appear to compile on AIX. Bumping to 7.1.0 fixes one issue, but another issue is present after fixing that.

The first build error is:
Error while processing /home/hotspot/openjdk/jdk-deepa/src/java.desktop/share/native/libharfbuzz/hb-aat-map.cc.
In file included from /home/hotspot/openjdk/jdk-deepa/src/java.desktop/share/native/libharfbuzz/hb-buffer.cc:30:
In file included from /home/hotspot/openjdk/jdk-deepa/src/java.desktop/share/native/libharfbuzz/hb-buffer.hh:33:
In file included from /home/hotspot/openjdk/jdk-deepa/src/java.desktop/share/native/libharfbuzz/hb.hh:513:
/home/hotspot/openjdk/jdk-deepa/src/java.desktop/share/native/libharfbuzz/hb-algs.hh:882:10: error: 1540-2993 The builtin "__builtin_mul_overflow" is not supported.
  return __builtin_mul_overflow (count, size, result);

Then:

=== Output from failing command(s) repeated here ===
* For target support_native_java.desktop_libfontmanager_hb-subset.o:
In file included from /home/hotspot/openjdk/jdk-tyler/src/java.desktop/share/native/libharfbuzz/hb-subset.cc:27:
In file included from /home/hotspot/openjdk/jdk-tyler/src/java.desktop/share/native/libharfbuzz/OT/Color/COLR/../../../hb.hh:522:
/home/hotspot/openjdk/jdk-tyler/src/java.desktop/share/native/libharfbuzz/hb-iter.hh:372:23: error: no matching function for call to object of type 'struct (anonymous struct at /home/hotspot/openjdk/jdk-tyler/src/java.desktop/share/native/libharfbuzz/hb-algs.hh:414:1)'
            decltype (hb_get (hb_declval (Proj), *hb_declval (Iter)))>
                      ^~~~~~
/home/hotspot/openjdk/jdk-tyler/src/java.desktop/share/native/libharfbuzz/hb-map.hh:346:5: note: in instantiation of template class 'hb_map_iter_t<hb_filter_iter_t<hb_array_t<hb_hashmap_t<hb_array_t<const char>, unsigned int, true>::item_t>, bool (hb_hashmap_t<hb_array_t<const char>, unsigned int, true>::item_t::*)() const, (anonymous struct at /home/hotspot/openjdk/jdk-tyler/src/java.desktop/share/native/libharfbuzz/hb-algs.hh:202:1) &, nullptr>, const char *, hb_function_sortedness_t::NOT_SORTED, nullptr>' requested here
    + keys_ref ()
    ^
/home/hotspot/openjdk/jdk-tyler/src/java.desktop/share/native/libharfbuzz/hb-ot-post-table-v2subset.hh:81:44: note: in instantiation of template class 'hb_hashmap_t<hb_array_t<const char>, unsigned int, true>' requested here
  hb_hashmap_t<hb_bytes_t, uint32_t, true> glyph_name_to_new_index;
                                           ^
/home/hotspot/openjdk/jdk-tyler/src/java.desktop/share/native/libharfbuzz/hb-algs.hh:440:3: note: candidate template ignored: substitution failure [with Proj = const char *, Val = hb_hashmap_t<hb_array_t<const char>, unsigned int, true>::item_t &]: no matching member function for call to 'impl'
  operator () (Proj&& f, Val &&v) const HB_AUTO_RETURN
  ^
In file included from /home/hotspot/openjdk/jdk-tyler/src/java.desktop/share/native/libharfbuzz/hb-subset.cc:27:
   ... (rest of output omitted)

* All command lines available in /home/hotspot/openjdk/jdk-tyler/build/aix-ppc64-server-fastdebug/make-support/failure-logs.
=== End of repeated output ===

Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u/pull/74 Date: 2023-06-09 12:41:51 +0000
09-06-2023

Another PR here: https://github.com/openjdk/jdk11u/pull/74
09-06-2023

Thanks Goetz! Will do!
09-06-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u-dev/pull/1940 Date: 2023-06-09 12:18:50 +0000
09-06-2023

[~adfarley] This is broken in 11.0.20, too, right? Don't you want to open a PR against jdk11u and file a jdk11u-critical-request? Anyways, please only label jdk11u-fix-request if the backport is ready to be pushed!
06-06-2023

Fix Request [11u]: The __builtin_mul_overflow error has been seen while building JDK11u on AIX. Since the line numbers relevant to the change appear the same as on later versions, I'd like to request a backport of this fix, please.
05-06-2023

In head, we should probably replace !AIX by a check for xlc > 16?
04-05-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/1320 Date: 2023-05-03 19:32:27 +0000
03-05-2023

fix request [20u, 17u]: This change is required in order to build after the Harfbuzz upgrade (JDK-8304321). The risk is medium, because this patch may need to be re-applied each time the Harfbuzz library upgrade is performed (it is unlikely that such a change will be made to the Harfbuzz library upstream). Testing: T1 is as expected, test/hotspot/jtreg/serviceability/jvmti are all passing. Patch applied cleanly.
03-05-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk20u/pull/57 Date: 2023-04-20 20:47:40 +0000
20-04-2023

Changeset: 310aa934 Author: Matthias Baesken <mbaesken@openjdk.org> Date: 2023-04-20 07:07:00 +0000 URL: https://git.openjdk.org/jdk/commit/310aa9347861922af5f0311e9e93a5f49dee6adc
20-04-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13529 Date: 2023-04-19 10:38:19 +0000
19-04-2023

> That '__builtin_mul_overflow' is fixed in Harfbuzz release 7.1. > Would you upgrade, or just add a patch to libharfbuzz with the change? I would not upgrade now to 7.1 but just add the patch. In a couple of months we will probably go to xlc17 and might remove the patch afterwards. Btw that is the patch, latest jdk nightbuild worked , could you try it as well please? diff --git a/src/java.desktop/share/native/libharfbuzz/hb-algs.hh b/src/java.desktop/share/native/libharfbuzz/hb-algs.hh index 28dc036a515..3c96884ff08 100644 --- a/src/java.desktop/share/native/libharfbuzz/hb-algs.hh +++ b/src/java.desktop/share/native/libharfbuzz/hb-algs.hh @@ -876,10 +876,13 @@ static inline bool hb_unsigned_mul_overflows (unsigned int count, unsigned int size, unsigned *result = nullptr) { #if (defined(__GNUC__) && (__GNUC__ >= 4)) || (defined(__clang__) && (__clang_major__ >= 8)) +/* avoid on old xlc16 clang */ +#if !defined(AIX) unsigned stack_result; if (!result) result = &stack_result; return __builtin_mul_overflow (count, size, result); +#endif #endif if (result) diff --git a/src/java.desktop/share/native/libharfbuzz/hb-subset.cc b/src/java.desktop/share/native/libharfbuzz/hb-subset.cc index a8161a32551..f6f37527733 100644 --- a/src/java.desktop/share/native/libharfbuzz/hb-subset.cc +++ b/src/java.desktop/share/native/libharfbuzz/hb-subset.cc @@ -24,6 +24,7 @@ * Google Author(s): Garret Rieger, Rod Sheeter, Behdad Esfahbod */ +#if !defined(AIX) #include "hb.hh" #include "hb-open-type.hh" @@ -631,3 +632,6 @@ end: /* If NO_VISIBILITY, libharfbuzz has this. */ #include "hb-ot-name-language-static.hh" #endif + +// AIX +#endif
06-04-2023

That's terrific news :-) I agree with your conclusion [about hb-subset.cc], but I hadn't thought of excluding it from the build. That '__builtin_mul_overflow' is fixed in Harfbuzz release 7.1. Would you upgrade, or just add a patch to libharfbuzz with the change?
05-04-2023

Hi Tyler, it seems to me that the "bad" file src/java.desktop/share/native/libharfbuzz/hb-subset.cc that triggers the compile errors with xlC16 can be excluded from compilation in the OpenJDK. At least I see no compile/link errors when doing so on AIX; maybe we do not use the hb-font subsetting at all in OpenJDK ? Do I miss something? Should we do so, would also reduce compile time a little bit. With hb-subset.cc excluded and a small adjustment for the "__builtin_mul_overflow" in hb-algs.hh, the build succeeds with xlC16.
05-04-2023

The first "__builtin_mul_overflow" is not supported - issue can be easily handled by adjusting the related ifdef at the point where compilation breaks. The second issue "error: no matching function for call ..." is more tricky, but shows up, according to harfbuzz issue 4138, as well on macOS when ancient clang versions are used. So there is a very good chance that with a new clang it works nicely; clang 13 on macOS works for us. xlc 16.1.X is still based on the very old clang 4.0.X . xlc 17.1.1 seems to be based on clang 15.0.0, so this might be an option to get around this problem on AIX .
22-03-2023

Hi Martin, Good sleuthing. Your linked issue certainly means that xlclang must be updated to include fixpack 2.
17-03-2023

Is one of the issues related to https://www.ibm.com/support/pages/apar/IJ14858 ?
16-03-2023

Second issue open at Harfbuzz repo: https://github.com/harfbuzz/harfbuzz/issues/4138
15-03-2023