lowRISC / riscv-llvm

RISC-V support for LLVM projects (LLVM, Clang, ...)
http://www.lowrisc.org/llvm/status/
249 stars 52 forks source link

Fix path in build instructions #46

Closed luismarques closed 7 years ago

luismarques commented 7 years ago

This fixes one incorrect step.

Personally, I would just put the whole instructions in a format that you can copy and paste without change, for reduced friction:

git clone https://github.com/lowRISC/riscv-llvm.git
cd riscv-llvm
export REV=314102
svn co http://llvm.org/svn/llvm-project/llvm/trunk@$REV llvm
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk@$REV clang
cd ..
for P in ../*.patch; do patch -p1 < $P; done
for P in ../clang/*.patch; do patch -d tools/clang -p1 < $P; done
mkdir build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE="Debug" \
      -DBUILD_SHARED_LIBS=True -DLLVM_USE_SPLIT_DWARF=True \
      -DLLVM_OPTIMIZED_TABLEGEN=True \
      -DLLVM_BUILD_TESTS=True \
      -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="RISCV" ../
cmake --build .

(BTW, I don't know how important BUILD_SHARED_LIBS is but I had to remove for my work with LDC, so... maybe reconsider including it?)

asb commented 7 years ago

Thanks!

asb commented 7 years ago

What problems did you have with BUILD_SHARED_LIBS? It's useful for development as it reduces link time for incremental builds.

The instructions should now be in a format you can copy and paste without change to get a working build - do let me know if you see further issues.

luismarques commented 7 years ago

@asb The issues I had were due to LDC not finding the LLVM libs unless I mucked with LD_LIBRARY_PATH. I often don't actually install those LLVM builds, I just build LDC again the LLVM build directory, as that's faster and more convenient for me, but that clashes with BUILD_SHARED_LIBS. I suppose the benefits of BUILD_SHARED_LIBS will outweigh any possible issues for the majority of people then, so ignore my remark.

The instructions should now be in a format you can copy and paste without change to get a working build - do let me know if you see further issues.

Well, you still have to change /path/to/riscv-llvm/ to .. so you can't just copy paste each step, but the important thing is that the steps are now correct.