mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-19 13:16:46 +00:00
[flang][Driver] When linking with the Fortran runtime also link with libexecinfo (#125998)
Also link with libexecinfo on FreeBSD, NetBSD, OpenBSD and DragonFly for the backtrace functions.
This commit is contained in:
parent
78f690bba7
commit
d1de75acea
@ -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
|
||||
|
@ -5,10 +5,10 @@
|
||||
! RUN: %flang -### --target=ppc64le-linux-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,UNIX,UNIX-F128%f128-lib
|
||||
! RUN: %flang -### --target=aarch64-apple-darwin %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,DARWIN,DARWIN-F128%f128-lib
|
||||
! RUN: %flang -### --target=sparc-sun-solaris2.11 %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,UNIX,SOLARIS-F128%f128-lib
|
||||
! RUN: %flang -### --target=x86_64-unknown-freebsd %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,UNIX,UNIX-F128%f128-lib
|
||||
! RUN: %flang -### --target=x86_64-unknown-netbsd %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,UNIX,UNIX-F128%f128-lib
|
||||
! RUN: %flang -### --target=x86_64-unknown-openbsd %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,UNIX,UNIX-F128%f128-lib
|
||||
! RUN: %flang -### --target=x86_64-unknown-dragonfly %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,UNIX,UNIX-F128%f128-lib
|
||||
! RUN: %flang -### --target=x86_64-unknown-freebsd %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,BSD,BSD-F128%f128-lib
|
||||
! RUN: %flang -### --target=x86_64-unknown-netbsd %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,BSD,BSD-F128%f128-lib
|
||||
! RUN: %flang -### --target=x86_64-unknown-openbsd %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,BSD,BSD-F128%f128-lib
|
||||
! RUN: %flang -### --target=x86_64-unknown-dragonfly %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,BSD,BSD-F128%f128-lib
|
||||
! RUN: %flang -### --target=x86_64-unknown-haiku %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,HAIKU,HAIKU-F128%f128-lib
|
||||
! RUN: %flang -### --target=x86_64-windows-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,MINGW,MINGW-F128%f128-lib
|
||||
! RUN: %flang -### -rtlib=compiler-rt --target=aarch64-linux-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,UNIX,COMPILER-RT
|
||||
@ -36,6 +36,14 @@
|
||||
! UNIX-SAME: "-lFortranRuntime" "-lFortranDecimal" "-lm"
|
||||
! COMPILER-RT: "{{.*}}{{\\|/}}libclang_rt.builtins.a"
|
||||
|
||||
! BSD-LABEL: "{{.*}}ld{{(\.exe)?}}"
|
||||
! BSD-SAME: "[[object_file]]"
|
||||
! BSD-F128NONE-NOT: FortranFloat128Math
|
||||
! BSD-F128LIBQUADMATH-SAME: "-lFortranFloat128Math" "--as-needed" "-lquadmath" "--no-as-needed"
|
||||
! BSD-SAME: -lFortranRuntime
|
||||
! BSD-SAME: -lFortranDecimal
|
||||
! BSD-SAME: -lexecinfo
|
||||
|
||||
! DARWIN-LABEL: "{{.*}}ld{{(\.exe)?}}"
|
||||
! DARWIN-SAME: "[[object_file]]"
|
||||
! DARWIN-F128NONE-NOT: FortranFloat128Math
|
||||
|
Loading…
x
Reference in New Issue
Block a user