GCC toolchain for LLVM

瘦欲@ 提交于 2019-12-03 12:28:16

As you have discovered, the proper way to resolve this is by adding your custom toolchain to PATH. This is not a systemwide change, and is limited to your shell session. Alternatively, you can configure with:

../llvm/configure CXX=$HOME/toolchains/bin/g++

and similar options documented in configure's --help output.

The option --with-gcc-toolchain only tells the built Clang where to look for a C++ standard library and headers, it has nothing to do with the LLVM/Clang build process. I strongly suggest to also build and install libc++ and libc++abi and use those with your new Clang instead.

The LLVM project no longer supports building with configure & make.

I specified c, c++ and fortran compiler in the variables CC, CXX and FC.

export CC=/path/to/gcc
export CXX=/path/to/g++
export FC=/path/to/gfortran

cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/opt/clang ../llvm-4.0.0
make
make install
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!