[PATCH] D131533: [Flang][Driver] Enable PIC in the frontend

Andrzej Warzynski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 9 01:18:00 PDT 2023


awarzynski added inline comments.


================
Comment at: flang/test/Driver/pic-flags.f90:3
 
-! RUN: %flang -### %s --target=aarch64-linux-gnu 2>&1 | FileCheck %s --check-prefix=CHECK-NOPIE
-! RUN: %flang -### %s --target=aarch64-linux-gnu -fno-pie 2>&1 | FileCheck %s --check-prefix=CHECK-NOPIE
+! RUN: %flang -v -S -emit-llvm -o - %s --target=aarch64-linux-gnu 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-PIE-LEVEL2,CHECK-PIE-LEVEL2-IR
+! RUN: %flang -v -S -emit-llvm -o - %s --target=aarch64-linux-gnu -fpie 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-PIE-LEVEL1,CHECK-PIE-LEVEL1-IR
----------------
clementval wrote:
> This test has been failing on my side for very long time. Just curious why we check for PIE-LEVEL-2 when no level is given. Where is the default given?
> 
> On my machine I have `-mrelocation-model static` for this run line. 
> This test has been failing on my side for very long time. 

If this is failing for you then it should also fail on one of the Flang buildbots, right? Do you know what's different/special in your configuration?

> Where is the default given?

You want to check:
* [[ https://github.com/llvm/llvm-project/blob/2712b2805b47f10b3864ab19a4016ea306126ad7/clang/lib/Driver/ToolChains/Flang.cpp#L149-L168 | Flang::addPicOption ]] (Flang.cpp)
* [[ https://github.com/llvm/llvm-project/blob/2712b2805b47f10b3864ab19a4016ea306126ad7/clang/lib/Driver/ToolChains/CommonArgs.cpp#L1399 | ParsePICArgs ]] (CommonArgs.cpp)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131533/new/

https://reviews.llvm.org/D131533



More information about the cfe-commits mailing list