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

2023-07-10 Thread Valentin Clement via Phabricator via cfe-commits
clementval 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

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

2023-07-09 Thread Andrzej Warzynski via Phabricator via cfe-commits
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

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

2023-07-07 Thread Valentin Clement via Phabricator via cfe-commits
clementval added inline comments. Herald added a subscriber: sunshaoce. 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>&

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

2022-08-22 Thread Usman Nadeem via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGef5ede52efbf: [Flang][Driver] Add support for PIC (authored by mnadeem). Changed prior to commit: https://reviews.llvm.org/D131533?vs=453472&id=454574#toc Repository: rG LLVM Github Monorepo CHANGES

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

2022-08-22 Thread Usman Nadeem via Phabricator via cfe-commits
mnadeem marked 3 inline comments as done. mnadeem added inline comments. Comment at: clang/include/clang/Driver/Options.td:6320-6325 +def pic_level : Separate<["-"], "pic-level">, + HelpText<"Value for __PIC__">, + MarshallingInfoInt>; +def pic_is_pie : Flag<["-"], "pic-is-pie"

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

2022-08-22 Thread Andrzej Warzynski via Phabricator via cfe-commits
awarzynski accepted this revision. awarzynski added a comment. Thanks for all the updates and for working on this! I'm not an expert in the semantics of `-fpie`/`-fpic`/`-mrelocation-model`, but this basically replicates the logic in Clang and I am not aware of any good reasons for Flang to div

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

2022-08-20 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay added inline comments. This revision is now accepted and ready to land. Comment at: flang/test/Driver/pic-flags.f90:69 +! CHECK-ROPI: "-mrelocation-model" "ropi" +! CHECK-ROPI-NOT: -pic + I'd use `! CHECK-ROPI-NOT: "-pic`

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

2022-08-17 Thread Usman Nadeem via Phabricator via cfe-commits
mnadeem marked 9 inline comments as done. mnadeem added inline comments. Comment at: flang/lib/Frontend/CompilerInvocation.cpp:151 +static llvm::Reloc::Model getRelocationFromName(llvm::StringRef model) { + if (model.equals("static")) +return llvm::Reloc::Static; ---

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

2022-08-17 Thread Usman Nadeem via Phabricator via cfe-commits
mnadeem updated this revision to Diff 453472. mnadeem edited the summary of this revision. mnadeem added a subscriber: chrisj. mnadeem added a comment. - Moved mrelocation_model in Option.td to be near Codegen Options and put it in a `let` block. - Moved all the options from FrontendOptions to Co

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

2022-08-12 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: flang/lib/Frontend/CompilerInvocation.cpp:151 +static llvm::Reloc::Model getRelocationFromName(llvm::StringRef model) { + if (model.equals("static")) +return llvm::Reloc::Static; awarzynski wrote: > Only `-fpic` and

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

2022-08-12 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/include/clang/Driver/Options.td:6320-6325 +def pic_level : Separate<["-"], "pic-level">, + HelpText<"Value for __PIC__">, + MarshallingInfoInt>; +def pic_is_pie : Flag<["-"], "pic-is-pie">, + HelpText<"File is for a position ind

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

2022-08-12 Thread Andrzej Warzynski via Phabricator via cfe-commits
awarzynski added a comment. Left a few more comments and also added Diana as a reviewer. Would be good to get an extra pair of eyes on this :) Comment at: clang/include/clang/Driver/Options.td:6320-6325 +def pic_level : Separate<["-"], "pic-level">, + HelpText<"Value for __PI

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

2022-08-11 Thread Usman Nadeem via Phabricator via cfe-commits
mnadeem 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-NO

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

2022-08-10 Thread Andrzej Warzynski via Phabricator via cfe-commits
awarzynski added a comment. Many thanks for implementing this! I've only skimmed through so far, but mostly makes sense. Will take a closer look later. Could you update the summary by adding more detail? What options are enabled and whether the semantics from Clang are preserved or not (they sh

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

2022-08-09 Thread Usman Nadeem via Phabricator via cfe-commits
mnadeem created this revision. mnadeem added a project: Flang. Herald added a subscriber: jdoerfert. Herald added a reviewer: sscalpone. Herald added a reviewer: awarzynski. Herald added a project: All. mnadeem requested review of this revision. Herald added subscribers: cfe-commits, MaskRay. Heral