mosquitto icon indicating copy to clipboard operation
mosquitto copied to clipboard

Please enable building with LTO support

Open narc-Ontakac2 opened this issue 8 months ago • 1 comments

When trying to build mosquitto with LTO support Debian bug #1015547 happens. This is still exactly the same with 2.0.21. Enabling LTO adds the flags -flto=auto -ffat-lto-objects to CFLAGS, CXXFLAGS, OBJCFLAGS ... and the flag -flto=auto to LDFLAGS.

This can be fixed by marking the missing methods with __attribute__((used)), see the associated Salsa MR 30. This is of course compiler specific and I am unsure how to do it in a portable way.

narc-Ontakac2 avatar Apr 23 '25 13:04 narc-Ontakac2

Thank you. As far as I can tell __attribute__((used)) is valid for both gcc and clang, so for the moment a macro for this which is defined based on the absence of _MSC_VER should do the job.

ralight avatar May 01 '25 10:05 ralight