[llvm-dev] Building the CRT
Zhao, Weiming via llvm-dev
llvm-dev at lists.llvm.org
Wed Mar 22 10:13:33 PDT 2017
For ARM/AArch64, are you trying to do cross compiling?
If so, you need GCC tools for ARM/AArch64 in your PATH so CMake can
linking a simple testing code. If not in the PATH, you might need
--sysroot/ ---gcc-toolchain in CFLAGS.
Below is my CMake command for arm:
GCCTC= path_to_gcc
TRIPLE=arm-linux-gnueabi
SRC_DIR=<llvm_source_root>
INSTALL_DIR=<llvm_install_dir>
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR/lib/clang/5.0.0
-DCMAKE_C_COMPILER=$INSTALL_DIR/bin/clang
-DCMAKE_CXX_COMPILER=$INSTALL_DIR/bin/clang++
-DCMAKE_PREFIX_PATH=$INSTALL_DIR -DCMAKE_C_FLAGS=" -target ${TRIPLE} "
-DCMAKE_CXX_FLAGS=" -target ${TRIPLE} " -DCMAKE_SYSTEM_NAME=Linux
-DCOMPILER_RT_DEFAULT_TARGET_ARCH=arm
-DCOMPILER_RT_TEST_COMPILER_CFLAGS=" -target ${TRIPLE} "
-DCOMPILER_RT_TEST_COMPILER=${INSTALL_DIR}/bin/clang
$SRC_DIR/llvm/projects/compiler-rt
On 3/20/2017 2:56 PM, Evandro Menezes via llvm-dev wrote:
> On 03/20/2017 04:37 PM, Mehdi Amini wrote:
>>
>>> On Mar 20, 2017, at 12:47 PM, Evandro Menezes via llvm-dev
>>> <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
>>>
>>> Folks,
>>>
>>> I'm at a loss trying to add Compiler-RT to an LLVM build, even after
>>> checking out the instructions at http://compiler-rt.llvm.org, so I'd
>>> appreciate your help.
>>>
>>> I've tried adding the CMake options LLVM_ENABLE_PROJECTS
>>
>> For this option, you need to follow:
>> http://llvm.org/docs/GettingStarted.html#for-developers-to-work-with-a-git-monorepo
>>
>> You can’t add this to an existing build directory, you need to wipe
>> it and re-run cmake (at least for me that’s the only way I found).
>
> Yes, I have a monorepo, that's why I have projects that I don't care
> about cloned (e.g., draggonegg). But, as I said, this configuration
> has worked fine, until I decided to do some work in CRT.
>
> And, yes, I tried starting a build from a clean directory. Yet...
>
> Thank you,
>
>
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
More information about the llvm-dev
mailing list