lcm-proj / lcm

Lightweight Communications and Marshalling
GNU Lesser General Public License v2.1
944 stars 385 forks source link

Add -Wl,-no_fixup_chains for macos build #416

Closed ihilt closed 1 year ago

ihilt commented 1 year ago

This resolves the warning ld: warning: -undefined dynamic_lookup may not work with chained fixups.

The -undefined dynamic_lookup flag is used for linking with Python. The best summary I could find is from the CPython project. So, for our currently targeted MacOS version (14.2), -Wl,-no_fixup_chains is valid and silences this warning. Compared to using chained fix-ups, the only potential downside for us is a slightly larger dylib, AFAICT.

Dave-Allured commented 1 month ago

I submitted an upstream patch to GNU libtool, to add -Wl,-no_fixup_chains for Mac builds. https://savannah.gnu.org/support/?111069

This was inspired by your LCM patch and rationale. Thank you. If accepted by GNU, this will hopefully propagate back to a future LCM version, so you could remove the LCM patch. I welcome any feedback, here or on that GNU ticket.