[llvm-branch-commits] [cfe-branch] r206058 - Merging r205144:
Tom Stellard
thomas.stellard at amd.com
Fri Apr 11 12:36:49 PDT 2014
Author: tstellar
Date: Fri Apr 11 14:36:49 2014
New Revision: 206058
URL: http://llvm.org/viewvc/llvm-project?rev=206058&view=rev
Log:
Merging r205144:
------------------------------------------------------------------------
r205144 | hfinkel | 2014-03-30 09:00:06 -0400 (Sun, 30 Mar 2014) | 7 lines
[PowerPC] Make -pg generate calls to _mcount not mcount
At least on REL6 (Linux/glibc 2.12), the proper symbol for generating gprof
data is _mcount, not mcount. Prior to this change, compiling with -pg would
generate linking errors (because of unresolved references to mcount), after
this change -pg seems at least minimally functional.
------------------------------------------------------------------------
Modified:
cfe/branches/release_34/lib/Basic/Targets.cpp
cfe/branches/release_34/test/CodeGen/mcount.c
Modified: cfe/branches/release_34/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_34/lib/Basic/Targets.cpp?rev=206058&r1=206057&r2=206058&view=diff
==============================================================================
--- cfe/branches/release_34/lib/Basic/Targets.cpp (original)
+++ cfe/branches/release_34/lib/Basic/Targets.cpp Fri Apr 11 14:36:49 2014
@@ -358,6 +358,16 @@ public:
LinuxTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) {
this->UserLabelPrefix = "";
this->WIntType = TargetInfo::UnsignedInt;
+
+ switch (Triple.getArch()) {
+ default:
+ break;
+ case llvm::Triple::ppc:
+ case llvm::Triple::ppc64:
+ case llvm::Triple::ppc64le:
+ this->MCountName = "_mcount";
+ break;
+ }
}
virtual const char *getStaticInitSectionSpecifier() const {
Modified: cfe/branches/release_34/test/CodeGen/mcount.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_34/test/CodeGen/mcount.c?rev=206058&r1=206057&r2=206058&view=diff
==============================================================================
--- cfe/branches/release_34/test/CodeGen/mcount.c (original)
+++ cfe/branches/release_34/test/CodeGen/mcount.c Fri Apr 11 14:36:49 2014
@@ -1,4 +1,8 @@
// RUN: %clang_cc1 -pg -triple i386-unknown-unknown -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -pg -triple powerpc-unknown-gnu-linux -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-PPC %s
+// RUN: %clang_cc1 -pg -triple powerpc64-unknown-gnu-linux -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-PPC %s
+// RUN: %clang_cc1 -pg -triple powerpc64le-unknown-gnu-linux -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-PPC %s
void foo(void) {
// CHECK: call void @mcount()
+// CHECK-PPC: call void @_mcount()
}
More information about the llvm-branch-commits
mailing list