meson icon indicating copy to clipboard operation
meson copied to clipboard

compilers: Ensure -L flags do not get reordered when used with MSVC

Open amyspark opened this issue 2 years ago • 1 comments

👋

If -L flags get into CLikeCompiler::build_wrapper_args, they will be correctly detected and the /LINK flag added to the list. However, CompilerArgs::__iadd__ will reorder them to the front, thinking they're GNU-style flags, and this will cause MSVC to ignore them after conversion.

The proposed fix here is to, once the need for /LINK is detected, execute in situ the unix_to_native replacement and ensure they do not get further reordered.

Fixes #11113

amyspark avatar Nov 30 '22 21:11 amyspark

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (9797f76) 69.81% compared to head (ea188c0) 68.79%.

:exclamation: Current head ea188c0 differs from pull request most recent head 9dc8b3f. Consider uploading reports for the commit 9dc8b3f to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11123      +/-   ##
==========================================
- Coverage   69.81%   68.79%   -1.02%     
==========================================
  Files         219      207      -12     
  Lines       48486    45329    -3157     
  Branches    11499     9378    -2121     
==========================================
- Hits        33850    31186    -2664     
+ Misses      12196    11749     -447     
+ Partials     2440     2394      -46     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Nov 30 '22 21:11 codecov[bot]

@nirbheek ping for review, @tristan957 said you were knowledgeable in this area.

amyspark avatar Feb 16 '23 01:02 amyspark

@nirbheek I'd do it, but I'm not sure how to do reflection on targets from windowstests.py. We'd also need some placeholder library to enable the lookup.

amyspark avatar Feb 18 '23 01:02 amyspark

@nirbheek Just figured a way to add that test :D All lines should be covered now.

amyspark avatar Jan 17 '24 03:01 amyspark