[flang] [clang] [flang][Driver] Support -rpath, -shared, and -static in the frontend (PR #66702)

2023-11-13 Thread Andrzej Warzyński via cfe-commits
@@ -48,3 +48,17 @@ ! MSVC-SAME: FortranDecimal.lib ! MSVC-SAME: /subsystem:console ! MSVC-SAME: "[[object_file]]" + +! Verify that certain linker flags are known to the frontend and are passed on +! to the linker. + +! RUN: %flang -### --target=x86_64-linux-gnu -rpath /path/to/

[flang] [clang] [flang][Driver] Support -rpath, -shared, and -static in the frontend (PR #66702)

2023-11-13 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: > @banach-space Is this patch OK with you? Yup, I'm ok with this direction. Made a few small suggestions, but nothing substantial. https://github.com/llvm/llvm-project/pull/66702 ___ cfe-commits mailing list cfe-commits@lists.llvm

[clang] [flang] [flang] Add depdendent-lib option to flang -fc1 on Windows (PR #72121)

2023-11-13 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space edited https://github.com/llvm/llvm-project/pull/72121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang] Add depdendent-lib option to flang -fc1 on Windows (PR #72121)

2023-11-13 Thread Andrzej Warzyński via cfe-commits
@@ -1054,6 +1054,27 @@ static bool parseVScaleArgs(CompilerInvocation &invoc, llvm::opt::ArgList &args, return true; } +static bool parseLinkerOptionsArgs(CompilerInvocation &invoc, + llvm::opt::ArgList &args, +

[flang] [clang] [flang] Add depdendent-lib option to flang -fc1 on Windows (PR #72121)

2023-11-13 Thread Andrzej Warzyński via cfe-commits
@@ -0,0 +1,7 @@ + +! RUN: %flang_fc1 -emit-mlir -triple aarch64-pc-windows-msvc --dependent-lib=libtest %s -o - 2>&1 | FileCheck %s +! RUN: %flang_fc1 -emit-mlir -triple x86_64-pc-windows-msvc --dependent-lib=libtest %s -o - 2>&1 | FileCheck %s + +! CHECK: llvm.linker_options ["

[flang] [clang] [flang] Add depdendent-lib option to flang -fc1 on Windows (PR #72121)

2023-11-13 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space commented: Great to see contributions for supporting Windows, thank you David! https://github.com/llvm/llvm-project/pull/72121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[flang] [clang] [flang] Add depdendent-lib option to flang -fc1 on Windows (PR #72121)

2023-11-13 Thread Andrzej Warzyński via cfe-commits
@@ -0,0 +1,7 @@ + +! RUN: %flang_fc1 -emit-mlir -triple aarch64-pc-windows-msvc --dependent-lib=libtest %s -o - 2>&1 | FileCheck %s +! RUN: %flang_fc1 -emit-mlir -triple x86_64-pc-windows-msvc --dependent-lib=libtest %s -o - 2>&1 | FileCheck %s banach-space wrot

[flang] [clang] [flang] Add depdendent-lib option to flang -fc1 on Windows (PR #72121)

2023-11-13 Thread Andrzej Warzyński via cfe-commits
@@ -303,6 +323,9 @@ bool CodeGenAction::beginSourceFileAction() { Fortran::parser::Program &parseTree{*ci.getParsing().parseTree()}; lb.lower(parseTree, ci.getInvocation().getSemanticsContext()); + // Add dependent libraries + addDepdendentLibs(*mlirModule, ci);

[flang] [clang] [flang] Add depdendent-lib option to flang -fc1 on Windows (PR #72121)

2023-11-13 Thread Andrzej Warzyński via cfe-commits
@@ -0,0 +1,7 @@ + banach-space wrote: [nit] This line can be skipped? https://github.com/llvm/llvm-project/pull/72121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[flang] [clang] [flang][driver] Rename `flang-new` as `flang` (PR #74377)

2023-12-04 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space created https://github.com/llvm/llvm-project/pull/74377 This patch renames `flang-new` as `flang`. Similarly to Clang, Flang's driver executable will be called: * `flang-` A symlink called `flang` pointing at `flang-` will be created at build time. This is con

[flang] [clang] [flang][driver] Rename `flang-new` as `flang` (PR #74377)

2023-12-05 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: > Are you going to add an entry to the [Release > Notes](https://github.com/llvm/llvm-project/blob/main/flang/docs/ReleaseNotes.md)? Once this change lands, yes. https://github.com/llvm/llvm-project/pull/74377 ___ cfe-commits mail

[clang] [flang] [flang][driver] Add -fno-fortran-main (link time) option to remove Fortran_main from link line (PR #74139)

2023-12-07 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space commented: Thanks for pushing on! I've made one small suggestion and I also have one more request for the summary. I know that you added links to relevant PRs, but I would still appreciate if the summary (and the commit msg) where self-contained and included th

[flang] [clang] [flang][driver] Add -fno-fortran-main (link time) option to remove Fortran_main from link line (PR #74139)

2023-12-07 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space edited https://github.com/llvm/llvm-project/pull/74139 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang][driver] Add -fno-fortran-main (link time) option to remove Fortran_main from link line (PR #74139)

2023-12-07 Thread Andrzej Warzyński via cfe-commits
@@ -6345,6 +6345,10 @@ def J : JoinedOrSeparate<["-"], "J">, Group, Alias; +def no_fortran_main : Flag<["-"], "fno-fortran-main">, + Visibility<[FlangOption]>, Group, + HelpText<"Don't link in Fortran main">; + banach-space wrote: ```suggestion def J :

[flang] [clang] [flang][driver] Rename `flang-new` as `flang` (PR #74377)

2023-12-07 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: > The CI errors are Flang specific on Windows... Do we care about those? We do care about those, I just need to ping somebody with a Windows machine to help me fix that. https://github.com/llvm/llvm-project/pull/74377 ___ cfe-comm

[clang] [flang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-12-08 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: > It seems like flang-new when being used as a linker with -shared included > Fortran_main in the shared library. This seems wrong to me. I am trying to recall the rationale behind that, but it's been a while :( Here's a relevant discussion/bug that hasn't been resolved ye

[flang] [clang] [flang][driver] Rename `flang-new` as `flang` (PR #74377)

2023-12-08 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space updated https://github.com/llvm/llvm-project/pull/74377 From e5ebda3272925b4f5956c15d0e61f7fbc0016129 Mon Sep 17 00:00:00 2001 From: Andrzej Warzynski Date: Sat, 2 Dec 2023 14:01:02 + Subject: [PATCH 1/2] [flang][driver] Rename `flang-new` as `flang` This pa

[clang] [flang] [flang][driver] Rename `flang-new` as `flang` (PR #74377)

2023-12-08 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space updated https://github.com/llvm/llvm-project/pull/74377 From 1eefb9136ea042e44ada4be66a18b4bf69c18fe3 Mon Sep 17 00:00:00 2001 From: Andrzej Warzynski Date: Sat, 2 Dec 2023 14:01:02 + Subject: [PATCH 1/2] [flang][driver] Rename `flang-new` as `flang` This pa

[clang] [driver] Respect the mode the driver is in for autocomplete (PR #74770)

2023-12-08 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: The current setting pre-dates the visibility flags, so it makes sense that it wouldn't be needed anymore. This change makes sense to me, but it would be nice to verify. > I don't see any testing in tree for anything except clang What tests do you see in Clang for this spec

[clang] [flang] [flang][driver] Rename `flang-new` as `flang` (PR #74377)

2023-12-08 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space updated https://github.com/llvm/llvm-project/pull/74377 From 1eefb9136ea042e44ada4be66a18b4bf69c18fe3 Mon Sep 17 00:00:00 2001 From: Andrzej Warzynski Date: Sat, 2 Dec 2023 14:01:02 + Subject: [PATCH 1/2] [flang][driver] Rename `flang-new` as `flang` This pa

[flang] [clang] [flang][driver] Add -fno-fortran-main (link time) option to remove Fortran_main from link line (PR #74139)

2023-12-08 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space edited https://github.com/llvm/llvm-project/pull/74139 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang][driver] Add -fno-fortran-main (link time) option to remove Fortran_main from link line (PR #74139)

2023-12-08 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space approved this pull request. I'm making two more small suggestions, but these are nits. Fell free to ignore. LGTM, thank you! [nit] "legacy flang" --> "Classic Flang" (in summary) https://github.com/llvm/llvm-project/pull/74139 ___

[clang] [flang] [flang][driver] Add -fno-fortran-main (link time) option to remove Fortran_main from link line (PR #74139)

2023-12-08 Thread Andrzej Warzyński via cfe-commits
@@ -6345,6 +6345,10 @@ def J : JoinedOrSeparate<["-"], "J">, Group, Alias; +def no_fortran_main : Flag<["-"], "fno-fortran-main">, + Visibility<[FlangOption]>, Group, + HelpText<"Don't link in Fortran main">; banach-space wrote: [nit] For folks less fam

[flang] [clang] [flang][driver] Rename `flang-new` as `flang` (PR #74377)

2023-12-08 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space updated https://github.com/llvm/llvm-project/pull/74377 From 1eefb9136ea042e44ada4be66a18b4bf69c18fe3 Mon Sep 17 00:00:00 2001 From: Andrzej Warzynski Date: Sat, 2 Dec 2023 14:01:02 + Subject: [PATCH 1/3] [flang][driver] Rename `flang-new` as `flang` This pa

[flang] [clang] [flang][driver] Rename `flang-new` as `flang` (PR #74377)

2023-12-09 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: > I have a Windows test machine. How can I help? Thank you for the offer, but it looks like CI is now passing 🥳 @DavidTruby kindly helped me offline 🙏🏻 https://github.com/llvm/llvm-project/pull/74377 ___ cfe-commits mailing list

[flang] [clang] [llvm] [Flang][WIP/RFC] Enable TSan for Flang (PR #74643)

2023-12-10 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: Hi @jprotze , thank you for working on this! One thing that would be very nice to see are tests :) It would really help if we could see how to use and how to test this. Any chance for an end-to-end PoC or a demonstrator? @kiranchandramohan , would an e2e test with OpenMP en

[flang] [clang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-12-11 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: > @tblah @rj-jesus #74139 has landed. Can you please see if `-fno-fortran-main` > helps to resolve your bugs? Thanks! > I will write up a blog article about this and publish it. Maybe it would be > worth documenting this as a question on StackOverflow, too? Or a paragrap

[clang] [flang] [Flang][Clang] Add support for frame pointers in Flang (PR #72146)

2023-11-15 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: Could you add some tests? In e.g. "driver-help.f90" we merely test that a flag is visible. https://github.com/llvm/llvm-project/pull/72146 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[flang] [clang] [flang] Add depdendent-lib option to flang -fc1 on Windows (PR #72121)

2023-11-15 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space approved this pull request. LGTM :) Thank you for addressing my comments. https://github.com/llvm/llvm-project/pull/72121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [flang] [flang] Add depdendent-lib option to flang -fc1 on Windows (PR #72121)

2023-11-15 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space edited https://github.com/llvm/llvm-project/pull/72121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Add depdendent-lib option to flang -fc1 on Windows (PR #72121)

2023-11-15 Thread Andrzej Warzyński via cfe-commits
@@ -303,6 +323,9 @@ bool CodeGenAction::beginSourceFileAction() { Fortran::parser::Program &parseTree{*ci.getParsing().parseTree()}; lb.lower(parseTree, ci.getInvocation().getSemanticsContext()); + // Add dependent libraries + addDepdendentLibs(*mlirModule, ci);

[clang] [flang] [flang] Add depdendent-lib option to flang -fc1 on Windows (PR #72121)

2023-11-15 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space edited https://github.com/llvm/llvm-project/pull/72121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang] Add depdendent-lib option to flang -fc1 on Windows (PR #72121)

2023-11-15 Thread Andrzej Warzyński via cfe-commits
@@ -0,0 +1,15 @@ +! DEFINE: %{triple} = +! DEFINE: %{run} = %flang_fc1 -emit-mlir -triple %{triple} --dependent-lib=libtest %s -o - 2>&1 | FileCheck %s +! REDEFINE: %{triple} = aarch64-pc-windows-msvc +! RUN: %{run} +! REDEFINE: %{triple} = x86_64-pc-windows-msvc +! RUN: %{run} +

[clang] [flang] [flang][Driver] Support -rpath, -shared, and -static in the frontend (PR #66702)

2023-11-15 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space edited https://github.com/llvm/llvm-project/pull/66702 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang][Driver] Support -rpath, -shared, and -static in the frontend (PR #66702)

2023-11-15 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: [nit] Dynamic linker will only be used with shared objects, but this file also tests `static`. So the name is a bit confusing. But I don't have any great suggestion myself. Perhaps update the comment to clarify that this test is specifical

[clang] [flang] [flang][Driver] Support -rpath, -shared, and -static in the frontend (PR #66702)

2023-11-15 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space approved this pull request. Thanks for seeing this through, that's much appreciated! https://github.com/llvm/llvm-project/pull/66702 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang] [flang] [flang] Add runtimes using --dependent-lib on MSVC targets (PR #72519)

2023-11-19 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: Could you add some comments to clarify the difference between: * "msvc-dependent-lib-flags.f90", and * "linker-flags.f90" https://github.com/llvm/llvm-project/pull/72519 ___ cfe-commits mailing li

[flang] [clang] [flang] Add runtimes using --dependent-lib on MSVC targets (PR #72519)

2023-11-19 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space edited https://github.com/llvm/llvm-project/pull/72519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang] Add runtimes using --dependent-lib on MSVC targets (PR #72519)

2023-11-19 Thread Andrzej Warzyński via cfe-commits
@@ -977,47 +977,10 @@ bool tools::addOpenMPRuntime(ArgStringList &CmdArgs, const ToolChain &TC, return true; } -void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args, +void tools::addFortranRuntimeLibs(const ToolChain &TC,

[clang] [flang] [flang] Add runtimes using --dependent-lib on MSVC targets (PR #72519)

2023-11-19 Thread Andrzej Warzyński via cfe-commits
@@ -0,0 +1,36 @@ +! RUN: %flang -### --target=aarch64-windows-msvc -fuse-ld= %S/Inputs/hello.f90 -v 2>&1 | FileCheck %s --check-prefixes=MSVC banach-space wrote: Could you remind the rationale behind an empty `-fuse-ld=`? https://github.com/llvm/llvm-project/pu

[flang] [clang] [Flang][Clang] Add support for frame pointers in Flang Driver (PR #72146)

2023-11-19 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: > Could you add some tests? In e.g. "driver-help.f90" we merely test that a > flag is visible. I see that you added [frame-pointer-codegen.f90](https://github.com/llvm/llvm-project/pull/72146/files#diff-76ca50365c8a0eb4797ce10b121021e7da52cc86523d806e1ade530a897de7e8), but

[flang] [clang] [Flang][Clang] Add support for frame pointers in Flang Driver (PR #72146)

2023-11-19 Thread Andrzej Warzyński via cfe-commits
@@ -960,7 +1099,7 @@ bool tools::addOpenMPRuntime(ArgStringList &CmdArgs, const ToolChain &TC, CmdArgs.push_back("-Bdynamic"); if (RTKind == Driver::OMPRT_GOMP && GompNeedsRT) - CmdArgs.push_back("-lrt"); +CmdArgs.push_back("-lrt"); banach-spac

[clang] [flang] [Flang] Add code-object-version option (PR #72638)

2023-11-19 Thread Andrzej Warzyński via cfe-commits
@@ -264,6 +263,37 @@ static void addDepdendentLibs(mlir::ModuleOp &mlirModule, } } +// Add to MLIR code target specific items which are dependent on target +// configuration specified by the user +static void addTargetSpecificMLIRItems(mlir::ModuleOp &mlirModule, +

[flang] [clang] [Flang] Add code-object-version option (PR #72638)

2023-11-19 Thread Andrzej Warzyński via cfe-commits
@@ -85,6 +85,19 @@ class CodeGenOptions : public CodeGenOptionsBase { RK_WithPattern, // Remark pattern specified via '-Rgroup=regexp'. }; + /// \brief Enumeration value for AMDGPU code object version, which is the + /// code object version times 100. + enum class Cod

[flang] [clang] [Flang] Add code-object-version option (PR #72638)

2023-11-19 Thread Andrzej Warzyński via cfe-commits
@@ -264,6 +263,37 @@ static void addDepdendentLibs(mlir::ModuleOp &mlirModule, } } +// Add to MLIR code target specific items which are dependent on target +// configuration specified by the user +static void addTargetSpecificMLIRItems(mlir::ModuleOp &mlirModule, +

[flang] [clang] [Flang] Add code-object-version option (PR #72638)

2023-11-19 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: All test files in this PR use hyphen (`-`) rather than underscore (`_`) ;-) https://github.com/llvm/llvm-project/pull/72638 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [flang] [flang] Add runtimes using --dependent-lib on MSVC targets (PR #72519)

2023-11-20 Thread Andrzej Warzyński via cfe-commits
@@ -0,0 +1,36 @@ +! RUN: %flang -### --target=aarch64-windows-msvc -fuse-ld= %S/Inputs/hello.f90 -v 2>&1 | FileCheck %s --check-prefixes=MSVC banach-space wrote: Lets remove it then. https://github.com/llvm/llvm-project/pull/72519 __

[clang] [flang] [flang] Add runtimes using --dependent-lib on MSVC targets (PR #72519)

2023-11-20 Thread Andrzej Warzyński via cfe-commits
@@ -977,47 +977,10 @@ bool tools::addOpenMPRuntime(ArgStringList &CmdArgs, const ToolChain &TC, return true; } -void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args, +void tools::addFortranRuntimeLibs(const ToolChain &TC,

[clang] [flang] [flang] Add runtimes using --dependent-lib on MSVC targets (PR #72519)

2023-11-20 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: From your explanation it is clear that these files test completely different (though related) things. I would keep them separate (i agree that "linker-flags.f90" is getting long and complex). So, is this checking the frontend driver invoc

[flang] [clang] [flang] Add runtimes using --dependent-lib on MSVC targets (PR #72519)

2023-11-22 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space edited https://github.com/llvm/llvm-project/pull/72519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang] Add runtimes using --dependent-lib on MSVC targets (PR #72519)

2023-11-22 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space approved this pull request. LGTM, thanks for addressing my comments! Feel free to ignore my final nit or to address it when merging. https://github.com/llvm/llvm-project/pull/72519 ___ cfe-commits mailing list cfe-commi

[flang] [clang] [flang] Add runtimes using --dependent-lib on MSVC targets (PR #72519)

2023-11-22 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: [nit] Could you add `MSVC: flang-new -fc1` in there then? I feel that that part is quite important. https://github.com/llvm/llvm-project/pull/72519 ___ cfe-commits mailing list cfe-commits@lists.l

[clang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-11-22 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: Would it be possible to test this? https://github.com/llvm/llvm-project/pull/73124 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-11-22 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: > > Would it be possible to test this? > > Sure thing! That's the next thing I can look at. I'd like to probe though if > the general solution is acceptable. Makes sense to me - looks like a great improvement! https://github.com/llvm/llvm-project/pull/73124 ___

[clang] [flang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-22 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space edited https://github.com/llvm/llvm-project/pull/73111 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-22 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space commented: Nice! > Enable by default when optimizing for speed. Please, can you be more specific and define what qualifies as "optimizing for speed"? https://github.com/llvm/llvm-project/pull/73111 ___ cfe-commits mai

[clang] [flang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-22 Thread Andrzej Warzyński via cfe-commits
@@ -142,6 +142,26 @@ void Flang::addCodegenOptions(const ArgList &Args, if (shouldLoopVersion(Args)) CmdArgs.push_back("-fversion-loops-for-stride"); + Arg *aliasAnalysis = Args.getLastArg(options::OPT_falias_analysis, + options::OP

[clang] [flang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-22 Thread Andrzej Warzyński via cfe-commits
@@ -142,6 +142,26 @@ void Flang::addCodegenOptions(const ArgList &Args, if (shouldLoopVersion(Args)) CmdArgs.push_back("-fversion-loops-for-stride"); + Arg *aliasAnalysis = Args.getLastArg(options::OPT_falias_analysis, + options::OP

[clang] [flang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-22 Thread Andrzej Warzyński via cfe-commits
@@ -142,6 +142,26 @@ void Flang::addCodegenOptions(const ArgList &Args, if (shouldLoopVersion(Args)) CmdArgs.push_back("-fversion-loops-for-stride"); + Arg *aliasAnalysis = Args.getLastArg(options::OPT_falias_analysis, + options::OP

[clang] [flang] [flang] Enable alias tags pass by default (PR #73111)

2023-11-22 Thread Andrzej Warzyński via cfe-commits
@@ -242,10 +242,24 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts, clang::driver::options::OPT_fno_loop_versioning, false)) opts.LoopVersioning = 1; - opts.AliasAnalysis = - args.hasFlag(clang::driver::options::OPT_falias_

[clang] [flang] [flang][Driver] Support -nodefaultlibs, -nostartfiles and -nostdlib (PR #72601)

2023-11-22 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space edited https://github.com/llvm/llvm-project/pull/72601 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][Driver] Support -nodefaultlibs, -nostartfiles and -nostdlib (PR #72601)

2023-11-22 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space commented: This makes sense to me, though I'm not a linker expert. It would be helpful if you could clearly distinguish between the two opposite cases that are currently being tested in "dynamic-linker.f90". https://github.com/llvm/llvm-project/pull/72601 _

[flang] [clang] [flang][Driver] Support -nodefaultlibs, -nostartfiles and -nostdlib (PR #72601)

2023-11-22 Thread Andrzej Warzyński via cfe-commits
@@ -1,5 +1,5 @@ -! Verify that certain linker flags are known to the frontend and are passed on -! to the linker. +! Verify that certain linker flags are known to the frontend and are passed or +! not passed on to the linker. banach-space wrote: This updated comm

[clang] [Driver] Handle Flang in same manner between Gnu and *BSD/Solaris ToolChain (PR #70429)

2023-10-28 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: @brad0 Thanks for sending this - could you provide some context in the summary? Why update the GNU Toolchain rather than *BSD - as in, what should be source of truth here? Also, could you add tests? I will be OK next week, but am happy for this to be merged once my comment

[clang] [flang] [flang][driver] Rename `flang-new` as `flang` (PR #74377)

2023-12-12 Thread Andrzej Warzyński via cfe-commits
@@ -193,26 +190,29 @@ driver, `clang -cc1` and consists of the following classes: This list is not exhaustive and only covers the main classes that implement the driver. The main entry point for the frontend driver, `fc1_main`, is implemented in `flang/tools/flang-driver/drive

[clang] [flang] [flang][driver] Rename `flang-new` as `flang` (PR #74377)

2023-12-12 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space edited https://github.com/llvm/llvm-project/pull/74377 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][driver] Rename `flang-new` as `flang` (PR #74377)

2023-12-12 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space edited https://github.com/llvm/llvm-project/pull/74377 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][driver] Rename `flang-new` as `flang` (PR #74377)

2023-12-12 Thread Andrzej Warzyński via cfe-commits
@@ -15,17 +15,13 @@ local: ``` There are two main drivers in Flang: banach-space wrote: Good point 👍🏻 https://github.com/llvm/llvm-project/pull/74377 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [flang] [flang][driver] Rename `flang-new` as `flang` (PR #74377)

2023-12-12 Thread Andrzej Warzyński via cfe-commits
@@ -1,15 +1,15 @@ -! Test that flang-new OpenMP and OpenMP offload related +! Test that flang OpenMP and OpenMP offload related ! commands forward or expand to the appropriate commands -! for flang-new -fc1 as expected. Assumes a gfx90a, aarch64, +! for flang -fc1 as expected.

[clang] [flang] [flang][driver] Rename `flang-new` as `flang` (PR #74377)

2023-12-12 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space updated https://github.com/llvm/llvm-project/pull/74377 From 1eefb9136ea042e44ada4be66a18b4bf69c18fe3 Mon Sep 17 00:00:00 2001 From: Andrzej Warzynski Date: Sat, 2 Dec 2023 14:01:02 + Subject: [PATCH 1/4] [flang][driver] Rename `flang-new` as `flang` This pa

[clang] [flang][driver] Don't use -whole-archive on Darwin (PR #75393)

2023-12-13 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space created https://github.com/llvm/llvm-project/pull/75393 Direct follow-up of #7312 - the linker on Darwin does not support `-whole-archive`, so that needs to be removed from the linker invocation. For context: * https://github.com/llvm/llvm-project/pull/7312 F

[clang] [flang][driver] Don't use -whole-archive on Darwin (PR #75393)

2023-12-13 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space edited https://github.com/llvm/llvm-project/pull/75393 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-12-13 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: Could folks confirm whether this fixes the issue on Darwin: https://github.com/llvm/llvm-project/pull/75393? https://github.com/llvm/llvm-project/pull/73124 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang] [flang][driver] Don't use -whole-archive on Darwin (PR #75393)

2023-12-14 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space updated https://github.com/llvm/llvm-project/pull/75393 From 95b4db0690d5725011a741f81237f5954bc08ff8 Mon Sep 17 00:00:00 2001 From: Andrzej Warzynski Date: Wed, 13 Dec 2023 22:05:07 + Subject: [PATCH] [flang][driver] Don't use -whole-archive on Darwin Direc

[clang] [flang][driver] Don't use -whole-archive on Darwin (PR #75393)

2023-12-14 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: > LGTM. Worked fine on my machine. > > NOTE: tested by replacing `CommonArgs.cpp` in main, to avoid conflicts. Thanks for checking and apologies for the merge conflict - I thought that I was up to date :( I've just rebased and force-pushed. I will be landing this today if

[clang] [flang][driver] Don't use -whole-archive on Darwin (PR #75393)

2023-12-14 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: > > > LGTM. Worked fine on my machine. > > > > > > > > > > > > > > NOTE: tested by replacing `CommonArgs.cpp` in main, to avoid conflicts. > > > > > > Thanks for checking and apologies for the merge conflict - I thought that I > > was up to date :( I've just rebased an

[clang] [flang][driver] Don't use -whole-archive on Darwin (PR #75393)

2023-12-14 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space updated https://github.com/llvm/llvm-project/pull/75393 From 95b4db0690d5725011a741f81237f5954bc08ff8 Mon Sep 17 00:00:00 2001 From: Andrzej Warzynski Date: Wed, 13 Dec 2023 22:05:07 + Subject: [PATCH 1/2] [flang][driver] Don't use -whole-archive on Darwin D

[clang] [flang] [flang][driver] Don't use -whole-archive on Darwin (PR #75393)

2023-12-14 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space updated https://github.com/llvm/llvm-project/pull/75393 From 95b4db0690d5725011a741f81237f5954bc08ff8 Mon Sep 17 00:00:00 2001 From: Andrzej Warzynski Date: Wed, 13 Dec 2023 22:05:07 + Subject: [PATCH 1/3] [flang][driver] Don't use -whole-archive on Darwin D

[clang] [flang] [flang][driver] Don't use -whole-archive on Darwin (PR #75393)

2023-12-14 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: > Unrelated to this PR, but may I ask how do you configure flang, to make it > link without errors and without extra flags? I need to add > `-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib`. AFAIK, what you really want is this: `-isysroot $(xcrun --sdk-path

[flang] [clang] [flang][driver] Don't use -whole-archive on Darwin (PR #75393)

2023-12-14 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space closed https://github.com/llvm/llvm-project/pull/75393 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang][nfc] Refactor linker invocation logic (PR #75534)

2023-12-14 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space created https://github.com/llvm/llvm-project/pull/75534 Refactor how the Fortran runtime libs are added to the linker invocation. This is a non-functional change. From 966e22e415ac2e696b4fd387e729e43799b2585f Mon Sep 17 00:00:00 2001 From: Andrzej Warzynski Dat

[clang] [flang] [flang][nfc] Refactor linker invocation logic (PR #75534)

2023-12-14 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space updated https://github.com/llvm/llvm-project/pull/75534 From b0b3bc42f0d6cb881ee0d028d2cc358ba3a347ed Mon Sep 17 00:00:00 2001 From: Andrzej Warzynski Date: Thu, 14 Dec 2023 21:34:11 + Subject: [PATCH] [flang][nfc] Refactor linker invocation logic Refactor h

[clang] [flang] [flang][nfc] Refactor linker invocation logic (PR #75534)

2023-12-15 Thread Andrzej Warzyński via cfe-commits
@@ -1116,73 +1116,87 @@ bool tools::addOpenMPRuntime(ArgStringList &CmdArgs, const ToolChain &TC, return true; } +/// Determines if --whole-archive is active in the list of arguments. +static bool isWholeArchivePresent(const ArgList &Args) { + bool WholeArchiveActive = fal

[clang] [flang] [flang][nfc] Refactor linker invocation logic (PR #75534)

2023-12-15 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space closed https://github.com/llvm/llvm-project/pull/75534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][nfc] Refactor linker invocation logic (PR #75534)

2023-12-15 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: > After this change, I can no longer use flang-new to create an executable > program. When I try, I get the following output: > > ``` > [psteinfeld@ice4 build]$ flang-new hello.f90 > /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../bin/ld: > /loca

[clang] [flang][nfc] Refactor linker invocation logic (PR #75648)

2023-12-15 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space created https://github.com/llvm/llvm-project/pull/75648 Refactor how the Fortran runtime libs are added to the linker invocation. This is a non-functional change. This is an updated version of #75534. This iteration makes sure that FortranMain.a comes before Fort

[flang] [clang] [flang][nfc] Refactor linker invocation logic (PR #75534)

2023-12-15 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: Updated version: https://github.com/llvm/llvm-project/pull/75648 https://github.com/llvm/llvm-project/pull/75534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang][nfc] Refactor linker invocation logic (PR #75648)

2023-12-16 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space closed https://github.com/llvm/llvm-project/pull/75648 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][Driver] Support `-pthread` to the frontend. (PR #75739)

2023-12-17 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: Hi @ergawy , thanks for this contribution! Could you add a test that would demonstrate compilation failing without `-pthread`? https://github.com/llvm/llvm-project/pull/75739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[flang] [clang] [Flang, Clang] Enable and test 'rdynamic' flag (PR #75598)

2023-12-18 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: No need for a dedicated test file, please use https://github.com/llvm/llvm-project/blob/main/flang/test/Driver/dynamic-linker.f90. https://github.com/llvm/llvm-project/pull/75598 ___ cfe-commits m

[flang] [clang] [Flang, Clang] Enable and test 'rdynamic' flag (PR #75598)

2023-12-18 Thread Andrzej Warzyński via cfe-commits
@@ -0,0 +1,10 @@ +! Verify that rdynamic flag adds -export-dynamic flag and passes it on to the linker. + +! RUN: %flang -### --target=x86_64-linux-gnu -rdynamic %s 2>&1 | FileCheck --check-prefixes=GNU-LINKER-OPTIONS %s +! RUN: %flang -### --target=aarch64-linux-none -rdynamic

[flang] [clang] [flang][driver] Remove Fortain_main static library from linking stages (PR #75816)

2023-12-18 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: Thanks! Mostly looks good, but I have a question: > This leads to the problem that _QQmain and _QQEnvironmentDefaults (as of the > time of this PR) are symbols marked as used, while main is being defined. Sorry for being pedantic, but not sure I follow. `FortranMain` defin

[clang] [flang] [flang][driver] Remove Fortain_main static library from linking stages (PR #75816)

2023-12-18 Thread Andrzej Warzyński via cfe-commits
@@ -1133,6 +1133,16 @@ static bool isWholeArchivePresent(const ArgList &Args) { return WholeArchiveActive; } +/// Determine if driver is invoked to create a shared object library (-static) +static bool isSharedLinkage(const ArgList &Args) { + return Args.hasArg(options::OPT

[flang] [clang] [flang][driver] Remove Fortain_main static library from linking stages (PR #75816)

2023-12-18 Thread Andrzej Warzyński via cfe-commits
@@ -3,18 +3,22 @@ ! RUN: %flang -### --target=x86_64-linux-gnu -rpath /path/to/dir -shared \ ! RUN: -static %s 2>&1 | FileCheck \ -! RUN: --check-prefixes=GNU-LINKER-OPTIONS %s +! RUN: --check-prefixes=GNU-LINKER-OPTIONS \ +! RUN: --implicit-check-not=GNU-LINKE

[flang] [clang] [flang][driver] Remove Fortain_main static library from linking stages (PR #75816)

2023-12-18 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: > Sure, I was planning to do this for the previous PR already but got > distracted. Can you point me to the right place to add this? Thanks! Somewhere here: * https://github.com/llvm/llvm-project/blob/main/flang/docs/FlangDriver.md I would probably create a section on build

[flang] [clang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-12-18 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: > @mjklemm This PR caused some regressions of C-interop test cases in our local > test run. The test cases typically have a Fortran main (compiled with Flang) > that calls a C function (compiled with clang). Sorry that you are hitting this, but please note that compiling m

[flang] [clang] [flang][driver] Rename `flang-new` as `flang` (PR #74377)

2023-12-19 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space updated https://github.com/llvm/llvm-project/pull/74377 From 3e77fdd1318c4ea58534a2c1a28ff5e9414b6809 Mon Sep 17 00:00:00 2001 From: Andrzej Warzynski Date: Sat, 2 Dec 2023 14:01:02 + Subject: [PATCH 1/4] [flang][driver] Rename `flang-new` as `flang` This pa

[flang] [clang] [flang][driver] Rename `flang-new` as `flang` (PR #74377)

2023-12-19 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: > It appears this PR now has conflicts that need resolving... Thanks, I've just rebased this branch, so that should be resolved. https://github.com/llvm/llvm-project/pull/74377 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[clang] [flang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-12-19 Thread Andrzej Warzyński via cfe-commits
banach-space wrote: > I see. So Fortran and C interoperability of F2003/F2008 is not supported yet > in Flang? That's not really what I had in mind. It worked for you so everything that's needed is there, but no upstream testing indicates that you might be the first person trying it. And tha

[clang] [flang] [flang][driver] Remove Fortain_main static library from linking stages (PR #75816)

2023-12-19 Thread Andrzej Warzyński via cfe-commits
https://github.com/banach-space edited https://github.com/llvm/llvm-project/pull/75816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   >