[flang] Fixed driver link LIT test for PPC targets.#134320
Conversation
After llvm#131041, the F128 libraries are not linked for PPC targets even when the driver is built with FLANG_RUNTIME_F128_MATH_LIB.
|
@llvm/pr-subscribers-flang-driver Author: Slava Zakharin (vzakhari) ChangesAfter #131041, the F128 libraries are not linked for PPC targets even when Full diff: https://github.com/llvm/llvm-project/pull/134320.diff 1 Files Affected:
diff --git a/flang/test/Driver/linker-flags.f90 b/flang/test/Driver/linker-flags.f90
index 4e62a8c32d360..20104276d2e4a 100644
--- a/flang/test/Driver/linker-flags.f90
+++ b/flang/test/Driver/linker-flags.f90
@@ -2,7 +2,7 @@
! invocation. These libraries are added on top of other standard runtime
! libraries that the Clang driver will include.
-! 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=ppc64le-linux-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,UNIX,UNIX-F128NONE
! 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,BSD,BSD-F128%f128-lib
|
DanielCChen
left a comment
There was a problem hiding this comment.
Thanks for fixing the failure!
This is actually how it is run on LoP, which is why I couldn't reproduce it.
/scratch/cdchen/FLANG/build/bin/flang -### --target=ppc64le-linux-gnu /scratch/cdchen/FLANG/llvm-project/flang/test/Driver/Inputs/hello.f90 2>&1 | /scratch/cdchen/FLANG/build/bin/FileCheck /scratch/cdchen/FLANG/llvm-project/flang/test/Driver/linker-flags.f90 --check-prefixes=CHECK,UNIX,UNIX-F128NONE # RUN: at line 5
|
The failure is indeed a regression. The system I ran the test didn't have GCC libquadmath installed, but we should still link it for the ones that have it installed. I posted PR #134362 to fix it. |
…e.a. (#134362) The PR is to generalize the re-use of the `compilerRT` code of adding the path of `libflang_rt.runtime.a (so)` from AIX and LoP only to all platforms via a new function `addFlangRTLibPath`. It also added `-static-libflangrt` and `-shared-libflangrt` compiler options to allow users choosing which `flang-rt` to link to. It defaults to shared `flang-rt`, which is consistent with the linker behavior, except on AIX, it defaults to static. Also, PR #134320 exposed an issue in PR #131041 that the the overriding `addFortranRuntimeLibs` is missing the link to `libquadmath`. This PR also fixed that and restored the test case that PR #131041 broke.
Local branch origin/amd-gfx b327f5f Merged main:b61e3874fa97 into origin/amd-gfx:01fc438e22db Remote branch main 65b85bf [flang] Fixed driver link LIT test for PPC targets. (llvm#134320)
After #131041, the F128 libraries are not linked for PPC targets even when
the driver is built with FLANG_RUNTIME_F128_MATH_LIB.