From 4e6e791dc53654dd1e6258829d5c3a1e059b11c3 Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Wed, 4 Jul 2012 00:18:41 +0000 Subject: [PATCH] Move a comment from the commit message into the code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159696 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 01792ae11f..a558c1ff96 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -4341,6 +4341,11 @@ void darwin::Link::ConstructJob(Compilation &C, const JobAction &JA, // darwin_crt2 spec is empty. } + // By default on OS X 10.8 and later, we don't link with a crt1.o + // file and the linker knows to use _main as the entry point. But, + // when compiling with -pg, we need to link with the gcrt1.o file, + // so pass the -no_new_main option to tell the linker to use the + // "start" symbol as the entry point. if (getDarwinToolChain().isTargetMacOS() && !getDarwinToolChain().isMacosxVersionLT(10, 8)) CmdArgs.push_back("-no_new_main"); -- 2.40.0