-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[flang][Driver] When linking with the Fortran runtime also link with libexecinfo #125998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-clang @llvm/pr-subscribers-flang-driver Author: Brad Smith (brad0) ChangesAlso link with libexecinfo on FreeBSD, NetBSD, OpenBSD and DragonFly Full diff: https://github.com/llvm/llvm-project/pull/125998.diff 2 Files Affected:
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index c3c22a419f352a3..699aadec86dcba9 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1340,6 +1340,11 @@ void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,
CmdArgs.push_back("-lFortranRuntime");
CmdArgs.push_back("-lFortranDecimal");
addArchSpecificRPath(TC, Args, CmdArgs);
+
+ // needs libexecinfo for backtrace functions
+ if (TC.getTriple().isOSFreeBSD() || TC.getTriple().isOSNetBSD() ||
+ TC.getTriple().isOSOpenBSD() || TC.getTriple().isOSDragonFly())
+ CmdArgs.push_back("-lexecinfo");
}
// libomp needs libatomic for atomic operations if using libgcc
diff --git a/flang/test/Driver/backtrace.f90 b/flang/test/Driver/backtrace.f90
new file mode 100644
index 000000000000000..eb7f2208e5bbd4e
--- /dev/null
+++ b/flang/test/Driver/backtrace.f90
@@ -0,0 +1,3 @@
+!RUN: %flang --target=aarch64-unknown-openbsd -### %s 2>&1 | FileCheck --check-prefixes=BACKTRACE %s
+
+!BACKTRACE: -lexecinfo
|
3e25ca7
to
f2c9214
Compare
…libexecinfo Also link with libexecinfo on FreeBSD, NetBSD, OpenBSD and DragonFly for the backtrace functions.
f2c9214
to
a4e5949
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for coming back to this @brad0
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/14191 Here is the relevant piece of the build log for the reference
|
…libexecinfo (llvm#125998) Also link with libexecinfo on FreeBSD, NetBSD, OpenBSD and DragonFly for the backtrace functions. (cherry picked from commit d1de75a)
…libexecinfo (llvm#125998) Also link with libexecinfo on FreeBSD, NetBSD, OpenBSD and DragonFly for the backtrace functions.
Also link with libexecinfo on FreeBSD, NetBSD, OpenBSD and DragonFly
for the backtrace functions.