Re: Build with LTO / -flto on macOS

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Wolfgang Walther <walther(at)technowledgy(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Build with LTO / -flto on macOS
Date: 2024-06-04 07:26:06
Message-ID: d216bd43-b41c-455b-8993-18b8fc7efd7c@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03.06.24 17:07, Wolfgang Walther wrote:
>> I don't mind addressing this in PG18, but I would hesitate with
>> backpatching.  With macOS, it's always hard to figure out whether
>> these kinds of options work the same way going versions back.
>
> All the versions for ld64 are in [1]. It seems this was introduced in
> ld64-224.1 [2] the first time. It was not there in ld64-136 [3]. Finally
> the man page has **exactly** the same wording in the latest version
> ld64-609 [4].
>
> We could go further and compare the source, but I think it's safe to
> assume that this flag hasn't changed much and should not affect non-LTO
> builds. And for even older versions it would just not be supported, so
> configure would not use it.

With the native compiler tooling on macOS, it is not safe to assume
anything, including that the man pages are accurate or that the
documented options actually work correctly and don't break anything
else. Unless we have actual testing on all the supported macOS
versions, I don't believe it.

Given that LTO apparently never worked on macOS, this is not a
regression, so I wouldn't backpatch it. I'm not objecting, but I don't
want to touch it.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2024-06-04 07:44:09 Re: [PATCH]A minor improvement to the error-report in SimpleLruWriteAll()
Previous Message Peter Eisentraut 2024-06-04 07:18:28 Re: Proposal: Document ABI Compatibility