Skip to content

LLVM回归测试-error:use of unknown builtin '__builtin_malloc' #17

Open
@xijing21

Description

@xijing21

在按照https://github.com/mollybuild/RISCV-Measurement/blob/master/Build-RISCV-LLVM-and-run-testsuite.md执行测试任务时报错。

测试源码:https://github.com/plctlab/llvm-project.git
测试分支:origin/rvv-iscas
commit id:c360b611314ec39777487d050af6daa24eae811c

测试步骤:


$ git clone https://github.com/plctlab/llvm-project.git

$ cd llvm-project

$ mkdir build && cd build

$ cmake -DLLVM_PARALLEL_LINK_JOBS=3 -DLLVM_TARGETS_TO_BUILD="X86;RISCV" -DLLVM_ENABLE_PROJECTS="clang" -G Ninja ../llvm

$ ninja

$ ninja check  

在执行ninja check的时候,出现issue 16错误;

忽略此错误,继续执行:参考https://llvm.org/docs/TestSuiteGuide.html继续:

xj@e2ba8bd04169:~/RISCV/llvm-project/build$ ./bin/llvm-lit --version
lit 0.12.0dev
xj@e2ba8bd04169:~/RISCV/llvm-project/build$ cd ..
xj@e2ba8bd04169:~/RISCV/llvm-project$  git clone https://github.com/llvm/llvm-test-suite.git test-suite

xj@e2ba8bd04169:~/RISCV/llvm-project$  cd test-suite
xj@e2ba8bd04169:~/RISCV/llvm-project$  mkdir build  && cd build

xj@e2ba8bd04169:~/RISCV/llvm-project/test-suite$  cmake -DCMAKE_C_COMPILER=/home/xj/RISCV/llvm-project/build/bin/clang -C../test-suite/cmake/caches/O3.cmake ../test-suite
loading initial cache file ../test-suite/cmake/caches/O3.cmake
-- The C compiler identification is Clang 12.0.0
-- The CXX compiler identification is Clang 12.0.0
-- Check for working C compiler: /home/xj/RISCV/llvm-project/build/bin/clang
-- Check for working C compiler: /home/xj/RISCV/llvm-project/build/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /home/xj/RISCV/llvm-project/build/bin/clang++
-- Check for working CXX compiler: /home/xj/RISCV/llvm-project/build/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:71 (message):
  In-source builds are not allowed.

  CMake would overwrite the makefiles distributed with LLVM.

  Please create a directory and run cmake from there, passing the path

  to this source directory as the last argument.

  This process created the file `CMakeCache.txt' and the directory
  `CMakeFiles'.

  Please delete them.

-- Configuring incomplete, errors occurred!
See also "/home/xj/RISCV/llvm-project/test-suite/CMakeFiles/CMakeOutput.log".

按照提示修改:

xj@e2ba8bd04169:~/RISCV/llvm-project/test-suite$  rm -rf CMakeFiles  && rm CMakeCache.txt


xj@e2ba8bd04169:~/RISCV/llvm-project/test-suite/build$  cmake -DCMAKE_C_COMPILER=/home/xj/RISCV/llvm-project/build/bin/clang -C../../test-suite/cmake/caches/O3.cmake ../../test-suite

cmake成功,按照操作指导中的【注意事项】进行修改,除了
image

改了执行报错,又改回去了。

继续执行make:

xj@e2ba8bd04169:~/RISCV/llvm-project/test-suite/build$ make
报错:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions