[clang] [flang] [llvm] [flang][AArch64] Always link compiler-rt to flang after libgcc (PR #144710)

2025-06-18 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm edited https://github.com/llvm/llvm-project/pull/144710 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [flang][AArch64] Always link compiler-rt to flang after libgcc (PR #144710)

2025-06-18 Thread Paul Osmialowski via cfe-commits
@@ -653,6 +653,13 @@ if(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD STREQUAL "all") set(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ${LLVM_ALL_EXPERIMENTAL_TARGETS}) endif() +if("flang" IN_LIST LLVM_ENABLE_PROJECTS AND + "AArch64" IN_LIST LLVM_TARGETS_TO_BUILD AND + NOT "compiler-rt" IN_

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-05-15 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: One thing that worries me is that before this commit, there was no ICE caused by compiling this snippet of code (regardless its validity or usefulness), and now there is. It would be great if it could print a normal error message (which would encourage my resistant colleagues

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-05-14 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: We're facing a regression after this one. We can't build https://github.com/dslarm/Financial-Services-Workload-Samples/tree/main/MonteCarloEuropeanOptions with `-g` for AArch64 with -fopenmp now: ``` Stack dump: 0. Program arguments: /usr/bin/clang-21 -cc1 -triple aarch

[clang] [flang] [clang][driver] Fix -fveclib=ArmPL issue: with -nostdlib do not link against libm (PR #133578)

2025-04-04 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm created https://github.com/llvm/llvm-project/pull/133578 Although combining -fveclib=ArmPL with -nostdlib is a rare situation, it should still be supported correctly and should effect in avoidance of linking against libm. >From c033be3cf15b3320b24d52f2414acf88ba

[clang] [flang] [clang][driver] Fix -fveclib=ArmPL issue: with -nostdlib do not link against libm (PR #133578)

2025-04-04 Thread Paul Osmialowski via cfe-commits
@@ -116,11 +116,17 @@ /// Verify that vectorized routines library is being linked in. // RUN: %clang -### --target=aarch64-pc-windows-msvc -fveclib=ArmPL %s 2>&1 | FileCheck --check-prefix=CHECK-LINKING-ARMPL-MSVC %s // RUN: %clang -### --target=aarch64-linux-gnu -fveclib=ArmP

[clang] [flang] [clang][driver] Fix -fveclib=ArmPL issue: with -nostdlib do not link against libm (PR #133578)

2025-04-04 Thread Paul Osmialowski via cfe-commits
@@ -515,17 +515,19 @@ void tools::AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, // // 1. On Linux, link only when actually needed. // - // 2. Prefer libm functions over libamath. + // 2. Prefer libm functions over libamath (when

[clang] [flang] [clang][driver] Fix -fveclib=ArmPL issue: with -nostdlib do not link against libm (PR #133578)

2025-03-31 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm closed https://github.com/llvm/llvm-project/pull/133578 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] Fix -fveclib=ArmPL issue: with -nostdlib do not link against libm (PR #133578)

2025-03-31 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > I guessing we pass `-lm` twice here to work around `ld.bfd` not handling > static libraries in a pleasant way? This is all due to the way libamath incremetnally emerged into its present existence. And yes, static linking added another layer of problems here. https://githu

[clang] [flang] [clang][driver] Fix -fveclib=ArmPL issue: with -nostdlib do not link against libm (PR #133578)

2025-03-31 Thread Paul Osmialowski via cfe-commits
@@ -515,17 +515,19 @@ void tools::AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, // // 1. On Linux, link only when actually needed. // - // 2. Prefer libm functions over libamath. + // 2. Prefer libm functions over libamath (when

[clang] [flang] [clang][driver] Fix -fveclib=ArmPL issue: with -nostdlib do not link against libm (PR #133578)

2025-03-31 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/133578 >From 77dfec4939b3bba8d76cb7c43d2c309aa4c16588 Mon Sep 17 00:00:00 2001 From: Paul Osmialowski Date: Sat, 29 Mar 2025 07:51:26 + Subject: [PATCH] [clang][driver] Fix -fveclib=ArmPL issue: with -nostdlib d

[clang] [flang] [clang][driver] Fix -fveclib=ArmPL issue: with -nostdlib do not link against libm (PR #133578)

2025-03-31 Thread Paul Osmialowski via cfe-commits
@@ -116,11 +116,17 @@ /// Verify that vectorized routines library is being linked in. // RUN: %clang -### --target=aarch64-pc-windows-msvc -fveclib=ArmPL %s 2>&1 | FileCheck --check-prefix=CHECK-LINKING-ARMPL-MSVC %s // RUN: %clang -### --target=aarch64-linux-gnu -fveclib=ArmP

[clang] [flang] [clang][driver] Fix -fveclib=ArmPL issue: with -nostdlib do not link against libm (PR #133578)

2025-03-29 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: Seriously, this is something CI people signaled to me. Our CI builds everything with `-fveclib=ArmPL` and one of the packages failed on unexpected linker behavior when libm was artificially added by `-fveclib=ArmPL` despite the `-nostdlib` flag being used. My suggestion to us

[clang] Fix SemaCXX/msvc-pragma-function-no-builtin-attr.cpp test (PR #119873)

2024-12-13 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > This should fix https://lab.llvm.org/buildbot/#/builders/190/builds/11300 > > I am compiling clang locally to verify that there would be no other problems > with the test on macOS. > > > I suppose this is the reason check-clang fails today. > > Are there other test failure

[clang] Fix SemaCXX/msvc-pragma-function-no-builtin-attr.cpp test (PR #119873)

2024-12-13 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: I suppose this is the reason check-clang fails today. https://github.com/llvm/llvm-project/pull/119873 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-12-11 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm closed https://github.com/llvm/llvm-project/pull/116432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-12-10 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm edited https://github.com/llvm/llvm-project/pull/116432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-12-10 Thread Paul Osmialowski via cfe-commits
@@ -490,6 +490,35 @@ void tools::AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, else A.renderAsInput(Args, CmdArgs); } + if (const Arg *A = Args.getLastArg(options::OPT_fveclib)) { +const llvm::Triple &Triple = TC.getTriple(); +StringRef

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-12-10 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/116432 >From d19c8ea5e02ad92c1f89b129cd8fe2fd3cf1d4e3 Mon Sep 17 00:00:00 2001 From: Paul Osmialowski Date: Tue, 3 Dec 2024 12:41:15 + Subject: [PATCH] [clang][driver] When -fveclib=ArmPL flag is in use, always

[clang] [clang][docs] fix rendering of `$`-prefixed options (PR #119249)

2024-12-09 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm approved this pull request. Gosh, sorry for the confusion it caused. LGTM. https://github.com/llvm/llvm-project/pull/119249 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-12-09 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > > with -fveclib=ArmPL -lamath put into a config file, it will always be > > linked with libamath, even if the user decides to use -fveclib=none > > I think there might be a related issue with the approach in this patch too > though, in that `-fveclib=ArmPL` will silently fo

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-12-09 Thread Paul Osmialowski via cfe-commits
@@ -490,6 +490,35 @@ void tools::AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, else A.renderAsInput(Args, CmdArgs); } + if (const Arg *A = Args.getLastArg(options::OPT_fveclib)) { +const llvm::Triple &Triple = TC.getTriple(); +StringRef

[clang] [flang] [clang][driver] Use $ prefix with config file options to have them added after all of the command line options (PR #117573)

2024-12-07 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm closed https://github.com/llvm/llvm-project/pull/117573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] Use $ prefix with config file options to have them added after all of the command line options (PR #117573)

2024-12-06 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/117573 >From c599850a039d407061fb6b20d7365184a68c9938 Mon Sep 17 00:00:00 2001 From: Pawel Osmialowski Date: Mon, 25 Nov 2024 14:46:55 + Subject: [PATCH] [clang][driver] Use $ prefix with config file options to

[clang] [flang] [clang][driver] Use $ prefix with config file options to have them added after all of the command line options (PR #117573)

2024-12-06 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > The subject (linker flags) is no longer accurate. > > It's better to mention that Add $ for Reworded https://github.com/llvm/llvm-project/pull/117573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [flang] [clang][driver] Use $ prefix with config file options to have them added after all of the command line options (PR #117573)

2024-12-06 Thread Paul Osmialowski via cfe-commits
@@ -1243,13 +1268,14 @@ Compilation *Driver::BuildCompilation(ArrayRef ArgList) { // Try parsing configuration file. if (!ContainsError) ContainsError = loadConfigFiles(); - bool HasConfigFile = !ContainsError && (CfgOptions.get() != nullptr); + bool HasConfigFileHead

[clang] [flang] [clang][driver] Use $ prefix with config file options to have them added after all of the command line options (PR #117573)

2024-12-06 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm edited https://github.com/llvm/llvm-project/pull/117573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] Special care for linker flags in config files (PR #117573)

2024-12-06 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/117573 >From 537a1c6529410d2a8411b39f0072ef5c60ee865d Mon Sep 17 00:00:00 2001 From: Pawel Osmialowski Date: Mon, 25 Nov 2024 14:46:55 + Subject: [PATCH] [clang][driver] Use $ prefix with config file options to

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-12-06 Thread Paul Osmialowski via cfe-commits
@@ -490,6 +490,35 @@ void tools::AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, else A.renderAsInput(Args, CmdArgs); } + if (const Arg *A = Args.getLastArg(options::OPT_fveclib)) { +const llvm::Triple &Triple = TC.getTriple(); +StringRef

[clang] [flang] [clang][driver] Special care for linker flags in config files (PR #117573)

2024-12-06 Thread Paul Osmialowski via cfe-commits
@@ -82,3 +82,29 @@ // CHECK-TWO-CONFIGS: -isysroot // CHECK-TWO-CONFIGS-SAME: /opt/data // CHECK-TWO-CONFIGS-SAME: -Wall + +//--- The linker input flags should be moved to the end of input list and appear only when linking. +// RUN: %clang --target=aarch64-unknown-linux-gnu --

[clang] [flang] [clang][driver] Special care for linker flags in config files (PR #117573)

2024-12-06 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/117573 >From 65958806ff828cb0f41a2587e50abe0d221ae88c Mon Sep 17 00:00:00 2001 From: Pawel Osmialowski Date: Mon, 25 Nov 2024 14:46:55 + Subject: [PATCH] [clang][driver] Special care for linker flags in config f

[clang] [flang] [clang][driver] Special care for linker flags in config files (PR #117573)

2024-12-05 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > It's worth spending more time discussing the metacharacter. > > `^` can be interpreted as `^` in regex, which means the beginning. `$`, on > the other side, suggests the end. While I agree that `@` for response files > is not a good choice, I personally would not rule out `

[clang] [flang] [clang][driver] Special care for linker flags in config files (PR #117573)

2024-12-05 Thread Paul Osmialowski via cfe-commits
@@ -297,6 +297,9 @@ class Driver { /// Object that stores strings read from configuration file. llvm::StringSaver Saver; + /// Linker inputs originated from configuration file. + std::unique_ptr CfgLinkerInputs; pawosm-arm wrote: changed https://github

[clang] [flang] [clang][driver] Special care for linker flags in config files (PR #117573)

2024-12-05 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm edited https://github.com/llvm/llvm-project/pull/117573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] Special care for linker flags in config files (PR #117573)

2024-12-05 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm edited https://github.com/llvm/llvm-project/pull/117573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] Special care for linker flags in config files (PR #117573)

2024-12-05 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/117573 >From 7c7649d9e18bdf18671531065e48bb6ec49e0eaf Mon Sep 17 00:00:00 2001 From: Pawel Osmialowski Date: Mon, 25 Nov 2024 14:46:55 + Subject: [PATCH] [clang][driver] Special care for linker flags in config f

[clang] [flang] [clang][driver] Special care for linker flags in config files (PR #117573)

2024-12-04 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > This looks good to me but no doc updates? Added. https://github.com/llvm/llvm-project/pull/117573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] Special care for linker flags in config files (PR #117573)

2024-12-04 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/117573 >From c450f66e28facca1c394e1b5db4e38c4e505f45b Mon Sep 17 00:00:00 2001 From: Pawel Osmialowski Date: Mon, 25 Nov 2024 14:46:55 + Subject: [PATCH] [clang][driver] Special care for -l and -Wl, flags in con

[clang] [flang] [clang][driver] Special care for linker flags in config files (PR #117573)

2024-12-04 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > This looks good to me but no doc updates? Would a paragraph in clang/docs/UsersManual.rst "Configuration files" section do? If so, I'd write one. https://github.com/llvm/llvm-project/pull/117573 ___ cfe-commits mailing list cfe-co

[clang] [flang] [clang][driver] Special care for linker flags in config files (PR #117573)

2024-12-04 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > This LGTM but I think the other reviewers need to take a look too. Can you > change the title and description of the PR/commit to represent that what > we're doing is different now? The commit title and message has been changed already, the PR description comment too, I've

[clang] [flang] [clang][driver] Special care for linker flags in config files (PR #117573)

2024-12-04 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm edited https://github.com/llvm/llvm-project/pull/117573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-12-03 Thread Paul Osmialowski via cfe-commits
@@ -490,6 +490,17 @@ void tools::AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, else A.renderAsInput(Args, CmdArgs); } + if (const Arg *A = Args.getLastArg(options::OPT_fveclib)) { +if (A->getNumValues() == 1) { + const llvm::Triple &Tr

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-12-03 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: I've added these suggested changes. Also, I was advised by the libamath team that the complicated relationship between libamath and libm needs more elaborate handling, hence additional `-lm` before `-lamath` (see comment that I've also added). Also I was advised to use `--as-

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-12-03 Thread Paul Osmialowski via cfe-commits
@@ -490,6 +490,17 @@ void tools::AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, else A.renderAsInput(Args, CmdArgs); } + if (const Arg *A = Args.getLastArg(options::OPT_fveclib)) { +if (A->getNumValues() == 1) { pawosm-arm w

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-12-03 Thread Paul Osmialowski via cfe-commits
@@ -102,3 +102,17 @@ /* Verify no warning when math-errno is re-enabled for a different veclib (that does not imply -fno-math-errno). */ // RUN: %clang -### --target=aarch64-linux-gnu -fveclib=ArmPL -fmath-errno -fveclib=LIBMVEC %s 2>&1 | FileCheck --check-prefix=CHECK-REPEAT-

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-12-03 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/116432 >From 12654b674725715422ba114e98bf76e40d557d16 Mon Sep 17 00:00:00 2001 From: Paul Osmialowski Date: Tue, 3 Dec 2024 12:41:15 + Subject: [PATCH] [clang][driver] When -fveclib=ArmPL flag is in use, always

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-12-02 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm edited https://github.com/llvm/llvm-project/pull/117573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-12-02 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm edited https://github.com/llvm/llvm-project/pull/117573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-12-02 Thread Paul Osmialowski via cfe-commits
@@ -0,0 +1 @@ +-ffast-math -Wl,--as-needed | -lm -Wl,-Bstatic -lhappy -Wl,-Bdynamic pawosm-arm wrote: We could prefix those linker flags with some character, e.g. '@', it would work like that: ``` -ffast-math @-lm -Wl,--as-needed @-Wl,-Bstatic -lhappy @-Wl,-Bdy

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-12-02 Thread Paul Osmialowski via cfe-commits
@@ -0,0 +1 @@ +-ffast-math -Wl,--as-needed | -lm -Wl,-Bstatic -lhappy -Wl,-Bdynamic pawosm-arm wrote: Since for ` llvm::cl::ExpansionContext::readConfigFile()` a newline is just a separator, this can't be achieved by doing an enhancement in a code very distant

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-12-02 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm edited https://github.com/llvm/llvm-project/pull/117573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-12-02 Thread Paul Osmialowski via cfe-commits
@@ -0,0 +1 @@ +-ffast-math -Wl,--as-needed | -lm -Wl,-Bstatic -lhappy -Wl,-Bdynamic pawosm-arm wrote: Done. https://github.com/llvm/llvm-project/pull/117573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-12-02 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm edited https://github.com/llvm/llvm-project/pull/117573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-12-02 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/117573 >From bc66202680198f0e5d1289c62f79ca5799e6f2ac Mon Sep 17 00:00:00 2001 From: Pawel Osmialowski Date: Mon, 25 Nov 2024 14:46:55 + Subject: [PATCH] [clang][driver] Special care for -l and -Wl, flags in con

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-12-02 Thread Paul Osmialowski via cfe-commits
@@ -0,0 +1 @@ +-ffast-math -Wl,--as-needed | -lm -Wl,-Bstatic -lhappy -Wl,-Bdynamic pawosm-arm wrote: mid-air collision. yeah, either '$' or '@' would do :) https://github.com/llvm/llvm-project/pull/117573 ___ cfe-com

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-12-02 Thread Paul Osmialowski via cfe-commits
@@ -0,0 +1 @@ +-ffast-math -Wl,--as-needed | -lm -Wl,-Bstatic -lhappy -Wl,-Bdynamic pawosm-arm wrote: Seems neither '$' nor '@' is the best choice, '$' looks like shell variable expansion, so I'll do `^`, e.g., '^-Wl,-Bstatic`. https://github.com/llvm/llvm-pro

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-12-01 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > > I took a look and I think it may be too awkward to do, as we'd want to run > > e.g. readelf afterwards. But an example is > > `lld/test/ELF/as-needed-not-in-regular.s`. The idea being: if > > `-Wl,--as-needed` is in the config file, do we correctly prune an > > unnecessa

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-12-01 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/117573 >From b9dd5f9356d457ef1ad050083d650a1da21c4377 Mon Sep 17 00:00:00 2001 From: Pawel Osmialowski Date: Mon, 25 Nov 2024 14:46:55 + Subject: [PATCH] [clang][driver] Special care for -l and -Wl, flags in con

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-12-01 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > @pawosm-arm See also > https://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed#Importance_of_linking_order. > It is common for distributions to enable `-Wl,--as-needed` via patches to > the compiler or configuration files. Indeed, the distributions couldn't avoid

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-12-01 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > I took a look and I think it may be too awkward to do, as we'd want to run > e.g. readelf afterwards. But an example is > `lld/test/ELF/as-needed-not-in-regular.s`. The idea being: if > `-Wl,--as-needed` is in the config file, do we correctly prune an unnecessary > library

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-30 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > This seems OK to me, although I'd feel more comfortable if we had a test > which relied on `--Wl,--as-needed` too. Could you provide or describe some example? https://github.com/llvm/llvm-project/pull/117573 ___ cfe-commits maili

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-30 Thread Paul Osmialowski via cfe-commits
@@ -61,3 +61,29 @@ ! CHECK-TWO-CONFIGS-NEXT: Configuration file: {{.*}}Inputs{{.}}config2{{.}}config-4.cfg ! CHECK-TWO-CONFIGS: -ffp-contract=fast ! CHECK-TWO-CONFIGS: -O3 + +!--- The linker input flags should be moved to the end of input list and appear only when linking. +!

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-30 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/117573 >From 65917ba219e26bd8547e8d1d9ff2c4ced1cdcad1 Mon Sep 17 00:00:00 2001 From: Pawel Osmialowski Date: Mon, 25 Nov 2024 14:46:55 + Subject: [PATCH] [clang][driver] Special care for -l and -Wl, flags in con

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-30 Thread Paul Osmialowski via cfe-commits
@@ -1073,6 +1086,19 @@ bool Driver::readConfigFile(StringRef FileName, appendOneArg(*CfgOptions, Opt, BaseArg); } } + + if (!CfgLinkerInputs) +CfgLinkerInputs = std::move(NewLinkerIns); + else { +// If this is a subsequent config file, append options to th

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-30 Thread Paul Osmialowski via cfe-commits
@@ -82,3 +82,29 @@ // CHECK-TWO-CONFIGS: -isysroot // CHECK-TWO-CONFIGS-SAME: /opt/data // CHECK-TWO-CONFIGS-SAME: -Wall + +//--- The linker input flags should be moved to the end of input list and appear only when linking. +// RUN: %clang --target=aarch64-unknown-linux-gnu --

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-30 Thread Paul Osmialowski via cfe-commits
@@ -1062,6 +1062,19 @@ bool Driver::readConfigFile(StringRef FileName, for (Arg *A : *NewOptions) A->claim(); + // Filter out all -l and -Wl, options, put them into a separate list and erase + // from the original list of configuration file options. These will be used

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-30 Thread Paul Osmialowski via cfe-commits
@@ -61,3 +61,29 @@ ! CHECK-TWO-CONFIGS-NEXT: Configuration file: {{.*}}Inputs{{.}}config2{{.}}config-4.cfg ! CHECK-TWO-CONFIGS: -ffp-contract=fast ! CHECK-TWO-CONFIGS: -O3 + +!--- The linker input flags should be moved to the end of input list and appear only when linking. +!

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-30 Thread Paul Osmialowski via cfe-commits
@@ -61,3 +61,29 @@ ! CHECK-TWO-CONFIGS-NEXT: Configuration file: {{.*}}Inputs{{.}}config2{{.}}config-4.cfg ! CHECK-TWO-CONFIGS: -ffp-contract=fast ! CHECK-TWO-CONFIGS: -O3 + +!--- The linker input flags should be moved to the end of input list and appear only when linking. +!

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-30 Thread Paul Osmialowski via cfe-commits
@@ -61,3 +61,29 @@ ! CHECK-TWO-CONFIGS-NEXT: Configuration file: {{.*}}Inputs{{.}}config2{{.}}config-4.cfg ! CHECK-TWO-CONFIGS: -ffp-contract=fast ! CHECK-TWO-CONFIGS: -O3 + +!--- The linker input flags should be moved to the end of input list and appear only when linking. +!

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-30 Thread Paul Osmialowski via cfe-commits
@@ -82,3 +82,29 @@ // CHECK-TWO-CONFIGS: -isysroot // CHECK-TWO-CONFIGS-SAME: /opt/data // CHECK-TWO-CONFIGS-SAME: -Wall + +//--- The linker input flags should be moved to the end of input list and appear only when linking. +// RUN: %clang --target=aarch64-unknown-linux-gnu --

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-30 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm edited https://github.com/llvm/llvm-project/pull/117573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-30 Thread Paul Osmialowski via cfe-commits
@@ -1062,6 +1062,16 @@ bool Driver::readConfigFile(StringRef FileName, for (Arg *A : *NewOptions) A->claim(); + std::unique_ptr NewLinkerIns = std::make_unique(); pawosm-arm wrote: changed and added a comment https://github.com/llvm/llvm-project/pul

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-30 Thread Paul Osmialowski via cfe-commits
@@ -82,3 +82,35 @@ // CHECK-TWO-CONFIGS: -isysroot // CHECK-TWO-CONFIGS-SAME: /opt/data // CHECK-TWO-CONFIGS-SAME: -Wall + +//--- The linker input flags should be moved to the end of input list and appear only when linking. +// RUN: %clang --target=aarch64-unknown-linux-gnu --

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-30 Thread Paul Osmialowski via cfe-commits
@@ -82,3 +82,35 @@ // CHECK-TWO-CONFIGS: -isysroot // CHECK-TWO-CONFIGS-SAME: /opt/data // CHECK-TWO-CONFIGS-SAME: -Wall + +//--- The linker input flags should be moved to the end of input list and appear only when linking. +// RUN: %clang --target=aarch64-unknown-linux-gnu --

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-30 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/117573 >From e5769df6180f6b89ad2c494e74d3e4dc9d88dec8 Mon Sep 17 00:00:00 2001 From: Pawel Osmialowski Date: Mon, 25 Nov 2024 14:46:55 + Subject: [PATCH] [clang][driver] Special care for -l and -Wl, flags in con

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-26 Thread Paul Osmialowski via cfe-commits
@@ -61,3 +61,24 @@ ! CHECK-TWO-CONFIGS-NEXT: Configuration file: {{.*}}Inputs{{.}}config2{{.}}config-4.cfg ! CHECK-TWO-CONFIGS: -ffp-contract=fast ! CHECK-TWO-CONFIGS: -O3 + +!--- The -l flags should be moved to the end of input list and appear only when linking. +! RUN: %fla

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-26 Thread Paul Osmialowski via cfe-commits
@@ -82,3 +82,24 @@ // CHECK-TWO-CONFIGS: -isysroot // CHECK-TWO-CONFIGS-SAME: /opt/data // CHECK-TWO-CONFIGS-SAME: -Wall + +//--- The -l flags should be moved to the end of input list and appear only when linking. +// RUN: %clang --target=aarch64-unknown-linux-gnu --config %S

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-26 Thread Paul Osmialowski via cfe-commits
@@ -1250,6 +1273,7 @@ Compilation *Driver::BuildCompilation(ArrayRef ArgList) { if (!ContainsError) ContainsError = loadConfigFiles(); bool HasConfigFile = !ContainsError && (CfgOptions.get() != nullptr); + bool HasConfigLinkerIn = !ContainsError && (CfgLinkerInputs.ge

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-26 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/117573 >From d5a424405ef75b566167ce1686912a3d83949c48 Mon Sep 17 00:00:00 2001 From: Pawel Osmialowski Date: Mon, 25 Nov 2024 14:46:55 + Subject: [PATCH] [clang][driver] Special care for -l and -Wl, flags in con

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-26 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm edited https://github.com/llvm/llvm-project/pull/117573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-26 Thread Paul Osmialowski via cfe-commits
@@ -61,3 +61,24 @@ ! CHECK-TWO-CONFIGS-NEXT: Configuration file: {{.*}}Inputs{{.}}config2{{.}}config-4.cfg ! CHECK-TWO-CONFIGS: -ffp-contract=fast ! CHECK-TWO-CONFIGS: -O3 + +!--- The -l flags should be moved to the end of input list and appear only when linking. +! RUN: %fla

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-25 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm edited https://github.com/llvm/llvm-project/pull/117573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-25 Thread Paul Osmialowski via cfe-commits
@@ -0,0 +1 @@ +-ffast-math -lm -lhappy pawosm-arm wrote: yes https://github.com/llvm/llvm-project/pull/117573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-25 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > I think it makes sense to handle linker options differently so I'm in favour > of this change in principle. > > Am I right in thinking that if the config file puts things last, the `-l` > options provided by users will come before the config file ones, and unlike > other o

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-25 Thread Paul Osmialowski via cfe-commits
@@ -61,3 +61,22 @@ ! CHECK-TWO-CONFIGS-NEXT: Configuration file: {{.*}}Inputs{{.}}config2{{.}}config-4.cfg ! CHECK-TWO-CONFIGS: -ffp-contract=fast ! CHECK-TWO-CONFIGS: -O3 + +!--- The -l flags should be moved to the end of input list and appear only when linking. +! RUN: %fla

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-25 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/117573 >From 2acf432b48c275492d9c5d012e85da36750c9299 Mon Sep 17 00:00:00 2001 From: Pawel Osmialowski Date: Mon, 25 Nov 2024 14:46:55 + Subject: [PATCH] [clang][driver] Special care for -l and -Wl, flags in con

[clang] [flang] [clang][driver] Special care for -l flags in config files (PR #117573)

2024-11-25 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm created https://github.com/llvm/llvm-project/pull/117573 Currently, if a -l flag is added into a config file (e.g. clang.cfg), it is situated before any object file in the effective command line. If the library requested by given -l flag is static, its symbols wil

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-11-24 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: As I prepared a piece of code which makes the `-l` flags being treated properly when read from a config file (so it won't result in unresolved symbols e.g. when used with `-static`), I realized that going the config file way still creates a problem: with `-fveclib=ArmPL -lama

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-11-19 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: I've extended it with Windows and Darwin. https://github.com/llvm/llvm-project/pull/116432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-11-19 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/116432 >From 5614595f48dc2a6b4087c992c108874ca6c787ee Mon Sep 17 00:00:00 2001 From: Pawel Osmialowski Date: Fri, 15 Nov 2024 15:22:21 + Subject: [PATCH] [clang][driver] When -fveclib=ArmPL flag is in use, alway

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-11-19 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > We probably have to provide a link to some documentation for libamath. May be > something like the following one. > https://developer.arm.com/documentation/102574/2410/Optimized-math-routines---libamath I'm always anxious to provide a link that contains numeric ID (like the

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-11-18 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm edited https://github.com/llvm/llvm-project/pull/116432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-11-18 Thread Paul Osmialowski via cfe-commits
@@ -490,6 +490,16 @@ void tools::AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, else A.renderAsInput(Args, CmdArgs); } + if (const Arg *A = Args.getLastArg(options::OPT_fveclib)) { +if (A->getNumValues() == 1) { + StringRef V = A->getVa

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-11-18 Thread Paul Osmialowski via cfe-commits
@@ -490,6 +490,16 @@ void tools::AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, else A.renderAsInput(Args, CmdArgs); } + if (const Arg *A = Args.getLastArg(options::OPT_fveclib)) { +if (A->getNumValues() == 1) { + StringRef V = A->getVa

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-11-18 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/116432 >From 392192f186be03186cd53e2f94b56a21c5db27aa Mon Sep 17 00:00:00 2001 From: Pawel Osmialowski Date: Fri, 15 Nov 2024 15:22:21 + Subject: [PATCH] [clang][driver] When -fveclib=ArmPL flag is in use, alway

[clang] [flang] [clang][Driver] Add the ability to specify that RPATH should be added by default (PR #115163)

2024-11-18 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm closed https://github.com/llvm/llvm-project/pull/115163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][Driver] Add RPATH by default (PR #115286)

2024-11-18 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm closed https://github.com/llvm/llvm-project/pull/115286 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [clang][Driver] Add the ability to specify that RPATH should be added by default (PR #115163)

2024-11-18 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: No, config files today ARE NOT sufficient to do that. There is no way to attach a role to the flags in clang's config file, all flags are being treated the same. So putting -lamath in there will put it before object files that would make use of it, it will result in unresolve

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-11-16 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/116432 >From 865831ba2fb4778e8a1c25402b1cff70abd44d6b Mon Sep 17 00:00:00 2001 From: Pawel Osmialowski Date: Fri, 15 Nov 2024 15:22:21 + Subject: [PATCH] [clang][driver] When -fveclib=ArmPL flag is in use, alway

[clang] [flang] [clang][driver] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-11-16 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/116432 >From dde726aa72cd23a5a824846e6b65583d1274d18c Mon Sep 17 00:00:00 2001 From: Pawel Osmialowski Date: Fri, 15 Nov 2024 15:22:21 + Subject: [PATCH] [clang][driver] When -fveclib=ArmPL flag is in use, alway

  1   2   >