On 6/28/16 5:04 PM, ÐилÑн ÐалаÑзов wrote:
> When building postgresql I noticed, that it doesn't use LTO. What is the way to enable LTO builds with the current
buildsystem, except calling CFLAGS="-flto -O3" ./configure?
You can do it like that. But I have tried that before and the
performance improvement of the resulting binary is approximately zero
percent. So there is not a whole lot of enthusiasm right now to make
that any easier.
> In all cases, doing unset CFLAGS is wrong, as it discards CFLAGS set in config.site, which it shall not.
As a workaround, you can fake it by setting ac_env_CFLAGS_set and
ac_env_CFLAGS_value in config.site, to pretend that CFLAGS came from the
environment. We do support that.
If you want to come up with a more comprehensive patch to make this work
right, we would consider it. But as you've heard, this is a very
marginal use case and the current system has been carefully tweaked, so
it would take some convincing to change it.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services