main/fortify-headers does not seem to be a big fan of LTO
when compiling quite a few c++ programs with -flto, some part of the build process will usually fail with something along the lines of:
/usr/include/fortify/stdio.h:70:28: error: inlining failed in call to 'always_inline' 'vsnprintf': function body can be overwritten at link time
some things mistakenly don't actually use lto when trying to currently, then fail with the above. for instance, in community/alembic:
CXXFLAGS="$CXXFLAGS -flto -fno-ipa-cp"
cmake -B build -G Ninja \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DUSE_HDF5=ON
cmake --build build
however, this doesn't actually enable lto. to enable it with cmake you would usually do something along the lines of -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
, and then when you do that, you get the above error.
some other aports that fail in the exact same way:
testing/gnuradio (the -U_FORTIFY_SOURCE is there because it implicitly sets lto in cmake, and without disabling either lto or fortify, it fails in the same way)
community/rocksdb (with the -DCMAKE flag above..)
really, most things i try that are c++ fail in this same way.