Xiangling_L updated this revision to Diff 299991. Xiangling_L marked an inline comment as done. Xiangling_L added a comment.
Fix the formatting issues; CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89897/new/ https://reviews.llvm.org/D89897 Files: clang/lib/Driver/ToolChains/Clang.cpp clang/test/Driver/aix-err-options.c llvm/CMakeLists.txt Index: llvm/CMakeLists.txt =================================================================== --- llvm/CMakeLists.txt +++ llvm/CMakeLists.txt @@ -930,7 +930,7 @@ # Modules should be built with -G, so we can use runtime linking with # plugins. - string(APPEND CMAKE_MODULE_LINKER_FLAGS " -G") + string(APPEND CMAKE_MODULE_LINKER_FLAGS " -Wl,-G") # Also set the correct flags for building shared libraries. string(APPEND CMAKE_SHARED_LINKER_FLAGS " -shared") Index: clang/test/Driver/aix-err-options.c =================================================================== --- /dev/null +++ clang/test/Driver/aix-err-options.c @@ -0,0 +1,7 @@ +// RUN: %clang -target powerpc32-ibm-aix-xcoff -### -S -emit-llvm -G 0 2>&1 %s | \ +// RUN: FileCheck --check-prefix=CHECK32 %s +// RUN: %clang -target powerpc64-ibm-aix-xcoff -### -S -emit-llvm -G 0 2>&1 %s | \ +// RUN: FileCheck --check-prefix=CHECK64 %s + +// CHECK32: error: unsupported option '-G' for target 'powerpc32-ibm-aix-xcoff' +// CHECK64: error: unsupported option '-G' for target 'powerpc64-ibm-aix-xcoff' Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -4958,6 +4958,11 @@ if (D.CCGenDiagnostics) CmdArgs.push_back("-disable-pragma-debug-crash"); + if (RawTriple.isOSAIX()) + if (Arg *A = Args.getLastArg(options::OPT_G)) + D.Diag(diag::err_drv_unsupported_opt_for_target) + << A->getSpelling() << RawTriple.str(); + bool UseSeparateSections = isUseSeparateSections(Triple); if (Args.hasFlag(options::OPT_ffunction_sections,
Index: llvm/CMakeLists.txt =================================================================== --- llvm/CMakeLists.txt +++ llvm/CMakeLists.txt @@ -930,7 +930,7 @@ # Modules should be built with -G, so we can use runtime linking with # plugins. - string(APPEND CMAKE_MODULE_LINKER_FLAGS " -G") + string(APPEND CMAKE_MODULE_LINKER_FLAGS " -Wl,-G") # Also set the correct flags for building shared libraries. string(APPEND CMAKE_SHARED_LINKER_FLAGS " -shared") Index: clang/test/Driver/aix-err-options.c =================================================================== --- /dev/null +++ clang/test/Driver/aix-err-options.c @@ -0,0 +1,7 @@ +// RUN: %clang -target powerpc32-ibm-aix-xcoff -### -S -emit-llvm -G 0 2>&1 %s | \ +// RUN: FileCheck --check-prefix=CHECK32 %s +// RUN: %clang -target powerpc64-ibm-aix-xcoff -### -S -emit-llvm -G 0 2>&1 %s | \ +// RUN: FileCheck --check-prefix=CHECK64 %s + +// CHECK32: error: unsupported option '-G' for target 'powerpc32-ibm-aix-xcoff' +// CHECK64: error: unsupported option '-G' for target 'powerpc64-ibm-aix-xcoff' Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -4958,6 +4958,11 @@ if (D.CCGenDiagnostics) CmdArgs.push_back("-disable-pragma-debug-crash"); + if (RawTriple.isOSAIX()) + if (Arg *A = Args.getLastArg(options::OPT_G)) + D.Diag(diag::err_drv_unsupported_opt_for_target) + << A->getSpelling() << RawTriple.str(); + bool UseSeparateSections = isUseSeparateSections(Triple); if (Args.hasFlag(options::OPT_ffunction_sections,
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits