changeset 54030:889dae20c4c4

8220283: ZGC fails to build on GCC 4.4.7: ATTRIBUTE_ALIGNED compatibility issue Reviewed-by: shade, kbarrett
author sgehwolf
date Thu, 07 Mar 2019 16:15:43 +0100
parents 4ff6c8365b69
children feea57b38a1c
files src/hotspot/share/utilities/globalDefinitions_gcc.hpp
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/utilities/globalDefinitions_gcc.hpp	Thu Mar 07 19:35:02 2019 -0800
+++ b/src/hotspot/share/utilities/globalDefinitions_gcc.hpp	Thu Mar 07 16:15:43 2019 +0100
@@ -269,6 +269,9 @@
 // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55382 and
 // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53017
 //
-#define ATTRIBUTE_ALIGNED(x) __attribute__((aligned(x+0)))
+// GCC versions older than 4.6.4 would fail even with "+0", and needs additional
+// cast to typeof(x) to work around the similar bug.
+//
+#define ATTRIBUTE_ALIGNED(x) __attribute__((aligned((typeof(x))x+0)))
 
 #endif // SHARE_UTILITIES_GLOBALDEFINITIONS_GCC_HPP