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

From Wolfgang Walther
Subject Build with LTO / -flto on macOS
Date
Msg-id 427c7c25-e8e1-4fc5-a1fb-01ceff185e5b@technowledgy.de
Whole thread Raw
Responses Re: Build with LTO / -flto on macOS
List pgsql-hackers
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.

Attached patch fixes that for configure/make.

CC: Tom, who hit the same in [3] and Andres who last touched 
--export-dynamic in 9db49fc5bfdc0126be03f4b8986013e59d93b91d.

Will also create an issue upstream for meson, because the logic is 
built-in there.

Would be great if this could be back-patched, since this is the same in 
all live versions.

Best,

Wolfgang

[1]: https://postgr.es/m/1581936537572-0.post%40n3.nabble.com
[2]: 
https://opensource.apple.com/source/ld64/ld64-609/doc/man/man1/ld.1.auto.html 
(grep for export_dynamic)
[3]: https://postgr.es/m/21800.1499270547%40sss.pgh.pa.us
Attachment

pgsql-hackers by date:

Previous
From: Andy Fan
Date:
Subject: differential test coverage when working on a patch
Next
From: Peter Eisentraut
Date:
Subject: Re: Build with LTO / -flto on macOS