Re: [PATCH] D16929: add support for -print-imm-hex for AArch64

2016-02-16 Thread Paul Osmialowski via cfe-commits
pawosm01 added a comment. You're right, this patch smuggles elimination of two dead functions. I've prepared alternative version of this patch which does not do that. Repository: rL LLVM http://reviews.llvm.org/D16929 ___ cfe-commits mailing lis

[clang] [flang] [flang][driver] Accept -fallow-argument-mismatch with a warning instead of rejecting it (PR #91611)

2024-05-30 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: The problem with `-fallow-argument-mismatch` has already been reported to the MPICH project maintainers, https://github.com/pmodels/mpich/issues/6869 therefore I'm going to close this PR. https://github.com/llvm/llvm-project/pull/91611 ___

[clang] [flang] [flang][driver] Accept -fallow-argument-mismatch with a warning instead of rejecting it (PR #91611)

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

[clang] [flang] [Flang][Driver] Enable config file options (PR #100343)

2024-07-24 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm approved this pull request. This is great, thanks for contributing it. https://github.com/llvm/llvm-project/pull/100343 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-26 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm approved this pull request. The -fno-fortran-main flag should disappear before it finds any widespread use. https://github.com/llvm/llvm-project/pull/89938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [flang] [flang][Driver] support -fno-openmp (PR #107087)

2024-09-03 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm commented: As I'm not seeing how linker is invoked, I just need to ask (for the sake of completeness) will it also prevent addition of `-lomp` to the linker's command line? https://github.com/llvm/llvm-project/pull/107087 __

[clang] [flang] [flang][Driver] support -fno-openmp (PR #107087)

2024-09-03 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm approved this pull request. https://github.com/llvm/llvm-project/pull/107087 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][driver] Accept -fallow-argument-mismatch with a warning instead of rejecting it (PR #91611)

2024-05-09 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm created https://github.com/llvm/llvm-project/pull/91611 Many autotools-utilizing projects (mpich among them) fail to complete the `configure` step since it tries to invoke the (unknown to them) Fortran compiler always with the `-fallow-argument-mismatch` flag. As

[clang] [flang] [flang][driver] Accept -fallow-argument-mismatch with a warning instead of rejecting it (PR #91611)

2024-05-21 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > > It sounds like an issue with the `mpich` build script rather than LLVM Flang. > Why would `mpich` and other projects use this flag to begin with? Do other > Fortran compilers support it? > I don't know why they do that, I suppose they think they know better. I don't sus

[clang] [Clang][Sema] Fix lookup of dependent operator= named by using-declaration (PR #91503)

2024-06-28 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: The number of C++ workloads failing to build after #90152 is rather impressive, even this PR do not help. Is there a plan to address that? https://github.com/llvm/llvm-project/pull/91503 ___ cfe-commits mailing list cfe-commits@lists

[clang] [Clang][Sema] Fix lookup of dependent operator= named by using-declaration (PR #91503)

2024-06-28 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: I'm sorry, I didn't notice that there is more discussion after #90152 covering also my issue at hand. The obvious advice I can get from those is the 'this is not valid c++, fix your code' suggestion. Trouble starts when there is a lot of it to fix, even if it mostly involve d

[clang] [flang] [flang][Driver] When linking with the Fortran runtime, the `addArchSpecificRPath()` should be called too (PR #114837)

2024-11-04 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm created https://github.com/llvm/llvm-project/pull/114837 When linking with other runtimes (OpenMP, sanitizers), the addArchSpecificRPath() is being called. The same thing should happen when linking with the Fortran runtime, this will improve user experience massiv

[clang] [llvm] [Transforms][Utils][PromoteMem2Reg] Propagate nnan flag on par with the nsz flag (PR #114271)

2024-11-05 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > We should probably also handle `no-infs-fp-math` to save the next person the > trouble. I'd leave it to a separate PR, as this one has a specific story behind the proposed change, anything extra would go beyond it. https://github.com/llvm/llvm-project/pull/114271 _

[clang] [llvm] [Transforms][Utils][PromoteMem2Reg] Propagate nnan flag on par with the nsz flag (PR #114271)

2024-11-05 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > > Yet we see a value in the change proposed here too hence a good reason for > > merging it. > > I've clearly misunderstood the context of the rebase. What is the value in > merging this change if the original issue has already been resolved? I guess > this fix is simpler

[clang] [flang] [flang][Driver] When linking with the Fortran runtime, the `addArchSpecificRPath()` should be called too (PR #114837)

2024-11-05 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > `addSanitizerRuntime` and `addOpenMPRuntime` are already calling > `addArchSpecificRPath`. It it a problem if rpath is added multiple times? > I've been testing it with and without -fopenmp and didn't observe any problem > Compiler-rt libs (`libclang_rt.*.a`) are added as

[clang] [llvm] [Transforms][Utils][PromoteMem2Reg] Propagate nnan flag on par with the nsz flag (PR #114271)

2024-11-05 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/114271 >From a426e17ed3c3cad6b3c813bd996e649a2e544591 Mon Sep 17 00:00:00 2001 From: Pawel Osmialowski Date: Wed, 30 Oct 2024 14:30:08 + Subject: [PATCH] [Transforms][Utils][PromoteMem2Reg] Propagate nnan and ni

[clang] [llvm] [Transforms][Utils][PromoteMem2Reg] Propagate nnan flag on par with the nsz flag (PR #114271)

2024-11-05 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > > I've rebased my PR so this branch could also contain phase-ordering test > > for vectorizing predicated selects introduced by commit > > [577c7dd](https://github.com/llvm/llvm-project/commit/577c7dd7cc4c5a9f62f9654cfa30ee9d55709426) > > Do I understand correctly that this

[clang] [flang] [flang][Driver] When linking with the Fortran runtime, the `addArchSpecificRPath()` should be called too (PR #114837)

2024-11-05 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: If there is no objections by others, I'll merge it some time tomorrow. https://github.com/llvm/llvm-project/pull/114837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [flang] [flang][Driver] When linking with the Fortran runtime, the `addArchSpecificRPath()` should be called too (PR #114837)

2024-11-05 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > `addSanitizerRuntime` and `addOpenMPRuntime` are already calling > `addArchSpecificRPath`. It it a problem if rpath is added multiple times? For a reference, in case of Clang and C code utilizing OpenMP, -rpath is given at least twice: `"/usr/bin/ld" "-rpath" "/opt/ll

[clang] [llvm] [Transforms][Utils][PromoteMem2Reg] Propagate nnan flag on par with the nsz flag (PR #114271)

2024-11-05 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/114271 >From 45a02d4dd6102bf825943e738a15adf64361f976 Mon Sep 17 00:00:00 2001 From: Pawel Osmialowski Date: Wed, 30 Oct 2024 14:30:08 + Subject: [PATCH] [Transforms][Utils][PromoteMem2Reg] Propagate nnan and ni

[clang] [flang] [flang][driver] Make -stdlib= option visible to flang and silently ignored by it (PR #110598)

2024-10-23 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: There was a change of plans, so I don't need it now. But I expect the subject will return sooner or later raised by someone else who stumble upon this just like me. Closing it for now. https://github.com/llvm/llvm-project/pull/110598

[clang] [flang] [flang][driver] Make -stdlib= option visible to flang and silently ignored by it (PR #110598)

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

[clang] [llvm] [Clang-Repl] Add support for out-of-process execution. (PR #110418)

2024-11-12 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: Ah, so it isn't failing only for me. Apparently, it blows away all the environments where ORC is deliberately disabled. https://github.com/llvm/llvm-project/pull/110418 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[clang] [flang] [flang][driver] Make -stdlib= option visible to flang and silently ignored by it (PR #110598)

2024-10-03 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > I don't think it is correct to say that the option was ignored. It may still > be read by the compiler driver (which generates the link line). In fact it > probably _should_ be processed by the compiler driver in order to set the C++ > standard library correctly - otherwise

[clang] [flang] [flang][driver] Make -stdlib= option visible to flang and silently ignored by it (PR #110598)

2024-10-03 Thread Paul Osmialowski via cfe-commits
@@ -0,0 +1,48 @@ +// REQUIRES: system-linux pawosm-arm wrote: As I stated in my other comment, the `-###` output is not affected by the `-stdlib=` flag, so a test which looks at its output would not provide a great value. The integration test from the other han

[clang] [flang] [flang][driver] Make -stdlib= option visible to flang and silently ignored by it (PR #110598)

2024-10-03 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > If this is completely ignored and does not effect the link line, are you sure > the resulting binary actually uses the right c++ library? > > Edit: flang will not link a C++ library. It is not a C++ compiler. As we discussed it offline, in case of this project it does not m

[clang] [flang] [flang][driver] Make -stdlib= option visible to flang and silently ignored by it (PR #110598)

2024-10-03 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > Note that the test will fail when `LLVM_DEFAULT_TARGET_TRIPLE` is set to > anything else than the host platform. Because of this. Clang tests never > invoke the linker, but check the output of `-###`. However, Flang already has > tests with the same issue. I wonder how the

[clang] [flang] [flang][driver] Make -stdlib= option visible to flang and silently ignored by it (PR #110598)

2024-10-03 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > (and there isn't even a warning that the option is unused) > > @pawosm-arm Wasn't this ever an issue? Should those to be consistent? Interesting, clang would do the same as flang-new patched with my patch. Maybe addition of the warning would be a good idea, if it isn't an o

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

2024-11-06 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/115163 >From 2c4b767437c55245391eb15da94a97b34a63f834 Mon Sep 17 00:00:00 2001 From: Paul Osmialowski Date: Tue, 5 Nov 2024 16:38:22 + Subject: [PATCH] [clang][Driver] Add the ability to specify that RPATH shoul

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

2024-11-06 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: We worked out this patch just because we dropped the idea of adding configuration file to our toolchain and for no other reason... https://github.com/llvm/llvm-project/pull/115163 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

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

2024-11-07 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > Some distributions (e.g. Fedora) have policies against DT_RUNPATH for system > packages. For as long as I remember, distros (and Fedora is a good example of this phenomenon) were patching the software packages heavily, so adding one more to ensure their well established po

[clang] [llvm] [Transforms][Utils][PromoteMem2Reg] Propagate nnan and ninf flags on par with the nsz flag (PR #114271)

2024-11-07 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm edited https://github.com/llvm/llvm-project/pull/114271 ___ 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-06 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm created https://github.com/llvm/llvm-project/pull/115163 The `-frtlib-add-rpath` is very convenient when linking against various runtimes (OpenMP, Fortran, sanitizers), so much so we could argue that this should be a default behavior. This patch adds the ability

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

2024-11-07 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm edited 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-07 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > For what it’s worth, as a user I’m always surprised that this _isn’t_ the > default. It’s quite annoying to eg have to set LD_LIBRARY_PATH when using > openmp with clang when they’re built alongside each other. Is there a > specific reason this isn’t the default or is it ju

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

2024-11-07 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm created https://github.com/llvm/llvm-project/pull/115286 The `-frtlib-add-rpath` is very convenient when linking against various runtimes (OpenMP, Fortran, sanitizers), so much so we could argue that this should be a default behavior. This patch makes adding RPAT

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

2024-11-07 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: @paulwalker-arm Can you share your rationale here? 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-06 Thread Paul Osmialowski via cfe-commits
@@ -0,0 +1,34 @@ +! REQUIRES: x86-registered-target pawosm-arm wrote: removed those requirements https://github.com/llvm/llvm-project/pull/115163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[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] 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-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-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-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] 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] 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] 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-15 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] 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-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
@@ -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
@@ -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
@@ -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-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-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
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: 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: 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
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: 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-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] When -fveclib=ArmPL flag is in use, always link against libamath (PR #116432)

2024-11-15 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm updated https://github.com/llvm/llvm-project/pull/116432 >From 0906f315571cfa093889077c5ec155cae3d174b6 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-15 Thread Paul Osmialowski via cfe-commits
pawosm-arm wrote: > Typo in PR title `flang` -> `flag` Corrected both the title and the commit message. Thanks for spotting this! https://github.com/llvm/llvm-project/pull/116432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

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

2024-11-15 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm created https://github.com/llvm/llvm-project/pull/116432 Using `-fveclib=ArmPL` without `-lamath` likely effects in the link-time errors. >From 991304ba11c9852964a0f0bdcde5277d47e29c7c Mon Sep 17 00:00:00 2001 From: Pawel Osmialowski Date: Fri, 15 Nov 2024 15:22:2

[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

[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] 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
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
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
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-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-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
@@ -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
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
@@ -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
@@ -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 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
@@ -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
@@ -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
@@ -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
@@ -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 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
@@ -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,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-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] 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] 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
@@ -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
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-

  1   2   >