8224214: [AIX] Remove support for legacy xlc compiler
authormbaesken
Fri, 30 Aug 2019 09:37:41 +0200
changeset 57975 a333fdeb8de0
parent 57974 1262b3ddd7e4
child 57976 47ce198d5cf1
8224214: [AIX] Remove support for legacy xlc compiler Reviewed-by: erikj, kbarrett, mdoerr, dholmes
make/autoconf/flags-cflags.m4
make/autoconf/toolchain.m4
src/hotspot/os/aix/os_aix.cpp
src/hotspot/share/gc/shared/oopStorage.hpp
src/hotspot/share/gc/shared/ptrQueue.hpp
src/hotspot/share/memory/allocation.hpp
src/hotspot/share/runtime/vm_version.cpp
src/hotspot/share/utilities/globalDefinitions_xlc.hpp
--- a/make/autoconf/flags-cflags.m4	Sat Aug 31 09:18:40 2019 -0700
+++ b/make/autoconf/flags-cflags.m4	Fri Aug 30 09:37:41 2019 +0200
@@ -121,11 +121,7 @@
     # -g0 enables debug symbols without disabling inlining.
     CFLAGS_DEBUG_SYMBOLS="-g0 -xs"
   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
-    if test "x$XLC_USES_CLANG" = xtrue; then
-      CFLAGS_DEBUG_SYMBOLS="-g1"
-    else
-      CFLAGS_DEBUG_SYMBOLS="-g"
-    fi
+    CFLAGS_DEBUG_SYMBOLS="-g1"
   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     CFLAGS_DEBUG_SYMBOLS="-Z7 -d2Zi+"
   fi
--- a/make/autoconf/toolchain.m4	Sat Aug 31 09:18:40 2019 -0700
+++ b/make/autoconf/toolchain.m4	Fri Aug 30 09:37:41 2019 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -286,7 +286,8 @@
     $ECHO "$XLCLANG_VERSION_OUTPUT" | $GREP "IBM XL C/C++ for AIX" > /dev/null
     if test $? -eq 0; then
       AC_MSG_NOTICE([xlclang++ output: $XLCLANG_VERSION_OUTPUT])
-      XLC_USES_CLANG=true
+    else
+      AC_MSG_ERROR([xlclang++ version output check failed, output: $XLCLANG_VERSION_OUTPUT])
     fi
   fi
 
@@ -294,21 +295,13 @@
   TOOLCHAIN_CC_BINARY_gcc="gcc"
   TOOLCHAIN_CC_BINARY_microsoft="cl$EXE_SUFFIX"
   TOOLCHAIN_CC_BINARY_solstudio="cc"
-  TOOLCHAIN_CC_BINARY_xlc="xlc_r"
+  TOOLCHAIN_CC_BINARY_xlc="xlclang"
 
   TOOLCHAIN_CXX_BINARY_clang="clang++"
   TOOLCHAIN_CXX_BINARY_gcc="g++"
   TOOLCHAIN_CXX_BINARY_microsoft="cl$EXE_SUFFIX"
   TOOLCHAIN_CXX_BINARY_solstudio="CC"
-  TOOLCHAIN_CXX_BINARY_xlc="xlC_r"
-
-  if test "x$OPENJDK_TARGET_OS" = xaix; then
-    if test "x$XLC_USES_CLANG" = xtrue; then
-      AC_MSG_NOTICE([xlclang++ detected, using it])
-      TOOLCHAIN_CC_BINARY_xlc="xlclang"
-      TOOLCHAIN_CXX_BINARY_xlc="xlclang++"
-    fi
-  fi
+  TOOLCHAIN_CXX_BINARY_xlc="xlclang++"
 
   # Use indirect variable referencing
   toolchain_var_name=TOOLCHAIN_DESCRIPTION_$TOOLCHAIN_TYPE
--- a/src/hotspot/os/aix/os_aix.cpp	Sat Aug 31 09:18:40 2019 -0700
+++ b/src/hotspot/os/aix/os_aix.cpp	Fri Aug 30 09:37:41 2019 +0200
@@ -523,7 +523,7 @@
       describe_pagesize(g_multipage_support.pthr_stack_pagesize));
   trcVerbose("Default shared memory page size: %s",
       describe_pagesize(g_multipage_support.shmpsize));
-  trcVerbose("Can use 64K pages dynamically with shared meory: %s",
+  trcVerbose("Can use 64K pages dynamically with shared memory: %s",
       (g_multipage_support.can_use_64K_pages ? "yes" :"no"));
   trcVerbose("Can use 16M pages dynamically with shared memory: %s",
       (g_multipage_support.can_use_16M_pages ? "yes" :"no"));
@@ -1440,7 +1440,7 @@
     describe_pagesize(g_multipage_support.pthr_stack_pagesize));
   st->print_cr("  Default shared memory page size:        %s",
     describe_pagesize(g_multipage_support.shmpsize));
-  st->print_cr("  Can use 64K pages dynamically with shared meory:  %s",
+  st->print_cr("  Can use 64K pages dynamically with shared memory:  %s",
     (g_multipage_support.can_use_64K_pages ? "yes" :"no"));
   st->print_cr("  Can use 16M pages dynamically with shared memory: %s",
     (g_multipage_support.can_use_16M_pages ? "yes" :"no"));
--- a/src/hotspot/share/gc/shared/oopStorage.hpp	Sat Aug 31 09:18:40 2019 -0700
+++ b/src/hotspot/share/gc/shared/oopStorage.hpp	Fri Aug 30 09:37:41 2019 +0200
@@ -183,10 +183,7 @@
   // private types by providing public typedefs for them.
   class TestAccess;
 
-  // xlC on AIX can't compile test_oopStorage.cpp with following private
-  // classes. C++03 introduced access for nested classes with DR45, but xlC
-  // version 12 rejects it.
-NOT_AIX( private: )
+private:
   class Block;                  // Fixed-size array of oops, plus bookkeeping.
   class ActiveArray;            // Array of Blocks, plus bookkeeping.
   class AllocationListEntry;    // Provides AllocationList links in a Block.
@@ -224,10 +221,7 @@
   const char* _name;
   ActiveArray* _active_array;
   AllocationList _allocation_list;
-AIX_ONLY(public:)               // xlC 12 on AIX doesn't implement C++ DR45.
   Block* volatile _deferred_updates;
-AIX_ONLY(private:)
-
   Mutex* _allocation_mutex;
   Mutex* _active_mutex;
 
@@ -248,9 +242,7 @@
   Block* find_block_or_null(const oop* ptr) const;
   void delete_empty_block(const Block& block);
   bool reduce_deferred_updates();
-AIX_ONLY(public:)               // xlC 12 on AIX doesn't implement C++ DR45.
   void record_needs_cleanup();
-AIX_ONLY(private:)
 
   // Managing _active_array.
   bool expand_active_array();
--- a/src/hotspot/share/gc/shared/ptrQueue.hpp	Sat Aug 31 09:18:40 2019 -0700
+++ b/src/hotspot/share/gc/shared/ptrQueue.hpp	Fri Aug 30 09:37:41 2019 +0200
@@ -211,7 +211,6 @@
 
   static BufferNode* volatile* next_ptr(BufferNode& bn) { return &bn._next; }
 
-AIX_ONLY(public:)               // xlC 12 on AIX doesn't implement C++ DR45.
   // Allocate a new BufferNode with the "buffer" having size elements.
   static BufferNode* allocate(size_t size);
 
--- a/src/hotspot/share/memory/allocation.hpp	Sat Aug 31 09:18:40 2019 -0700
+++ b/src/hotspot/share/memory/allocation.hpp	Fri Aug 30 09:37:41 2019 +0200
@@ -230,9 +230,6 @@
  private:
   void* operator new(size_t size) throw();
   void* operator new [](size_t size) throw();
-#ifdef __IBMCPP__
- public:
-#endif
   void  operator delete(void* p);
   void  operator delete [](void* p);
 };
--- a/src/hotspot/share/runtime/vm_version.cpp	Sat Aug 31 09:18:40 2019 -0700
+++ b/src/hotspot/share/runtime/vm_version.cpp	Fri Aug 30 09:37:41 2019 +0200
@@ -249,9 +249,6 @@
         #define HOTSPOT_BUILD_COMPILER "clang " __VERSION__
     #elif defined(__GNUC__)
         #define HOTSPOT_BUILD_COMPILER "gcc " __VERSION__
-    #elif defined(__IBMCPP__)
-        #define HOTSPOT_BUILD_COMPILER "xlC " XSTR(__IBMCPP__)
-
     #else
       #define HOTSPOT_BUILD_COMPILER "unknown compiler"
     #endif
--- a/src/hotspot/share/utilities/globalDefinitions_xlc.hpp	Sat Aug 31 09:18:40 2019 -0700
+++ b/src/hotspot/share/utilities/globalDefinitions_xlc.hpp	Fri Aug 30 09:37:41 2019 +0200
@@ -51,11 +51,13 @@
 
 #include <stdint.h>
 
-// __IBMCPP__ is not defined any more with xlclang++
-#ifdef __IBMCPP__
-#if __IBMCPP__ < 1200
-#error "xlc < 12 not supported"
-#endif
+// check for xlc16 or higher
+#ifdef __ibmxl_version__
+  #if __ibmxl_version__ < 16
+  #error "xlc < 16 not supported"
+  #endif
+#else
+  #error "xlc < 16 not supported, macro __ibmxl_version__ not found"
 #endif
 
 #ifndef _AIX