17 Star 4 Fork 59

src-openEuler / llvm

 / 详情

cmake构建pass plugin由于找不到一些LLVM包含的二进制而配置失败

待办的
缺陷
创建于  
2024-03-06 15:19

编写LLVM pass plugin跑cmake时提示:

CMake Error at /usr/lib64/cmake/llvm/LLVMExports.cmake:1548 (message):
The imported target "count" references the file

"/usr/bin/count"

but this file does not exist.  Possible reasons include:

* The file was deleted, renamed, or moved to another location.

* An install or uninstall procedure did not complete successfully.

* The installation package was faulty and contained

"/usr/lib64/cmake/llvm/LLVMExports.cmake"

but not all the files it references.

Call Stack (most recent call first):
/usr/lib64/cmake/llvm/LLVMConfig.cmake:320 (include)
CMakeLists.txt:9 (find_package)

pass的CMakeLists.txt大致如下:

cmake_minimum_required(VERSION 3.6)
project(XXX)

# use C++20.
set(CMAKE_CXX_STANDARD 20)

# Load LLVMConfig.cmake. If this fails, consider setting `LLVM_DIR` to point
# to your LLVM installation's `lib/cmake/llvm` directory.
find_package(LLVM REQUIRED CONFIG)

# Include the part of LLVM's CMake libraries that defines
# `add_llvm_pass_plugin`.
include(AddLLVM)

# Use LLVM's preprocessor definitions, include directories, and library search
# paths.
add_definitions(${LLVM_DEFINITIONS})
include_directories(${LLVM_INCLUDE_DIRS})
link_directories(${LLVM_LIBRARY_DIRS})

# Our pass lives in this subdirectory.
add_subdirectory(Pass)

报错中说找不到count,我看spec文件中包含:

%files
%license LICENSE.TXT
%{install_prefix}/share/man/man1/*
%{install_bindir}/*
%exclude %{install_bindir}/not
%exclude %{install_bindir}/count
%exclude %{install_bindir}/yaml-bench
%exclude %{install_bindir}/lli-child-target
%exclude %{install_bindir}/llvm-isel-fuzzer
%exclude %{install_bindir}/llvm-opt-fuzzer

其中count以及其它几个程序没有包含进去,不知为什么没有包含以及是否可以包含进去?

评论 (2)

maoif 创建了缺陷

Hi maoif, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Compiler, and any of the maintainers: @kuen , @Noah , @eastb233 , @cf-zhao , @周磊 , @编译小伙 , @stubCode , @zhongyunde , @liyunfei

openeuler-ci-bot 添加了
 
sig/Compiler
标签

你好,请问你是用master分支吗?master分支上count这二进制被放置llvm-test中了:
输入图片说明
另外,我看fedora上也把count放进了llvm-test包中,参考这里

不知道能不能解决你的问题。

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(3)
5329419 openeuler ci bot 1632792936 10066618 cf zhao 1683191126
1
https://gitee.com/src-openeuler/llvm.git
git@gitee.com:src-openeuler/llvm.git
src-openeuler
llvm
llvm

搜索帮助

344bd9b3 5694891 D2dac590 5694891