在 2024/1/13 0:01, Xi Ruoyao 写道: > And LTO cannot cross shared library boundary. It even cannot cross > static library boundary if the static library is intended to be > distributed in binary form: a static library containing LTO bitcode > will just blow up if attempting to "link" against it using a different > compiler or even a different version of the compiler. So LTO-enabled > distros build packages containing static libraries with -ffat-lto- > objects and then strip the LTO bitcode away from the static libraries. I don't think that's the case for me. I'm building a shared library against only system libraries. My observation is basically 1) Link time grows dramatically. [less than 2 minutes => more than 1 hour] 2) Binary size also grows dramatically. [1.9 MiB => 9.0 MiB] 3) The overall performance improvement is not worth the cost. [31382.685 seconds => 29882.761 seconds] (-4.779%) 4) Function calls use much more stack space and are more likely to cause stack overflows. -- Best regards, LIU Hao