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

David Truby via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 2 08:05:28 PST 2024


================
@@ -0,0 +1 @@
+-ffast-math -Wl,--as-needed | -lm -Wl,-Bstatic -lhappy -Wl,-Bdynamic
----------------
DavidTruby wrote:

Can we check that this works for multiple line config files? E.g. I would expect:
```
-ffast-math | -lm
-Wl,--as-needed | -Wl,-Bstatic -lhappy
| -Wl,-Bdynamic
```
to end up being essentially the same as what is here on one line. I.e. `-ffast-math` and `-Wl,--as-needed` should appear before user-specified options, and `-lm` `-Wl,-Bstatic` `-lhappy` and `-Wl,-Bdynamic` to appear after.

I gave this a quick test and it seems like doing this on multiple lines like above changes the order; I think everything after the first pipe _in the file_ is considered to be added to the end, whereas I'd expect it to be on a line-by-line basis. I guess this might need a change in `readConfigFile()`.

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


More information about the cfe-commits mailing list