From: Rafael Espindola Date: Mon, 6 Apr 2015 04:36:45 +0000 (+0000) Subject: This reverts commit r234104, bringing back 233393 now that ARM is fixed. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=29aa637b377c467a089b7b8a589cc211b26018a5;p=clang This reverts commit r234104, bringing back 233393 now that ARM is fixed. Original message: Don't use unique section names by default if using the integrated as. This saves some IO and ccache space by not creating long section names. It should work with every ELF linker. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234143 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 6f8751d5ca..7b661a7c88 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -3104,8 +3104,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, Args.hasArg(options::OPT_dA)) CmdArgs.push_back("-masm-verbose"); - if (!Args.hasFlag(options::OPT_fintegrated_as, options::OPT_fno_integrated_as, - IsIntegratedAssemblerDefault)) + bool UsingIntegratedAssembler = + Args.hasFlag(options::OPT_fintegrated_as, options::OPT_fno_integrated_as, + IsIntegratedAssemblerDefault); + if (!UsingIntegratedAssembler) CmdArgs.push_back("-no-integrated-as"); if (Args.hasArg(options::OPT_fdebug_pass_structure)) { @@ -3349,7 +3351,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, } if (!Args.hasFlag(options::OPT_funique_section_names, - options::OPT_fno_unique_section_names, true)) + options::OPT_fno_unique_section_names, + !UsingIntegratedAssembler)) CmdArgs.push_back("-fno-unique-section-names"); Args.AddAllArgs(CmdArgs, options::OPT_finstrument_functions); diff --git a/test/Driver/function-sections.c b/test/Driver/function-sections.c index ba065b1367..6c243195f6 100644 --- a/test/Driver/function-sections.c +++ b/test/Driver/function-sections.c @@ -72,3 +72,13 @@ // RUN: -target i386-unknown-linux \ // RUN: -fno-unique-section-names \ // RUN: | FileCheck --check-prefix=CHECK-NOUS %s + +// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: -target i386-unknown-linux \ +// RUN: -fno-integrated-as \ +// RUN: | FileCheck --check-prefix=CHECK-US %s + +// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ +// RUN: -target i386-unknown-linux \ +// RUN: -fintegrated-as \ +// RUN: | FileCheck --check-prefix=CHECK-NOUS %s