macOS + gcc + meson + --werror is broken

Started by Peter Eisentraut6 days ago1 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

$subject configuration now fails to build with

gcc-15 -o src/interfaces/libpq-oauth/libpq-oauth.dylib ...
ld: warning: -U option is redundant when using -undefined dynamic_lookup
ld: fatal warning(s) induced error (-fatal_warnings)
collect2: error: ld returned 1 exit status

This is because of a combination of gcc bug

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120515

which causes the ld warning, and the recent meson 1.12 change

https://mesonbuild.com/Release-notes-for-1-12-0.html#werrortrue-now-applies-to-the-linker-as-well

I was able to work around this by adding

ldflags += '-nodefaultexport'

in meson.build, as suggested in the gcc bug report. But that is an
undocumented option, so it seems bad.

Any ideas?