2021-06-12, 22:58
I have been playing with compiling using clang. How does one enable LTO with it? Passing
I guess just add the
-DUSE_LTO=8
to cmake as I do with gcc gave this:Code:
...
-- #---------------------------------------------#
-- SYSTEM_LDFLAGS :
-- CMAKE_DL_LIBS : dl
-- CMAKE_C_FLAGS : -D_FORTIFY_SOURCE=2 -march=haswell -mtune=haswell -O2 -pipe -fno-plt -fdiagnostics-color -Wall
-- CMAKE_CXX_FLAGS : -D_FORTIFY_SOURCE=2 -march=haswell -mtune=haswell -O2 -pipe -fno-plt -fdiagnostics-color -Wall
-- CMAKE_EXE_LINKER_FLAGS: -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
-- LTO_OPTIMIZATION: :
-- #---------------------------------------------#
-- bindir : /usr/bin
-- includedir : /usr/include
-- libdir : /usr/lib
-- datarootdir: /usr/share
-- #---------------------------------------------#
-- BINARY: kodi-x11
-- #---------------------------------------------#
-- GIT_REV: 20210612-nogitfound
-- Build date: 20210612
-- #---------------------------------------------#
-- CPACK_GENERATOR :
-- CPACK_SOURCE_GENERATOR:
-- #---------------------------------------------#
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
USE_LTO
I guess just add the
-flto=thin
to the CFLAGS and CXXFLAGS?