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

Paul Osmialowski via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 26 05:53:58 PST 2024


================
@@ -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: %flang --target=aarch64-unknown-linux-gnu --config %S/Inputs/config-l.cfg -o %s.out %s -### 2>&1 | FileCheck %s -check-prefix CHECK-LINKING
----------------
pawosm-arm wrote:

> Can you add a run line for Windows (`--target=x86_64-pc-windows-msvc` or similar) with e.g. -check-prefix CHECK-WINDOWS and something along the lines of:
> 
> ```
> CHECK-WINDOWS: -ffast-math
> CHECK-WINDOWS-SAME: "{{.*}}-{{.*}}.o" "m.lib" "happy.lib"
> ```
> 
> And the same for the NOLINKING ones? We will want to make sure this change is working for Windows too so I don't really want it to land before we have Windows tests as well. I can write them locally (since I have a Windows build) and attach a diff if that would help.

Does it mean Bstatic/Bdynamic is always dropped by the frontend driver when it emits the linker's command line?


https://github.com/llvm/llvm-project/pull/117573


More information about the cfe-commits mailing list