Closed sbourdeauducq closed 8 years ago
I have just built LLVM and Clang from scratch according to instructions in the manual and the following works:
touch x.c
./bin/clang -c -target or1k -mffl1 x.c
@raghavendrasrinivas Can you let us know exactly what you did to get that broken compiler?
I think I did this,
1 $ cd ~/artiq-dev $ git clone https://github.com/m-labs/migen $ cd migen $ python3 setup.py develop --user
2 $ cd ~/artiq-dev $ git clone https://github.com/openrisc/llvm-or1k $ cd llvm-or1k/tools $ git clone https://github.com/openrisc/clang-or1k clang $ cd ..
3 $ mkdir build $ cd build $ cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/llvm-or1k -DLLVM_TARGETS_TO_BUILD="OR1K;X86" -DCMAKE_BUILD_TYPE=Rel -DLLVM_ENABLE_ASSERTIONS=ON $ make -j4 $ sudo make install
4 $cd ~/artiq-dev/artiq/soc/runtime && make runtime.fbi
Was step 4 that generated the error.
Ohh. I see now. common.mak assumes that clang
in PATH has the right target in it, which is not the case if you install everything to /usr/local/llvm-or1k. Let me amend the instructions...
Oh, it's already there.
Note Make sure that /usr/local/llvm-or1k/bin is first in your PATH, so that the clang command you just built is found instead of the system one, if any.
Just tested again with a fresh LLVM install built as the manual says, everything (BIOS and runtime) compiles fine. @raghavendrasrinivas reopen if you can reproduce the problem.
Following the Clang instructions currently in the manual results in a compiler that does this when compiling the runtime: