Re: Build with LTO / -flto on macOS - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Build with LTO / -flto on macOS
Date
Msg-id 299832f7-72d0-4d2f-bc15-2f0fa4982b31@eisentraut.org
Whole thread Raw
In response to Build with LTO / -flto on macOS  (Wolfgang Walther <walther@technowledgy.de>)
Responses Re: Build with LTO / -flto on macOS
List pgsql-hackers
On 03.06.24 16:22, Wolfgang Walther wrote:
> Building with clang and -flto on macOS currently fails with errors 
> similar to [1]. This is because the --export-dynamic flag is called 
> -export_dynamic [2] instead and we have not been passing this variant to 
> the linker, so far.

It's probably worth clarifying that this option is needed on macOS only 
if LTO is also enabled.  For standard (non-LTO) builds, the 
export-dynamic behavior is already the default on macOS (otherwise 
nothing in PostgreSQL would work).

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?

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.




pgsql-hackers by date:

Previous
From: Wolfgang Walther
Date:
Subject: Build with LTO / -flto on macOS
Next
From: Pavel Stehule
Date:
Subject: Re: [PATCH] psql: \dn+ to show size of each schema (and \dA+ for AMs)