From 6a156a84aeb7cb74aa8b95639ae73e57fb2aaa04 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Tue, 17 Jul 2018 23:56:30 +0000 Subject: [PATCH] Revert r337333, "Teach Clang to emit address-significance tables." Causing multiple failures on sanitizer bots due to TLS symbol errors, e.g. /usr/bin/ld: __msan_origin_tls: TLS definition in /home/buildbots/ppc64be-clang-test/clang-ppc64be/stage1/lib/clang/7.0.0/lib/linux/libclang_rt.msan-powerpc64.a(msan.cc.o) section .tbss.__msan_origin_tls mismatches non-TLS reference in /tmp/lit_tmp_0a71tA/mallinfo-3ca75e.o git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337336 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/ReleaseNotes.rst | 8 -------- docs/UsersManual.rst | 9 --------- include/clang/Driver/Options.td | 4 ---- include/clang/Frontend/CodeGenOptions.def | 3 --- lib/CodeGen/BackendUtil.cpp | 1 - lib/Driver/ToolChains/Clang.cpp | 5 ----- lib/Frontend/CompilerInvocation.cpp | 2 -- test/CodeGen/addrsig.c | 18 ------------------ test/Driver/addrsig.c | 8 -------- 9 files changed, 58 deletions(-) delete mode 100644 test/CodeGen/addrsig.c delete mode 100644 test/Driver/addrsig.c diff --git a/docs/ReleaseNotes.rst b/docs/ReleaseNotes.rst index 99be2fdfe0..c0ce10d6eb 100644 --- a/docs/ReleaseNotes.rst +++ b/docs/ReleaseNotes.rst @@ -98,14 +98,6 @@ Non-comprehensive list of changes in this release finding out the warning hierarchy, and which of them are enabled by default or for a particular compiler invocation. -- By default, Clang emits an address-significance table into - every ELF object file when using the integrated assembler. - Address-significance tables allow linkers to implement `safe ICF - `_ without the false - positives that can result from other implementation techniques such as - relocation scanning. The ``-faddrsig`` and ``-fno-addrsig`` flags can be - used to control whether to emit the address-significance table. - - ... New Compiler Flags diff --git a/docs/UsersManual.rst b/docs/UsersManual.rst index 418afb2d54..4470dab947 100644 --- a/docs/UsersManual.rst +++ b/docs/UsersManual.rst @@ -1382,15 +1382,6 @@ are listed below. // value of -fmax-type-align. } -.. option:: -faddrsig, -fno-addrsig - - Controls whether Clang emits an address-significance table into the object - file. Address-significance tables allow linkers to implement `safe ICF - `_ without the false - positives that can result from other implementation techniques such as - relocation scanning. Address-significance tables are enabled by default - on ELF targets when using the integrated assembler. This flag currently - only has an effect on ELF targets. Profile Guided Optimization --------------------------- diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index b71d1e15ae..9035a91ce2 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -758,10 +758,6 @@ def fno_profile_instr_use : Flag<["-"], "fno-profile-instr-use">, def fno_profile_use : Flag<["-"], "fno-profile-use">, Alias; -def faddrsig : Flag<["-"], "faddrsig">, Group, Flags<[CoreOption, CC1Option]>, - HelpText<"Emit an address-significance table">; -def fno_addrsig : Flag<["-"], "fno-addrsig">, Group, Flags<[CoreOption]>, - HelpText<"Don't emit an address-significance table">; def fblocks : Flag<["-"], "fblocks">, Group, Flags<[CC1Option]>, HelpText<"Enable the 'blocks' language feature">; def fbootclasspath_EQ : Joined<["-"], "fbootclasspath=">, Group; diff --git a/include/clang/Frontend/CodeGenOptions.def b/include/clang/Frontend/CodeGenOptions.def index c199b5428e..99567e04ba 100644 --- a/include/clang/Frontend/CodeGenOptions.def +++ b/include/clang/Frontend/CodeGenOptions.def @@ -335,9 +335,6 @@ CODEGENOPT(EmbedSource, 1, 0) /// Whether to emit all vtables CODEGENOPT(ForceEmitVTables, 1, 0) -/// Whether to emit an address-significance table into the object file. -CODEGENOPT(Addrsig, 1, 0) - #undef CODEGENOPT #undef ENUM_CODEGENOPT diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index 415bd96262..226a27b216 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -454,7 +454,6 @@ static void initTargetOptions(llvm::TargetOptions &Options, Options.ExplicitEmulatedTLS = CodeGenOpts.ExplicitEmulatedTLS; Options.DebuggerTuning = CodeGenOpts.getDebuggerTuning(); Options.EmitStackSizeSection = CodeGenOpts.StackSizeSection; - Options.EmitAddrsig = CodeGenOpts.Addrsig; if (CodeGenOpts.EnableSplitDwarf) Options.MCOptions.SplitDwarfFile = CodeGenOpts.SplitDwarfFile; diff --git a/lib/Driver/ToolChains/Clang.cpp b/lib/Driver/ToolChains/Clang.cpp index 4db4dc19a8..e7b15c7ad8 100644 --- a/lib/Driver/ToolChains/Clang.cpp +++ b/lib/Driver/ToolChains/Clang.cpp @@ -4777,11 +4777,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, } } - if (Args.hasFlag(options::OPT_faddrsig, options::OPT_fno_addrsig, - getToolChain().getTriple().isOSBinFormatELF() && - getToolChain().useIntegratedAs())) - CmdArgs.push_back("-faddrsig"); - // Finally add the compile command to the compilation. if (Args.hasArg(options::OPT__SLASH_fallback) && Output.getType() == types::TY_Object && diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index c26d5fb79b..d62429dc78 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -1119,8 +1119,6 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.EmitVersionIdentMetadata = Args.hasFlag(OPT_Qy, OPT_Qn, true); - Opts.Addrsig = Args.hasArg(OPT_faddrsig); - return Success; } diff --git a/test/CodeGen/addrsig.c b/test/CodeGen/addrsig.c deleted file mode 100644 index 2cbdb2b554..0000000000 --- a/test/CodeGen/addrsig.c +++ /dev/null @@ -1,18 +0,0 @@ -// RUN: %clang_cc1 -triple=x86_64-unknown-linux -S %s -faddrsig -O -o - | FileCheck --check-prefix=ADDRSIG %s -// RUN: %clang_cc1 -triple=x86_64-unknown-linux -S %s -O -o - | FileCheck --check-prefix=NO-ADDRSIG %s - -// ADDRSIG: .addrsig -// ADDRSIG: .addrsig_sym g1 -// ADDRSIG-NOT: .addrsig_sym g2 - -// NO-ADDRSIG-NOT: .addrsig - -extern const int g1[], g2[]; - -const int *f1() { - return g1; -} - -int f2() { - return g2[0]; -} diff --git a/test/Driver/addrsig.c b/test/Driver/addrsig.c deleted file mode 100644 index fd5598c472..0000000000 --- a/test/Driver/addrsig.c +++ /dev/null @@ -1,8 +0,0 @@ -// RUN: %clang -### -target x86_64-unknown-linux -c %s 2>&1 | FileCheck -check-prefix=ADDRSIG %s -// RUN: %clang -### -target x86_64-unknown-linux -fno-integrated-as -c %s 2>&1 | FileCheck -check-prefix=NO-ADDRSIG %s -// RUN: %clang -### -target x86_64-unknown-linux -fno-integrated-as -faddrsig -c %s 2>&1 | FileCheck -check-prefix=ADDRSIG %s -// RUN: %clang -### -target x86_64-unknown-linux -fno-addrsig -c %s 2>&1 | FileCheck -check-prefix=NO-ADDRSIG %s -// RUN: %clang -### -target x86_64-apple-darwin -c %s 2>&1 | FileCheck -check-prefix=NO-ADDRSIG %s - -// ADDRSIG: -faddrsig -// NO-ADDRSIG-NOT: -faddrsig -- 2.40.0