Revert "[AIX] Avoid structor alias; die before bad alias codegen"
authorJake Egan <Jake.Egan@ibm.com>
Tue, 25 May 2021 19:06:59 +0000 (15:06 -0400)
committerSteven Wan <wanyu9511@gmail.com>
Tue, 25 May 2021 19:07:40 +0000 (15:07 -0400)
Avoiding structor alias is no longer needed because AIX now has an alias implementation here: https://reviews.llvm.org/D83252.

This reverts commit b116ded57da3530e661f871f4191c59cd9e091cd.

Reviewed By: jasonliu

Differential Revision: https://reviews.llvm.org/D102724

clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/aix-constructor-alias.c

index 677e2b6..6ded23b 100644 (file)
@@ -5028,10 +5028,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
 
   // Enable -mconstructor-aliases except on darwin, where we have to work around
   // a linker bug (see <rdar://problem/7651567>), and CUDA/AMDGPU device code,
-  // where aliases aren't supported. Similarly, aliases aren't yet supported
-  // for AIX.
-  if (!RawTriple.isOSDarwin() && !RawTriple.isNVPTX() &&
-      !RawTriple.isAMDGPU() && !RawTriple.isOSAIX())
+  // where aliases aren't supported.
+  if (!RawTriple.isOSDarwin() && !RawTriple.isNVPTX() && !RawTriple.isAMDGPU())
     CmdArgs.push_back("-mconstructor-aliases");
 
   // Darwin's kernel doesn't support guard variables; just die if we
index 18c5f5b..0f53dee 100644 (file)
@@ -1,7 +1,7 @@
-// Check that we don't pass -mconstructor-aliases when compiling for AIX.
+// Check that we pass -mconstructor-aliases when compiling for AIX.
 
 // RUN: %clang -### -target powerpc-ibm-aix7.1.0.0 %s -c -o %t.o 2>&1 \
 // RUN:   | FileCheck %s
 // RUN: %clang -### -target powerpc64-ibm-aix7.1.0.0 %s -c -o %t.o 2>&1 \
 // RUN:   | FileCheck %s
-// CHECK-NOT: "-mconstructor-aliases"
+// CHECK: "-mconstructor-aliases"