Hi folks!
I'm trying to get rid of any dependency on libgcc*, but without success so
far. The following commands were executed on a freshliy installed and updated
Ubuntu 16.04 LTS:
=== snip ===
sudo apt-get install build-essential libffi-dev cmake # see aptget.txt for packages installed
sudo mv /usr/local /usr/local.orig
git clone
https://github.com/llvm/llvm-project.git
cd llvm-project; git checkout llvmorg-9.0.0-rc5; cd -
mkdir build; cd build
cmake \
-DLLVM_ENABLE_FFI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_TARGETS_TO_BUILD="host" \
-DBUILD_SHARED_LIBS=ON \
-DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi;compiler-rt;lld" \
../llvm-project/llvm # configure1.txt
cmake --build .
cmake -DCMAKE_INSTALL_PREFIX=/tmp/llvm/usr/local -P cmake_install.cmake
sudo mv /tmp/llvm/usr/local /usr
sudo rm /usr/bin/ld
sudo ln -s /usr/local/bin/ld.lld /usr/bin/ld
sudo apt-get remove build-essential g++ g++-5 gcc gcc-5 libgcc-5-dev libstdc++-5-dev
cd ..; rm -r build; mkdir build; cd -
cmake \
-DLLVM_ENABLE_FFI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_TARGETS_TO_BUILD="host" \
-DBUILD_SHARED_LIBS=ON \
-DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi;compiler-rt;lld" \
../llvm-project/llvm # fails, pleas see libgccdevmissing.txt
sudo apt-get install libgcc-5-dev
cd ..; rm -r build; mkdir build; cd -
cmake \
-DLLVM_ENABLE_FFI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_TARGETS_TO_BUILD="host" \
-DBUILD_SHARED_LIBS=ON \
-DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi;compiler-rt;lld" \
../llvm-project/llvm # fails, please see libstdc++devmissing.txt
sudo apt-get install libstdc++-5-dev
cd ..; rm -r build; mkdir build; cd -
cmake \
-DLLVM_ENABLE_FFI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_TARGETS_TO_BUILD="host" \
-DBUILD_SHARED_LIBS=ON \
-DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi;compiler-rt;lld" \
../llvm-project/llvm # configure2.txt
cmake --build .
rm -r /tmp/llvm
cmake -DCMAKE_INSTALL_PREFIX=/tmp/llvm/usr/local -P cmake_install.cmake
cd ..
tar cJf llvm9.txz -C /tmp/llvm/usr/local .
=== snap ===
When I unpack that now on another fresh system, I'm still getting the following:
=== snip ===
ld: error: cannot open crtbegin.o: No such file or directory
ld: error: unable to find library -lgcc
ld: error: unable to find library -lgcc_s
ld: error: unable to find library -lc
ld: error: unable to find library -lgcc
ld: error: unable to find library -lgcc_s
ld: error: cannot open crtend.o: No such file or directory
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
=== snap ===
Any hint on how to make this work?
Best wishes,
Fabiano