From 420621a91c69d847f7f3c3f2284cf42b8304c647 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 3 Jun 2016 17:26:16 +0000 Subject: [PATCH] Don't pass --build-id to ld by default. We now have a cmake option to change the default: ENABLE_LINKER_BUILD_ID. The reason is that build-id is fairly expensive, so we shouldn't impose it in the regular edit/build cycle. This is similar to gcc, that has an off by default --enable-linker-build-id option. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271692 91177308-0d34-0410-b5e6-96231b3b80d8 --- CMakeLists.txt | 2 ++ include/clang/Config/config.h.cmake | 3 +++ lib/Driver/ToolChains.cpp | 7 +++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f84ae47cb5..fce8229550 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,6 +197,8 @@ set(GCC_INSTALL_PREFIX "" CACHE PATH "Directory where gcc is installed." ) set(DEFAULT_SYSROOT "" CACHE PATH "Default to all compiler invocations for --sysroot=." ) +set(ENABLE_LINKER_BUILD_ID OFF CACHE BOOL "pass --build-id to ld") + set(CLANG_DEFAULT_CXX_STDLIB "" CACHE STRING "Default C++ stdlib to use (empty for architecture default, \"libstdc++\" or \"libc++\"") if (NOT(CLANG_DEFAULT_CXX_STDLIB STREQUAL "" OR diff --git a/include/clang/Config/config.h.cmake b/include/clang/Config/config.h.cmake index 8917065da1..09f5e4b3b3 100644 --- a/include/clang/Config/config.h.cmake +++ b/include/clang/Config/config.h.cmake @@ -38,4 +38,7 @@ /* Linker version detected at compile time. */ #cmakedefine HOST_LINK_VERSION "${HOST_LINK_VERSION}" +/* pass --build-id to ld */ +#cmakedefine ENABLE_LINKER_BUILD_ID + #endif diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 8242b96987..eec4174d75 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -3978,10 +3978,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) if (IsRedhat(Distro) && Distro != RHEL5 && Distro != RHEL6) ExtraOpts.push_back("--no-add-needed"); - if ((IsDebian(Distro) && Distro >= DebianSqueeze) || IsOpenSUSE(Distro) || - (IsRedhat(Distro) && Distro != RHEL5) || - (IsUbuntu(Distro) && Distro >= UbuntuKarmic)) - ExtraOpts.push_back("--build-id"); +#ifdef ENABLE_LINKER_BUILD_ID + ExtraOpts.push_back("--build-id"); +#endif if (IsOpenSUSE(Distro)) ExtraOpts.push_back("--enable-new-dtags"); -- 2.40.0