chimera-linux / cports

Chimera ports collection
BSD 2-Clause "Simplified" License
178 stars 118 forks source link

omit lto flags from c/xxflags for meson #1678

Open nekopsykose opened 6 months ago

nekopsykose commented 6 months ago

for

[built-in options]
c_args = {pkg.get_cflags()}
c_link_args = {pkg.get_ldflags()}

cpp_args = {pkg.get_cxxflags()}
cpp_link_args = {pkg.get_ldflags()}

removing flto from this list when lto is enabled and leaving -Db_lto= allows projects that selectively disable b_lto per-module where known broken (like scipy in some modules) to control that (rather than us just doing !lto), and for some configure tests to not break (like the patch in dav1d that only breaks because of the c_args passed here with flto in them) since lto will only be used for the actual build

q66 commented 3 months ago

i'm still thinking about what would be a good way to implement this

one way would be to add a modifier to the Template class that would temporarily alter the options, which would result in the Profile class skipping the lto flags, but that itself has caveats

particularly, CFI will break because 1) cbuild checks elsewhere that the whole combo is enabled and 2) if you compile conftests with CFI but not LTO, they will fail (clang will error) which will subsequently fail the whole build

so i'm not quite sure how to do this satisfactorily :/

nekopsykose commented 3 months ago

particularly, CFI will break because 1) cbuild checks elsewhere that the whole combo is enabled and 2) if you compile conftests with CFI but not LTO, they will fail (clang will error) which will subsequently fail the whole build

hm, seems like there's no way to both have that and this at the same time then