Skip to content

meson: combine checks for linker --gc-sections support

Dylan Baker requested to merge dbaker/mesa:submit/combine-gc-checks into main

We first do an incomplete check for whether the linker supports --gc-sections, then potentially add C and C++ arguments assuming that it works, then later do a complete check to see if it actually works and use --gc-sections. This means we can end up putting functions and data in separate sections when we can't gc them.

Combine the checks, do less work, and be more accurate.

fixes: f51ce21e ("meson: Drop adding -Wl,--gc-sections to project c/cpp arguments.")

Merge request reports