r290979 - Accept and ignore -Wa, -mbig-obj on COFF targets for gas compatibility

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 4 10:16:32 PST 2017


Author: rnk
Date: Wed Jan  4 12:16:32 2017
New Revision: 290979

URL: http://llvm.org/viewvc/llvm-project?rev=290979&view=rev
Log:
Accept and ignore -Wa,-mbig-obj on COFF targets for gas compatibility

LLVM's integrated assembler will automatically switch to big objects
when there are more than 2**16 sections.

Patch by Kyra!

Added:
    cfe/trunk/test/Driver/mbig-obj.c
Modified:
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=290979&r1=290978&r2=290979&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Jan  4 12:16:32 2017
@@ -3067,6 +3067,10 @@ static void CollectArgsForIntegratedAsse
         continue;
       }
 
+      if (C.getDefaultToolChain().getTriple().isOSBinFormatCOFF() &&
+          Value == "-mbig-obj")
+        continue; // LLVM handles bigobj automatically
+
       switch (C.getDefaultToolChain().getArch()) {
       default:
         break;

Added: cfe/trunk/test/Driver/mbig-obj.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mbig-obj.c?rev=290979&view=auto
==============================================================================
--- cfe/trunk/test/Driver/mbig-obj.c (added)
+++ cfe/trunk/test/Driver/mbig-obj.c Wed Jan  4 12:16:32 2017
@@ -0,0 +1,9 @@
+// RUN: %clang --target=x86_64-windows -c -Wa,-mbig-obj %s 2>&1 | FileCheck %s --check-prefix=WINDOWS
+// RUN: %clang --target=x86_64-windows -c -Xassembler -mbig-obj %s 2>&1 | FileCheck %s --check-prefix=WINDOWS
+// RUN: not %clang --target=x86_64-linux -c -Wa,-mbig-obj %s 2>&1 | FileCheck %s --check-prefix=LINUX
+// RUN: not %clang --target=x86_64-linux -c -Xassembler -mbig-obj %s 2>&1 | FileCheck %s --check-prefix=LINUX
+// WINDOWS-NOT: argument unused during compilation
+// LINUX: unsupported argument '-mbig-obj' to option '{{(Wa,|Xassembler)}}'
+#ifdef _WIN32
+#warning "produce non-empty output for FileCheck"
+#endif




More information about the cfe-commits mailing list