[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 Nov 25 11:47:17 PST 2024


https://github.com/DavidTruby requested changes to this pull request.

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 options that will lead to those libraries being chosen first? If so, I think that's the correct way to do things anyway, so I prefer that to the current approach of putting the ones from the config file first. It might be considered a breaking change though.

@mgorny's question has got me thinking and given me concerns; I think if the user passes `-Wl,-Bstatic -lmystaticlib` and the config file is adding `-lmydynamiclib` after that, things will fail, because the `-Bstatic` will also apply to the lib in the config file. So we need to do something to prevent situations like that.

I've also added a few comments so that we can hopefully get this working for Windows as well.

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


More information about the cfe-commits mailing list