Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F161880819
D30861.id91415.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D30861.id91415.diff
View Options
diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp
--- a/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -293,6 +293,8 @@
addLinkerCompressDebugSectionsOption(ToolChain, Args, CmdArgs);
AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
+ bool Profiling = Args.hasArg(options::OPT_pg) &&
+ ToolChain.getTriple().getOSMajorVersion() < 14;
if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
// Use the static OpenMP runtime with -static-openmp
bool StaticOpenMP = Args.hasArg(options::OPT_static_openmp) &&
@@ -302,7 +304,7 @@
if (D.CCCIsCXX()) {
if (ToolChain.ShouldLinkCXXStdlib(Args))
ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
- if (Args.hasArg(options::OPT_pg))
+ if (Profiling)
CmdArgs.push_back("-lm_p");
else
CmdArgs.push_back("-lm");
@@ -313,13 +315,13 @@
linkXRayRuntimeDeps(ToolChain, CmdArgs);
// FIXME: For some reason GCC passes -lgcc and -lgcc_s before adding
// the default system libraries. Just mimic this for now.
- if (Args.hasArg(options::OPT_pg))
+ if (Profiling)
CmdArgs.push_back("-lgcc_p");
else
CmdArgs.push_back("-lgcc");
if (Args.hasArg(options::OPT_static)) {
CmdArgs.push_back("-lgcc_eh");
- } else if (Args.hasArg(options::OPT_pg)) {
+ } else if (Profiling) {
CmdArgs.push_back("-lgcc_eh_p");
} else {
CmdArgs.push_back("--as-needed");
@@ -328,13 +330,13 @@
}
if (Args.hasArg(options::OPT_pthread)) {
- if (Args.hasArg(options::OPT_pg))
+ if (Profiling)
CmdArgs.push_back("-lpthread_p");
else
CmdArgs.push_back("-lpthread");
}
- if (Args.hasArg(options::OPT_pg)) {
+ if (Profiling) {
if (Args.hasArg(options::OPT_shared))
CmdArgs.push_back("-lc");
else
@@ -347,7 +349,7 @@
if (Args.hasArg(options::OPT_static)) {
CmdArgs.push_back("-lgcc_eh");
- } else if (Args.hasArg(options::OPT_pg)) {
+ } else if (Profiling) {
CmdArgs.push_back("-lgcc_eh_p");
} else {
CmdArgs.push_back("--as-needed");
@@ -416,7 +418,8 @@
void FreeBSD::AddCXXStdlibLibArgs(const ArgList &Args,
ArgStringList &CmdArgs) const {
CXXStdlibType Type = GetCXXStdlibType(Args);
- bool Profiling = Args.hasArg(options::OPT_pg);
+ bool Profiling =
+ Args.hasArg(options::OPT_pg) && getTriple().getOSMajorVersion() < 14;
switch (Type) {
case ToolChain::CST_Libcxx:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jul 8, 4:37 PM (5 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34852012
Default Alt Text
D30861.id91415.diff (2 KB)
Attached To
Mode
D30861: Clang: stop linking _p libs for -pg as of FreeBSD 14
Attached
Detach File
Event Timeline
Log In to Comment