[LLVMdev] Compiling MiBench to MIPS

Simon Atanasyan simon at atanasyan.com
Tue May 27 11:25:46 PDT 2014


Hi,

On Tue, May 27, 2014 at 10:09 PM, Ronaldo Ferreira
<ronaldorferreira at gmail.com> wrote:
> Thanks Tim, I was not aware of that issue with clang. I could compile with:
>
> clang --target=mips-linux-gnu
> --sysroot=/home/ronaldo/CodeSourcery/Sourcery_CodeBench_Lite_for_MIPS_GNU_Linux
> -static -O3 basicmath_small.c rad2deg.c cubic.c isqrt.c -c -emit-llvm
>
> I already had the MIPS toolchain installed.

BTW if Sourcery_CodeBench_Lite_for_MIPS_GNU_Linux is a regular
CodeSourcery toolchain installation directory i.e. it contains folders
like "bin", "lib", "mips-linux-gnu" etc, I recommend to do not use the
'--sysroot' option and invoke the clang as:

% clang --gcc-toolchain=/home/ronaldo/CodeSourcery/Sourcery_CodeBench_Lite_for_MIPS_GNU_Linux
--target=mips-linux-gnu ...

In fact this toolchain contains multiple "sysroot's" for various
combination of command line options -EL/-BE, mips32/mips32r2 etc. The
"--gcc-toolchain" option allows the driver correctly select an
appropriate "sysroot" for specified arguments.

-- 
Simon Atanasyan



More information about the llvm-dev mailing list