Git Product home page Git Product logo

install-clang's Issues

docker build failed: cannot find -lcxxabi_shared

I'm doing make docker-build, and it failed at about 30%:

[ 30%] Linking CXX shared library ../../../lib/libc++.so
/usr/bin/ld: cannot find -lcxxabi_shared
collect2: error: ld returned 1 exit status
projects/libcxx/src/CMakeFiles/cxx_shared.dir/build.make:1004: recipe for target 'lib/libc++.so.1.0' failed
make[2]: *** [lib/libc++.so.1.0] Error 1
CMakeFiles/Makefile2:10069: recipe for target 'projects/libcxx/src/CMakeFiles/cxx_shared.dir/all' failed
make[1]: *** [projects/libcxx/src/CMakeFiles/cxx_shared.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

...

Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
===
=== Failed building LLVM/clang at stage 0
===
The command '/bin/sh -c /opt/install-clang/install-clang -j 6 -C /opt/clang' returned a non-zero code: 1

Incompatible format of rpath passed to ld on OSX

I've just observed that the way rpath is added to the arguments passed from clang down to ld produces an error on OSX, because the entire argument gets enclosed in double quotes.

Changing:

+  CmdArgs.push_back(Args.MakeArgString("-rpath=" + D.InstalledDir + "/../lib"));

Into:

+  CmdArgs.push_back("-rpath");
+  CmdArgs.push_back(Args.MakeArgString(D.InstalledDir + "/../lib"));

In patches/tools-clang-libpath.patch resolves this error.

unsupported '-fsanitize=thread' / 'i386-pc-linux-gnu'

Dear Madam or Sir,

install-clang fails over the missing '-fsanitize=thread'.
As far as I understood, this is exprected for my platform.
I personally could live without '-fsanitize=thread', but unfortunately the build process is stopped.

Do You have a hint in which CMakefileList (or the like) I can deactivate '-fsanitize=thread'? So I could proceed even without it?

(Is 32 bit really that exotic today?)
(By the way; I started on a FAT partition, this seems to be exotic also. I continued with ext2)

See logs below

Regards
Ralf Hain

/media/xubuntu/tr/llvm/src/llvm/build-stage1/projects/compiler-rt/lib/tsan/libcxx_tsan/src/libcxx_tsan-stamp/libcxx_tsan-configure-err.log

[100%] Performing configure step for 'libcxx_tsan'
CMake Error at /media/xubuntu/tr/llvm/src/llvm/build-stage1/projects/compiler-rt/lib/tsan/libcxx_tsan/src/libcxx_tsan-stamp/libcxx_tsan-configure.cmake:16 (message):
Command failed: 1

'/usr/bin/cmake' '-DCMAKE_C_COMPILER=/media/xubuntu/tr/llvm/src/llvm/build-stage1/./bin/clang' '-DCMAKE_CXX_COMPILER=/media/xubuntu/tr/llvm/src/llvm/build-stage1/./bin/clang' '-DCMAKE_C_FLAGS= -fsanitize=thread' '-DCMAKE_CXX_FLAGS= -fsanitize=thread' '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_INSTALL_PREFIX:PATH=/media/xubuntu/tr/llvm/src/llvm/build-stage1/projects/compiler-rt/lib/tsan/libcxx_tsan' '-GUnix Makefiles' '/media/xubuntu/tr/llvm/src/llvm/projects/libcxx'

See also

/media/xubuntu/tr/llvm/src/llvm/build-stage1/projects/compiler-rt/lib/tsan/libcxx_tsan/src/libcxx_tsan-stamp/libcxx_tsan-configure-*.log

make[2]: *** [projects/compiler-rt/lib/tsan/libcxx_tsan/src/libcxx_tsan-stamp/libcxx_tsan-configure] Fehler 1
make[1]: *** [projects/compiler-rt/lib/tsan/CMakeFiles/libcxx_tsan.dir/all] Fehler 2
make[1]: *** Warte auf noch nicht beendete Prozesse...
Linking CXX executable ../../bin/llvm-readobj
[100%] Built target llvm-readobj
make: *** [all] Fehler 2
===
=== Faild building LLVM/clang at stage 1
===
------------------------------
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:54 (message):
The C++ compiler "/media/xubuntu/tr/llvm/src/llvm/build-stage1/./bin/clang"
is not able to compile a simple test program.

It fails with the following output:

Change Dir: /media/xubuntu/tr/llvm/src/llvm/build-stage1/projects/compiler-rt/lib/tsan/libcxx_tsan/src/libcxx_tsan-build/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec508344078/fast"

make[3]: Betrete Verzeichnis
'/media/xubuntu/tr/llvm/src/llvm/build-stage1/projects/compiler-rt/lib/tsan/libcxx_tsan/src/libcxx_tsan-build/CMakeFiles/CMakeTmp'

/usr/bin/make -f CMakeFiles/cmTryCompileExec508344078.dir/build.make
CMakeFiles/cmTryCompileExec508344078.dir/build

make[4]: Betrete Verzeichnis
'/media/xubuntu/tr/llvm/src/llvm/build-stage1/projects/compiler-rt/lib/tsan/libcxx_tsan/src/libcxx_tsan-build/CMakeFiles/CMakeTmp'

/usr/bin/cmake -E cmake_progress_report
/media/xubuntu/tr/llvm/src/llvm/build-stage1/projects/compiler-rt/lib/tsan/libcxx_tsan/src/libcxx_tsan-build/CMakeFiles/CMakeTmp/CMakeFiles
1

Building CXX object
CMakeFiles/cmTryCompileExec508344078.dir/testCXXCompiler.cxx.o

/media/xubuntu/tr/llvm/src/llvm/build-stage1/./bin/clang -fsanitize=thread
-o CMakeFiles/cmTryCompileExec508344078.dir/testCXXCompiler.cxx.o -c
/media/xubuntu/tr/llvm/src/llvm/build-stage1/projects/compiler-rt/lib/tsan/libcxx_tsan/src/libcxx_tsan-build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx

clang-3.5: error: unsupported option '-fsanitize=thread' for target
'i386-pc-linux-gnu'

make[4]: Verlasse Verzeichnis
'/media/xubuntu/tr/llvm/src/llvm/build-stage1/projects/compiler-rt/lib/tsan/libcxx_tsan/src/libcxx_tsan-build/CMakeFiles/CMakeTmp'

make[4]: ***
[CMakeFiles/cmTryCompileExec508344078.dir/testCXXCompiler.cxx.o] Fehler 1
make[3]: Verlasse Verzeichnis
'/media/xubuntu/tr/llvm/src/llvm/build-stage1/projects/compiler-rt/lib/tsan/libcxx_tsan/src/libcxx_tsan-build/CMakeFiles/CMakeTmp'

make[3]: *** [cmTryCompileExec508344078/fast] Fehler 2

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:7 (project)

Failed patch application causes install script to fail

I have noticed that when running the install-clang script that when running with the default version (release_35), I am getting a broken build due to the patch https://github.com/rsmmr/install-clang/blob/master/patches/fix-external-project-order.patch. This patch does not apply cleanly to release_35 and actually causes the file to have the failed git merge remnants in it. As soon as I manually fixed it the build was able to continue. This specific patch seems to only apply to release_36. Looking at the code it seems that there isn't any code currently to handle failed patches in the install-clang script. It seems like that would fix this problem from happening again.

As a note this is happening for me on Centos 6.7.

panel.h not found

Not sure if this belongs here. Seems to work fine until the very end where I get:

[ 74%] Building CXX object tools/lldb/source/Core/CMakeFiles/lldbCore.dir/IOHandler.cpp.o
/opt/llvm/src/llvm/tools/lldb/source/Core/IOHandler.cpp:14:10: fatal error: 'panel.h' file not found
#include <panel.h>
         ^~~~~~~~~
1 error generated.
make[2]: *** [tools/lldb/source/Core/CMakeFiles/lldbCore.dir/build.make:447: tools/lldb/source/Core/CMakeFiles/lldbCore.dir/IOHandler.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:65074: tools/lldb/source/Core/CMakeFiles/lldbCore.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
===
=== Failed building LLVM/clang at stage 2
===

panel.h is present:

$ locate panel.h
/usr/include/ncurses/panel.h
/usr/include/ncursesw/panel.h
$ /opt/llvm/bin/clang++ --version
clang version 8.0.1 (https://github.com/llvm-mirror/clang.git 29cb26a72b28cbb5ba43e67aecb3a8cf2b01fee0) (https://github.com/llvm-mirror/llvm.git 18e41dc964f916504ec90dba523826ac74d235c4)
Target: x86_64-suse-linux
Thread model: posix
InstalledDir: /opt/llvm/bin

Thanks for this tool!

Linking sometimes fails after update, because of outdated Makefile.llvmbuild

I use install-clang to build up-to-date llvm/clang toolchains from master/trunk and I recently stumbled on the same error described in this mailing-list message:

http://comments.gmane.org/gmane.comp.compilers.llvm.devel/59285

The fix proposed there resolved the issue for me and the wording "Usually, [...] fixes this kind of problem for me." indicates that this sort of problem is common, when updating the codebase.

So I propose to add "rm Makefile.llvmbuild" to install-clang.sh as a precaution when the "update" action is chosen by the user.

Runtime dynamic linker error when executing compiled program

I need to add the path to libc++.so.1 (/opt/clang/lib) to LD_LIBRARY_PATH to fix this runtime error.

./a.out: error while loading shared libraries: libc++.so.1: cannot open shared object file: No such file or directory

Adding that path to the ldconfig is a better solution I think, and it could be put directly in your Dockerfile. Here's what I'm doing in mine.

RUN echo "/opt/clang/lib" > /etc/ld.so.conf.d/clang.conf
RUN ldconfig

This might be a problem because one of my build script which I didn't want to change, had clang path hardcoded to /usr/bin/clang, and so I created a link there first in my docker file before compiling:

RUN ln -s /opt/clang/bin/clang++ /usr/bin/clang++

Thanks for making this btw !

Patch needed for llvm/projects/CMakeLists.txt

Looks like there is an order-of-build files issue. After the attached change, install-clang builds correctly.

diff --git a/projects/CMakeLists.txt b/projects/CMakeLists.txt
index 2f025bd..915a35c 100644
--- a/projects/CMakeLists.txt
+++ b/projects/CMakeLists.txt
@@ -13,6 +13,8 @@ foreach(entry ${entries})
   endif()
 endforeach(entry)

+add_llvm_external_project(libcxxabi)
+
 # Also add in libc++ and compiler-rt trees if present (and we have
 # a sufficiently recent version of CMake where required).
 if(${LLVM_BUILD_RUNTIME})
@@ -27,4 +29,3 @@ if(${LLVM_BUILD_RUNTIME})
 endif()

 add_llvm_external_project(dragonegg)
-add_llvm_external_project(libcxxabi)

Build fails due to sanitizer compilation error

Hi, thx for this tool!
Unfortunately I am unable to install due to a compilation error :

[ 18%] Building CXX object projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.x86_64.dir/sanitizer_common_libcdep.cc.o
/home/carlos/clang/src/llvm/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:1131:1: error: 'assertion_failed__1131' declared as an array with a negative size
CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
/home/carlos/clang/src/llvm/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1437:3: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
  COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *) NULL)->MEMBER) == \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/carlos/clang/src/llvm/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:336:30: note: expanded from macro 'COMPILER_CHECK'
#define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/carlos/clang/src/llvm/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:342:57: note: expanded from macro 'IMPL_COMPILER_ASSERT'
    typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
                                                        ^~~~~~~~~~~~~~~
1 error generated.  

Carlos

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.