JDK-8224474 : harfbuzz 2.3.1 code fails to compile with gcc 4.4.7
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 11.0.4
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux_redhat_6.2
  • CPU: generic
  • Submitted: 2019-05-21
  • Updated: 2020-01-16
  • Resolved: 2019-05-21
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
11.0.4 b04Fixed
Related Reports
Relates :  
Description
Our upstream builds machines fail to compile jdk-updates/jdk11u tag jdk-11.0.4+3 (last successful tag jdk-11.0.4+2) with gcc 4.4.7 the system compiler on RHEL/CentOS 6.

/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh:245: error: #pragma GCC diagnostic not allowed inside functions
gmake[3]: *** [/home/openjdk/jdk11u/build/release/support/native/java.desktop/libfontmanager/hb-buffer-serialize.o] Error 1
In file included from /home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb.hh:651,
                 from /home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer.hh:33,
                 from /home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer.cc:30:
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh: In function ���T* hb_addressof(T&)���:
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh:239: error: #pragma GCC diagnostic not allowed inside functions
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh:240: error: #pragma GCC diagnostic not allowed inside functions
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh:245: error: #pragma GCC diagnostic not allowed inside functions
In file included from /home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb.hh:651,
                 from /home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-face.cc:29:
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh: In function ���T* hb_addressof(T&)���:
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh:239: error: #pragma GCC diagnostic not allowed inside functions
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh:240: error: #pragma GCC diagnostic not allowed inside functions
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh:245: error: #pragma GCC diagnostic not allowed inside functions
In file included from /home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-common.cc:31:
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-machinery.hh: In function ���const Type& StructAtOffsetUnaligned(const void*, unsigned int)���:
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-machinery.hh:70: error: #pragma GCC diagnostic not allowed inside functions
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-machinery.hh:71: error: #pragma GCC diagnostic not allowed inside functions
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-machinery.hh:73: error: #pragma GCC diagnostic not allowed inside functions
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-machinery.hh: In function ���Type& StructAtOffsetUnaligned(void*, unsigned int)���:
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-machinery.hh:78: error: #pragma GCC diagnostic not allowed inside functions
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-machinery.hh:79: error: #pragma GCC diagnostic not allowed inside functions
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-machinery.hh:81: error: #pragma GCC diagnostic not allowed inside functions
In file included from /home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb.hh:651,
                 from /home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shaper-impl.hh:30,
                 from /home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-fallback-shape.cc:27:
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh: In function ���T* hb_addressof(T&)���:
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh:239: error: #pragma GCC diagnostic not allowed inside functions
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh:240: error: #pragma GCC diagnostic not allowed inside functions
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh:245: error: #pragma GCC diagnostic not allowed inside functions
In file included from /home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb.hh:651,
                 from /home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font.cc:29:
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh: In function ���T* hb_addressof(T&)���:
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh:239: error: #pragma GCC diagnostic not allowed inside functions
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh:240: error: #pragma GCC diagnostic not allowed inside functions
/home/openjdk/jdk11u/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh:245: error: #pragma GCC diagnostic not allowed inside functions
Comments
This webrev seems to fix it: http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8224474/01/webrev/
21-05-2019

Fix request (OpenJDK 11u): Please approve this build fix for JDK 11u. Currently, tag jdk-11.0.4+3 is not buildable on CentOS/RHEL 6 with system GCC version 4.4.7. Moving the pragmas outside the functions is a non-functional change and makes this old compiler happy. The patch has been reviewed by Christoph Langer. webrev: http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8224474/01/webrev/ Review thread: http://mail.openjdk.java.net/pipermail/jdk-updates-dev/2019-May/001187.html
21-05-2019