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

Fangrui Song via flang-commits flang-commits at lists.llvm.org
Sun Dec 1 00:52:16 PST 2024


MaskRay 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 from a built object, or is the order wrong? We can check that with `llvm-readelf`.

`-Wl,--as-needed` is a good example. (https://maskray.me/blog/2020-11-15-explain-gnu-linker-options#:~:text=as%2dneeded)

 The patch moves `-Wl,--as-needed` after user input files, while the user likely intended the input files to be covered by `-Wl,--as-needed` before a pairing `-Wl,--no-as-needed`. ISTM we need a notation to encode the position of user inputs.

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


More information about the flang-commits mailing list