[llvm-dev] Building with LLVM_PARALLEL_XXX_JOBS

Sedat Dilek via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 18 01:18:59 PDT 2016


On Thu, Mar 17, 2016 at 11:45 AM, Sedat Dilek <sedat.dilek at gmail.com> wrote:
> On Thu, Mar 17, 2016 at 10:05 AM, Sedat Dilek <sedat.dilek at gmail.com> wrote:
>> On Mon, Mar 14, 2016 at 5:30 PM, Chris Bieneman <cbieneman at apple.com> wrote:
>> [ brutal-snip ]
>> ...
>>> [ TODO#S: Before doing a 2nd build (and in a 3rd run using more
>>> optimized binaries) ]
>>>
>>> How do I anable LTO via CMAKE?
>>>
>>>
>>> LLVM_ENALBLE_LTO=On
>>>
>>
>> [ v4 of my build-script attached ]
>>
>> Hi Chris,
>>
>> thanks for the response!
>>
>> That seems to work (see below).
>>
>> $ cd $BUILD_DIR
>> $ grep -i lto CMakeCache.txt | grep ^[A-Z]
>> [ OUTPUT ]
>> LLVMLTO_LIB_DEPENDS:STATIC=
>> LLVM_ENALBLE_LTO:UNINITIALIZED=ON
>> LLVM_TOOL_LLVM_LTO_BUILD:BOOL=ON
>> LLVM_TOOL_LTO_BUILD:BOOL=ON
>> LTO_LIB_DEPENDS:STATIC=general;LLVMX86CodeGen;general;LLVMX86AsmPrinter;general;LLVMX86AsmParser;general;LLVMX86Desc;general;LLVMX86Info;general;LLVMX86Disassembler;general;LLVMCore;general;LLVMLTO;general;LLVMMC;general;LLVMMCDisassembler;general;LLVMSupport;general;LLVMTarget;
>> COMPILER_RT_HAS_FNO_LTO_FLAG:INTERNAL=1
>> LLVM_TOOL_LLVM_LTO_BUILD-ADVANCED:INTERNAL=1
>> LLVM_TOOL_LTO_BUILD-ADVANCED:INTERNAL=1
>> [ /OUTPUT ]
>>
>> But is no more documented in
>> <http://llvm.org/releases/3.8.0/docs/CMake.html> or
>> <http://llvm.org/docs/CMake.html>.
>> I have seen LLVM_ENALBLE_LTO=On in some older docs.
>> Bring it back?
>> AFAICS, "cmake -LA | grep -i $pattern" die not show me this, but I
>> might be wrong.
>> ( Some weeks ago, I dealt with LTO/PGO. )
>>
>
> OK, I got a typo, nevertheless LLVM_ENABLE_LTO does not work!
>
> [ ... ]
> -- Configuring done
> -- Generating done
> CMake Warning:
>   Manually-specified variables were not used by the project:
>
>     LLVM_ENABLE_LTO
>
>
> -- Build files have been written to:
> /home/wearefam/src/llvm-toolchain/llvm-build
>
> Do you need more input?
>
> Thanks!
>

I found in "http://llvmweekly.org/issue/110"

[ llvm.src/cmake/modules/HandleLLVMOptions.cmake ]

option(LLVM_ENABLE_LTO "Enable link-time optimization" OFF)
append_if(LLVM_ENABLE_LTO "-flto"
CMAKE_CXX_FLAGS
CMAKE_C_FLAGS
CMAKE_EXE_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS)

Searching for...

$ grep LLVM_ENABLE_LTO llvm/cmake/modules/HandleLLVMOptions.cmake
[ OUTPUT EMPTY ]

...gives no output.

So, LLVM_ENABLE_LTO is not available for LLVM/Clang v3.8.0?!

Hmm, maybe I can backport (or git cherry-pick) SVN r259766.

- Sedat -

[1] http://llvmweekly.org/issue/110
[2] http://reviews.llvm.org/rL259766


More information about the llvm-dev mailing list