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
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
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>&
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
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"
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
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`
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;
---
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
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
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
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
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
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
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
15 matches
Mail list logo