]> granicus.if.org Git - clang/commitdiff
Don't pass --build-id to ld by default.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 3 Jun 2016 17:26:16 +0000 (17:26 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 3 Jun 2016 17:26:16 +0000 (17:26 +0000)
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
include/clang/Config/config.h.cmake
lib/Driver/ToolChains.cpp

index f84ae47cb5f6f7f45db6aa35d8e6a5d54e4e5663..fce82295508bb4f7ea0ba9bd706fbdedbc6899bc 100644 (file)
@@ -197,6 +197,8 @@ set(GCC_INSTALL_PREFIX "" CACHE PATH "Directory where gcc is installed." )
 set(DEFAULT_SYSROOT "" CACHE PATH
   "Default <path> to all compiler invocations for --sysroot=<path>." )
 
+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
index 8917065da155b66329755d21a2404511e5a7c46f..09f5e4b3b36204d809ce89ca3e297a0509799719 100644 (file)
@@ -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
index 8242b96987676241524e9c974cef4304315d5463..eec4174d75318cdbf30c405dfca693d20651e746 100644 (file)
@@ -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");