Running the LLVM for MIPS on ubuntu 14.04 lts

This topic contains 1 reply, has 2 voices, and was last updated by  alastair 2 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #50026

    Jose
    Member

    I am trying to run the llvm for mips tools.
    I tried both options from
    https://community.imgtec.com/developers/mips/tools/compilers/clang-llvm/

    but I could not run any of them succesfully.

    — With the precompiled version of the tools, when running a simple program (after modifying the PATH variable)
    ——————————————————
    #include <stdio.h>

    public void main(int argc, char **argv) {
    printf(“Hello world\n”);
    }
    ——————————————————-

    an error message is displayed in the terminal:
    File “/home/jomarm10/mips_linux_toolchain/bin/mips_linux_gnu_gcc”, line 113, in <module>
    do_compile()
    File “/home/jomarm10/mips_linux_toolchain/bin/gcc_generic.py”, line 300, in do_compile
    ret_code = do_c_compile(filename, basename)
    File “/home/jomarm10/mips_linux_toolchain/bin/gcc_generic.py”, line 214, in do_c_compile
    ret_code = do_command_line(command_line)
    File “/home/jomarm10/mips_linux_toolchain/bin/gcc_generic.py”, line 135, in do_command_line
    return subprocess.call(command_line)
    File “/usr/lib64/python2.7/subprocess.py”, line 522, in call
    return Popen(*popenargs, **kwargs).wait()
    File “/usr/lib64/python2.7/subprocess.py”, line 710, in __init__
    errread, errwrite)
    File “/usr/lib64/python2.7/subprocess.py”, line 1335, in _execute_child
    raise child_exception
    OSError: [Errno 2] No such file or directory

    — For the other case, the source package, I could not install it, after running the
    build-mips-toolchain.sh
    script, it only creates a couple of directories in the path set in –PREFIX variable,
    directories are bin and sysroot
    – bin, contais some python scripts
    – sysroot, is empty.

    console displays following messages
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %%% Build toolchain
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %%% Build llvm/clang
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %%% Install alternative clang driver

    Any idea of what I am doing wrong?

    #50053

    alastair
    Moderator

    Apologies for the confusion. The web page was for previous versions of toolchains and llvm. Since you’ve brought it to our attention we have had it removed.

    We recommend getting clang directly from llvm.org. Currently clang is only compatible with 2015.01-7 tools; these are available from https://community.imgtec.com/developers/mips/tools/codescape-mips-sdk/download-codescape-mips-sdk-essentials/early-access-release-of-components/. Note that there will soon be a new release available from the early access page. When this is released, you will need to go to the https://community.imgtec.com/developers/mips/tools/codescape-mips-sdk/available-releases/ page to get 2015.01-7 tools.

    llvm.org has releases that are both native and cross compilers for linux:
    Native mode:
    In this mode, the normal linux paths are searched. Headers, libraries, etc. come from the distro’s usual libc packages just like for gcc.
    Cross mode
    That is, when ‘–target mips-linux-gnu’ is given:
    For debian, if you have a gcc cross compiler for the given triple installed, then –target is enough.
    If you need an external cross compiler, you must also pass –gcc-toolchain=/path/to/root/of/toolchain. This changes the search paths for tools/libraries/headers appropriately.

    Here’s a concrete cross compilation example:

    A few notes:

    The MTI GNU Linux Toolchain works too if you want MIPS32R2. Just download it instead and switch that target from mips-img-linux-gnu for mips-mti-linux-gnu in the instructions and change the -mips32r6 to -mips32r2.
    Be explicit about the architecture you want to target even if the corresponding GCC cross compiler defaults to the one you want.
    If you want to target MIPS64 architecture you must use a target beginning with ‘mips64-‘ or ‘mips64el-*’.

Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.