llvm 3.42 build from source fails on ubuntu 17.04

前端 未结 2 1952
傲寒
傲寒 2020-12-22 11:29

I have a script that builds llvm/clang 3.42 from source (with configure+make). It runs smooth on ubuntu 14.04.5 LTS. When I upgraded to ubuntu 17.04

2条回答
  •  情歌与酒
    2020-12-22 12:32

    I faced the same problem on my Ubuntu 16.10. It has default gcc 6.2. You need to instruct LLVM build system to use gcc 4.9. Also, I suggest you remove GCC6 completely.

    $ sudo apt-get remove g++-6 gcc-6 cpp
    $ sudo apt-get install gcc-4.9 g++4.9
    $ export CC=/usr/bin/gcc-4.9
    $ export CXX=/usr/bin/g++-4.9
    $ export CPP=/usr/bin/cpp-4.9
    $ ./configure
    $ make
    

    And maybe you will need:

    $ sudo ln -s /usr/bin/cpp-4.9 /usr/bin/cpp
    

提交回复
热议问题