From ac0217424cb4e040236b15f2f78ad69e09502ce7 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Fri, 7 Jun 2013 23:25:01 +0000 Subject: When we're compiling with -pg make sure to link with gcrt1.o on linux. Be sure to do this always, this matches the behavior for the gcc driver. Fixes PR16251. Based on a patch by Qiao Yang. llvm-svn: 183591 --- clang/lib/Driver/Tools.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/Driver/Tools.cpp') diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 8e670dbf0a3..c407a3bb805 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -6076,7 +6076,9 @@ void gnutools::Link::ConstructJob(Compilation &C, const JobAction &JA, if (!isAndroid) { const char *crt1 = NULL; if (!Args.hasArg(options::OPT_shared)){ - if (IsPIE) + if (Args.hasArg(options::OPT_pg)) + crt1 = "gcrt1.o"; + else if (IsPIE) crt1 = "Scrt1.o"; else crt1 = "crt1.o"; -- cgit v1.2.3