Skip to content

[flang] Fixed driver link LIT test for PPC targets. #134320

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

Merged
merged 1 commit into from
Apr 3, 2025

Conversation

vzakhari
Copy link
Contributor

@vzakhari vzakhari commented Apr 3, 2025

After #131041, the F128 libraries are not linked for PPC targets even when
the driver is built with FLANG_RUNTIME_F128_MATH_LIB.

After llvm#131041, the F128 libraries are not linked for PPC targets even when
the driver is built with FLANG_RUNTIME_F128_MATH_LIB.
@llvmbot llvmbot added flang:driver flang Flang issues not falling into any other category labels Apr 3, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 3, 2025

@llvm/pr-subscribers-flang-driver

Author: Slava Zakharin (vzakhari)

Changes

After #131041, the F128 libraries are not linked for PPC targets even when
the driver is built with FLANG_RUNTIME_F128_MATH_LIB.


Full diff: https://github.com/llvm/llvm-project/pull/134320.diff

1 Files Affected:

  • (modified) flang/test/Driver/linker-flags.f90 (+1-1)
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

Copy link
Contributor

@DanielCChen DanielCChen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@vzakhari vzakhari merged commit 65b85bf into llvm:main Apr 3, 2025
12 of 14 checks passed
@DanielCChen
Copy link
Contributor

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.

DanielCChen added a commit that referenced this pull request Apr 13, 2025
…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.
var-const pushed a commit to ldionne/llvm-project that referenced this pull request Apr 17, 2025
…e.a. (llvm#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 llvm#134320 exposed an issue in PR llvm#131041 that the the overriding
`addFortranRuntimeLibs` is missing the link to `libquadmath`. This PR
also fixed that and restored the test case that PR llvm#131041 broke.
qiaojbao pushed a commit to GPUOpen-Drivers/llvm-project that referenced this pull request Apr 29, 2025
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:driver flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants