[Profile] Always build profile runtime library with -fPIC.
This change removes libclang_rt.profile-pic-<arch>.a version of
profile runtime. Instead, it's sufficient to always build
libclang_rt.profile-<arch>.a with -fPIC, as it can be linked into
both executables and shared objects.
llvm-svn: 221952
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 042d7b1..a648d61 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -2181,16 +2181,10 @@
Args.hasArg(options::OPT_coverage)))
return;
- // -fprofile-instr-generate requires position-independent code to build with
- // shared objects. Link against the right archive.
- const char *Lib = "libclang_rt.profile-";
- if (Args.hasArg(options::OPT_fprofile_instr_generate) &&
- Args.hasArg(options::OPT_shared))
- Lib = "libclang_rt.profile-pic-";
-
SmallString<128> LibProfile = getCompilerRTLibDir(TC);
- llvm::sys::path::append(LibProfile,
- Twine(Lib) + getArchNameForCompilerRTLib(TC) + ".a");
+ llvm::sys::path::append(LibProfile, Twine("libclang_rt.profile-") +
+ getArchNameForCompilerRTLib(TC) +
+ ".a");
CmdArgs.push_back(Args.MakeArgString(LibProfile));
}