[cfe-dev] Relink problem building LLVM 7.0.0 rc1 with Cmake, Ninja and gcc 7.1

Michael Kruse via cfe-dev cfe-dev at lists.llvm.org
Wed Aug 15 12:40:12 PDT 2018


I have never seen a CMakeRelink.dir in my build directory. You might
try disabling Polly if it is the only cause if the error:
`-DLLVM_POLLY_BUILD=OFF -DLLVM_POLLY_LINK_INTO_TOOLS=OFF
-DLLVM_TOOL_POLLY_BUILD=OFF`

Michael


Am Mi., 15. Aug. 2018 um 10:57 Uhr schrieb Fletcher, John P via
cfe-dev <cfe-dev at lists.llvm.org>:
>
> I have previously built LLVM and Clang 6.0.0 with Cmake, Ninja and gcc 7.1
>
> I am using cmake 3.6.2 and binutils 2.22 with ninja 1.8.2 (updated from 1.7.2 for the 6.0.0 build).
>
> The underlying linux is Ubuntu 12.04, with the gcc 7.1 installed in /opt
>
> My commands for Cmake are these:
>
> /opt/cmake/bin/cmake -GNinja \
> -DCMAKE_C_COMPILER=/opt/gcc-7.1/bin/gcc \
> -DCMAKE_CXX_COMPILER=/opt/gcc-7.1/bin/g++ \
> -DGCC_INSTALL_PREFIX=/opt/gcc-7.1 \
> -DCMAKE_INSTALL_PREFIX=/home/fletcher/LLVM/llvm-7.0.rc1/local -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_TARGETS_TO_BUILD="host" -DLLVM_PARALLEL_LINK_JOBS=1 -DCMAKE_EXE_LINKER_FLAGS="-Xlinker -R/opt/gcc-7.1/lib64 -L/opt/gcc-7.1/lib64" ../llvm
>
> I have had several problems.  Some with versions of cuda I have solved for now by excluding openmp from the build.
>
> After this the build failed when linking a library as follows
>
> FAILED: lib/clang/7.0.0/lib/linux/libclang_rt.fuzzer_no_main-x86_64.a
> --localize-hidden: not found
>
> I have traced this to the fact that the file CmakeCache.txt omits the following lines when built for 7.0.0 which are in the same file for 6.0.0 and the result is that objcopy is not found.  --localize_hidden is an argument to objcopy.
>
> //Path to a program.
> CMAKE_NM:FILEPATH=/usr/bin/nm
>
> //Path to a program.
> CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy
>
> //Path to a program.
> CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump
>
> //Path to a program.
> CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib
>
> When I restore these lines to CmakeCache.txt the build of 7.0.0 proceeds to completion.
>
> Install now fails with the following message:
>
>   file INSTALL cannot find
>   "/home/fletcher/LLVM/llvm-7.0.rc1/build/tools/polly/lib/CMakeFiles/CMakeRelink.dir/LLVMPolly.so".
>
> This is because the location does not exist.  Again, comparing with 6.0.0, there the file to be installed was found from /home/fletcher/LLVM/llvm-6.0.distrib/build/lib/libPolly.a
>
> There is a file in the corresponding location in 7.0.0.  It is not being used and instead a relinked file is looked for.
>
> It seems that the relink process has not been organised.
>
> I have not looked beyond LVMPolly as the install process will not go any further.
>
> I hope that you can identify what the problem is.
>
> Thank you
>
> John Fletcher
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



More information about the cfe-dev mailing list