JDK-8304295 : harfbuzz build fails with GCC 7 after JDK-8301998
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2023-03-16
  • Updated: 2023-05-16
  • Resolved: 2023-04-01
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.20-oracleFixed 17.0.8-oracleFixed 20.0.2Fixed 21 b17Fixed
Related Reports
Relates :  
Description
ERROR: Build failed for target 'all' in configuration 'linux-x86_64-server-release' (exit code 2) 

=== Output from failing command(s) repeated here ===
* For target support_native_java.desktop_libfontmanager_gsubgpos-context.o:
In file included from src/java.desktop/share/native/libharfbuzz/graph/../hb.hh:514:0,
                 from src/java.desktop/share/native/libharfbuzz/graph/../hb-set.hh:31,
                 from src/java.desktop/share/native/libharfbuzz/graph/graph.hh:27,
                 from src/java.desktop/share/native/libharfbuzz/graph/gsubgpos-graph.hh:27,
                 from src/java.desktop/share/native/libharfbuzz/graph/gsubgpos-context.cc:27:
src/java.desktop/share/native/libharfbuzz/graph/../hb-iter.hh: In instantiation of 'hb_apply_t<Appl>::hb_apply_t(Appl) [with Appl = void (&)(void*) throw ()]':
src/java.desktop/share/native/libharfbuzz/graph/../hb-iter.hh:697:12:   required from 'hb_apply_t<Appl&><unnamed struct>::operator()(Appl*) const [with Appl = void(void*) throw ()]'
src/java.desktop/share/native/libharfbuzz/graph/../hb-pool.hh:43:16:   required from 'hb_pool_t<T, ChunkLen>::~hb_pool_t() [with T = hb_serialize_context_t::object_t; unsigned int ChunkLen = 32]'
src/java.desktop/share/native/libharfbuzz/graph/../hb-serialize.hh:181:21:   required from here
src/java.desktop/share/native/libharfbuzz/graph/../hb-iter.hh:676:3: error: mangled name for 'hb_apply_t<Appl>::hb_apply_t(Appl) [with Appl = void (&)(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
   hb_apply_t (Appl a) : a (a) {}
   ^~~~~~~~~~
src/java.desktop/share/native/libharfbuzz/graph/../hb-iter.hh:676:3: error: mangled name for 'hb_apply_t<Appl>::hb_apply_t(Appl) [with Appl = void (&)(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
src/java.desktop/share/native/libharfbuzz/graph/../hb-iter.hh:680:8: error: mangled name for 'void hb_apply_t<Appl>::operator()(Iter) [with Iter = hb_array_t<hb_pool_t<hb_serialize_context_t::object_t>::chunk_t* const>; typename hb_enable_if<hb_is_iterator_of<Iter, typename Iter::item_t>::value>::type* <anonymous> = 0; Appl = void (&)(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
   void operator () (Iter it)
   ... (rest of output omitted)
* For target support_native_java.desktop_libfontmanager_hb-aat-layout.o:
In file included from src/java.desktop/share/native/libharfbuzz/hb.hh:514:0,
                 from src/java.desktop/share/native/libharfbuzz/hb-aat-layout.cc:28:
src/java.desktop/share/native/libharfbuzz/hb-iter.hh: In instantiation of 'hb_apply_t<Appl>::hb_apply_t(Appl) [with Appl = void (&)(void*) throw ()]':
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:697:12:   required from 'hb_apply_t<Appl&><unnamed struct>::operator()(Appl*) const [with Appl = void(void*) throw ()]'
src/java.desktop/share/native/libharfbuzz/hb-pool.hh:43:16:   required from 'hb_pool_t<T, ChunkLen>::~hb_pool_t() [with T = hb_serialize_context_t::object_t; unsigned int ChunkLen = 32]'
src/java.desktop/share/native/libharfbuzz/hb-serialize.hh:181:21:   required from here
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:676:3: error: mangled name for 'hb_apply_t<Appl>::hb_apply_t(Appl) [with Appl = void (&)(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
   hb_apply_t (Appl a) : a (a) {}
   ^~~~~~~~~~
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:676:3: error: mangled name for 'hb_apply_t<Appl>::hb_apply_t(Appl) [with Appl = void (&)(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:680:8: error: mangled name for 'void hb_apply_t<Appl>::operator()(Iter) [with Iter = hb_array_t<hb_pool_t<hb_serialize_context_t::object_t>::chunk_t* const>; typename hb_enable_if<hb_is_iterator_of<Iter, typename Iter::item_t>::value>::type* <anonymous> = 0; Appl = void (&)(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
   void operator () (Iter it)
        ^~~~~~~~
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:676:3: error: mangled name for 'hb_apply_t<Appl>::hb_apply_t(Appl) [with Appl = void (&)(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
   hb_apply_t (Appl a) : a (a) {}
   ... (rest of output omitted)
* For target support_native_java.desktop_libfontmanager_hb-aat-map.o:
In file included from src/java.desktop/share/native/libharfbuzz/hb.hh:514:0,
                 from src/java.desktop/share/native/libharfbuzz/hb-aat-map.cc:29:
src/java.desktop/share/native/libharfbuzz/hb-iter.hh: In instantiation of 'hb_apply_t<Appl>::hb_apply_t(Appl) [with Appl = void (&)(void*) throw ()]':
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:697:12:   required from 'hb_apply_t<Appl&><unnamed struct>::operator()(Appl*) const [with Appl = void(void*) throw ()]'
src/java.desktop/share/native/libharfbuzz/hb-pool.hh:43:16:   required from 'hb_pool_t<T, ChunkLen>::~hb_pool_t() [with T = hb_serialize_context_t::object_t; unsigned int ChunkLen = 32]'
src/java.desktop/share/native/libharfbuzz/hb-serialize.hh:181:21:   required from here
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:676:3: error: mangled name for 'hb_apply_t<Appl>::hb_apply_t(Appl) [with Appl = void (&)(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
   hb_apply_t (Appl a) : a (a) {}
   ^~~~~~~~~~
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:676:3: error: mangled name for 'hb_apply_t<Appl>::hb_apply_t(Appl) [with Appl = void (&)(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:680:8: error: mangled name for 'void hb_apply_t<Appl>::operator()(Iter) [with Iter = hb_array_t<hb_pool_t<hb_serialize_context_t::object_t>::chunk_t* const>; typename hb_enable_if<hb_is_iterator_of<Iter, typename Iter::item_t>::value>::type* <anonymous> = 0; Appl = void (&)(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
   void operator () (Iter it)
        ^~~~~~~~
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:676:3: error: mangled name for 'hb_apply_t<Appl>::hb_apply_t(Appl) [with Appl = void (&)(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
   hb_apply_t (Appl a) : a (a) {}
   ... (rest of output omitted)
* For target support_native_java.desktop_libfontmanager_hb-buffer.o:
In file included from src/java.desktop/share/native/libharfbuzz/hb.hh:514:0,
                 from src/java.desktop/share/native/libharfbuzz/hb-buffer.hh:33,
                 from src/java.desktop/share/native/libharfbuzz/hb-buffer.cc:30:
src/java.desktop/share/native/libharfbuzz/hb-iter.hh: In instantiation of 'hb_apply_t<Appl>::hb_apply_t(Appl) [with Appl = void (&)(void*) throw ()]':
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:697:12:   required from 'hb_apply_t<Appl&><unnamed struct>::operator()(Appl*) const [with Appl = void(void*) throw ()]'
src/java.desktop/share/native/libharfbuzz/hb-pool.hh:43:16:   required from 'hb_pool_t<T, ChunkLen>::~hb_pool_t() [with T = hb_serialize_context_t::object_t; unsigned int ChunkLen = 32]'
src/java.desktop/share/native/libharfbuzz/hb-serialize.hh:181:21:   required from here
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:676:3: error: mangled name for 'hb_apply_t<Appl>::hb_apply_t(Appl) [with Appl = void (&)(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
   hb_apply_t (Appl a) : a (a) {}
   ^~~~~~~~~~
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:676:3: error: mangled name for 'hb_apply_t<Appl>::hb_apply_t(Appl) [with Appl = void (&)(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:680:8: error: mangled name for 'void hb_apply_t<Appl>::operator()(Iter) [with Iter = hb_array_t<hb_pool_t<hb_serialize_context_t::object_t>::chunk_t* const>; typename hb_enable_if<hb_is_iterator_of<Iter, typename Iter::item_t>::value>::type* <anonymous> = 0; Appl = void (&)(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
   void operator () (Iter it)
        ^~~~~~~~
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:676:3: error: mangled name for 'hb_apply_t<Appl>::hb_apply_t(Appl) [with Appl = void (&)(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
   ... (rest of output omitted)
* For target support_native_java.desktop_libfontmanager_hb-common.o:
In file included from src/java.desktop/share/native/libharfbuzz/hb.hh:514:0,
                 from src/java.desktop/share/native/libharfbuzz/hb-common.cc:29:
src/java.desktop/share/native/libharfbuzz/hb-iter.hh: In instantiation of 'hb_apply_t<Appl>::hb_apply_t(Appl) [with Appl = void (&)(void*) throw ()]':
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:697:12:   required from 'hb_apply_t<Appl&><unnamed struct>::operator()(Appl*) const [with Appl = void(void*) throw ()]'
src/java.desktop/share/native/libharfbuzz/hb-pool.hh:43:16:   required from 'hb_pool_t<T, ChunkLen>::~hb_pool_t() [with T = hb_serialize_context_t::object_t; unsigned int ChunkLen = 32]'
src/java.desktop/share/native/libharfbuzz/hb-serialize.hh:181:21:   required from here
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:676:3: error: mangled name for 'hb_apply_t<Appl>::hb_apply_t(Appl) [with Appl = void (&)(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
   hb_apply_t (Appl a) : a (a) {}
   ^~~~~~~~~~
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:676:3: error: mangled name for 'hb_apply_t<Appl>::hb_apply_t(Appl) [with Appl = void (&)(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:680:8: error: mangled name for 'void hb_apply_t<Appl>::operator()(Iter) [with Iter = hb_array_t<hb_pool_t<hb_serialize_context_t::object_t>::chunk_t* const>; typename hb_enable_if<hb_is_iterator_of<Iter, typename Iter::item_t>::value>::type* <anonymous> = 0; Appl = void (&)(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
   void operator () (Iter it)
        ^~~~~~~~
src/java.desktop/share/native/libharfbuzz/hb-iter.hh:676:3: error: mangled name for 'hb_apply_t<Appl>::hb_apply_t(Appl) [with Appl = void (&)(void*) throw ()]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
   hb_apply_t (Appl a) : a (a) {}
   ... (rest of output omitted)

* All command lines available in /home/jiangfeilong/workspace/jdk/build/linux-x86_64-server-release/make-support/failure-logs.
=== End of repeated output ===
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u-dev/pull/1864 Date: 2023-05-08 07:21:27 +0000
08-05-2023

Fix request [11u] I backport this for parity with 11.0.20-oracle. Required follow up of 8301998. Included in that change.
08-05-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk20u/pull/68 Date: 2023-04-27 16:38:10 +0000
27-04-2023

Fix request (20u) Clean backport. The fix for a broken build on some compilers. Review 20u: https://github.com/openjdk/jdk20u/pull/68
27-04-2023

Fix request [17u] I backport this for parity with 17.0.8-oracle. Required follow up of 8301998. Included in that change.
19-04-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/1264 Date: 2023-04-18 16:07:37 +0000
18-04-2023

Changeset: 34e66ce1 Author: Joshua Cao <joshcao@amazon.com> Committer: Julian Waters <jwaters@openjdk.org> Date: 2023-04-01 14:36:52 +0000 URL: https://git.openjdk.org/jdk/commit/34e66ce1ef2decc81557a362d6242313e98417fa
01-04-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13253 Date: 2023-03-30 21:05:40 +0000
30-03-2023

I have an easy fix that will disable the warning, so we don't always have to pass --disable-warnings-as-errors
30-03-2023

[~fjiang] Checked the newly attached log. The build errors are due to compiler warnings. As discussed, this can be resolved by using --disable-warnings-as-errors. Will be closing this issue.
17-03-2023

[~erikj] [~honkar] --disable-warnings-as-errors works. I attached the full build log for aarch64 without --disable-warnings-as-errors.
17-03-2023

> So why is gcc 11 not complaining ? That's an interesting question, for which I don't have an answer. The relevant change proposals are listed in the gcc conformance table as having been implemented in gcc7. The documentation for `-Wnoexcept-type` and `-Wc++17-compat` seem to be identical for gcc8 and gcc11.
16-03-2023

So why is gcc 11 not complaining ? I'd expect a new compiler to care even more about newer versions of the standard ? > Or is that our code in the template parameters? No, all code here is harfbuzz.
16-03-2023

-Wall enables -Wc++17-compat, which enables -Wnoexcept-type, which is the warning being reported. I think we could reasonably disable -Wc++17-compat, leaving it to the folks who eventually do our upgrade to C++17 to use it when the time comes. I suspect we do not care about -Wnoexcept-type at all though, so perhaps just disable that. And I'm a little surprised harfbuzz is still using "throw()" exception specifications rather than "noexcept". Or is that our code in the template parameters?
16-03-2023

[~fjiang] Can you please add the entire error log, it seems to be cut off at the end.
16-03-2023

This build issue is due to compiler warning that is treated as error. Such build warnings can be resolved by running configure with --disable-warnings-as-errors. Please refer to the steps and JDK strict approach for these warnings in Fixing Unexpected Build Failures section of this doc: https://openjdk.org/groups/build/doc/building.html
16-03-2023

Have you tried configuring with --disable-warnings-as-errors?
16-03-2023

The same build failure occurs on AArch64 with GCC 7
16-03-2023