Wolfgang Walther:
> Peter:
>> I don't think we explicitly offer LTO builds as part of the make build
>> system, so anyone trying this would do it sort of self-service, by
>> passing additional options to configure or make. In which case they
>> might as well pass the -export_dynamic option along in the same way?
>
> The challenge is that it defeats the purpose of LTO to pass this along
> to everything, e.g. via CFLAGS. The Makefiles set this in LDFLAGS_EX_BE
> only, so it only affects the backend binary. This is not at all obvious
> and took me quite a while to figure out why LTO silently didn't strip
> symbols from other binaries. It does work to explicitly set
> LDFLAGS_EX_BE, though.
Oh, and more importantly: LDFLAGS_EX_BE is not available on all back
branches. It was only introduced in v16 in preparation for meson. So up
to v15, I would have to patch src/makesfiles/Makefile.darwin to set
export_dynamic.
So back-patching a change like this would certainly help to get LTO
across versions seamlessly - which is what I am trying to achieve while
packaging all versions in nixpkgs / NixOS.
Best,
Wolfgang