Code Monkey home page Code Monkey logo

Comments (4)

xijing21 avatar xijing21 commented on August 20, 2024

image

from riscv-measurement.

xijing21 avatar xijing21 commented on August 20, 2024

image
image
image

from riscv-measurement.

mollybuild avatar mollybuild commented on August 20, 2024

按照https://github.com/mollybuild/RISCV-Measurement/blob/master/Build-RISCV-LLVM-and-run-testsuite.md 执行交叉编译的时候,cmake报错:

xj@e2ba8bd04169:~/RISCV/llvm-project0/llvm/projects/test-suite-riscv-build$ cmake -DCMAKE_TOOLCHAIN_FILE=/home/xj/RISCV/llvm-project0/llvm/projects/test-suite-riscv-build/clang_riscv_linux.cmake  -DCMAKE_C_COMPILER="/home/xj/RISCV/llvm-project0/build/bin/clang"  ../test-suite
-- The C compiler identification is Clang 13.0.0
-- The CXX compiler identification is Clang 13.0.0
-- Check for working C compiler: /home/xj/RISCV/llvm-project0/build/bin/clang
-- Check for working C compiler: /home/xj/RISCV/llvm-project0/build/bin/clang -- broken
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "/home/xj/RISCV/llvm-project0/build/bin/clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/xj/RISCV/llvm-project0/llvm/projects/test-suite-riscv-build/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/make cmTC_c5958/fast && /usr/bin/make -f CMakeFiles/cmTC_c5958.dir/build.make CMakeFiles/cmTC_c5958.dir/build
    make[1]: Entering directory '/home/xj/RISCV/llvm-project0/llvm/projects/test-suite-riscv-build/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_c5958.dir/testCCompiler.c.o
    /home/xj/RISCV/llvm-project0/build/bin/clang --target=riscv64-unknown-linux-gnu --gcc-toolchain=/home/xj/RISCV/linux/    -o CMakeFiles/cmTC_c5958.dir/testCCompiler.c.o   -c /home/xj/RISCV/llvm-project0/llvm/projects/test-suite-riscv-build/CMakeFiles/CMakeTmp/testCCompiler.c
    Linking C executable cmTC_c5958
    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c5958.dir/link.txt --verbose=1
    /home/xj/RISCV/llvm-project0/build/bin/clang --target=riscv64-unknown-linux-gnu --gcc-toolchain=/home/xj/RISCV/linux/    -static  CMakeFiles/cmTC_c5958.dir/testCCompiler.c.o  -o cmTC_c5958
    /home/xj/RISCV/linux/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: warning: -z relro ignored
    /home/xj/RISCV/linux/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: unrecognized option '--hash-style=gnu'
    /home/xj/RISCV/linux/lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: use the --help option for usage information
    clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
    make[1]: *** [CMakeFiles/cmTC_c5958.dir/build.make:87: cmTC_c5958] Error 1
    make[1]: Leaving directory '/home/xj/RISCV/llvm-project0/llvm/projects/test-suite-riscv-build/CMakeFiles/CMakeTmp'
    make: *** [Makefile:121: cmTC_c5958/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:7 (project)


-- Configuring incomplete, errors occurred!
See also "/home/xj/RISCV/llvm-project0/llvm/projects/test-suite-riscv-build/CMakeFiles/CMakeOutput.log".
See also "/home/xj/RISCV/llvm-project0/llvm/projects/test-suite-riscv-build/CMakeFiles/CMakeError.log".

指定的target是riscv64-unknown-linux-gnu, ld用的是riscv64-unknown-elf,不一致。

from riscv-measurement.

xijing21 avatar xijing21 commented on August 20, 2024

重新构建riscv-gnu-toolchain的linux函数库:

build$ mkdir linux
build$ cd linux
linux$ ../../configure --prefix=$RISCV/linux
linux$ make linux   # 注意这里是make linux

make完之后:
image

cmake还是报错:
image
/home/xj/RISCV/linux/lib/gcc/riscv64-unknown-linux-gnu/10.2.0/../../../../riscv64-unknown-linux-gnu/bin/ld: cannot find crt1.o: No such file or directory

解决办法:修改环境变量,在~/.bashrc中的path中添加linux构建目录:~/RISCV/linux/bin 再次cmake就好了

from riscv-measurement.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.