1 Star 0 Fork 79

zhangxianjun/rpm

forked from src-openEuler/rpm 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Let-eBPF-ELF-files-be-packaged-in-noarch-packages.patch 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
From 5ece87a250880b08ccecfc5b34986347d8cca843 Mon Sep 17 00:00:00 2001
From: Panu Matilainen <pmatilai@redhat.com>
Date: Thu, 8 Feb 2024 09:44:51 +0200
Subject: [PATCH] Let eBPF ELF files be packaged in noarch packages
eBPF ELF represents a virtual machine where our file colors make no
sense at all. Filter out the color from these files to avoid a
"Arch dependent binaries in noarch package" error from them in noarch
packages.
We don't want to pull in clang to the check images just because of
this, so add a pre-built binary for the check and a simple way to
reproduce from the test-spec.
Fixes: #2875
Reference:https://github.com/rpm-software-management/rpm/commit/5ece87a250880b08ccecfc5b34986347d8cca843
Conflict:Deleted binary files and test code because it would add clang
Requires.
---
build/rpmfc.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/build/rpmfc.c b/build/rpmfc.c
index 07171fa..6d40a19 100644
--- a/build/rpmfc.c
+++ b/build/rpmfc.c
@@ -1151,6 +1151,13 @@ static uint32_t getElfColor(const char *fn)
color = RPMFC_ELF32;
break;
}
+
+ /* Exceptions to coloring */
+ switch (ehdr.e_machine) {
+ case EM_BPF:
+ color = 0;
+ break;
+ }
}
if (elf)
elf_end(elf);
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangxianjun87/rpm.git
git@gitee.com:zhangxianjun87/rpm.git
zhangxianjun87
rpm
rpm
master

搜索帮助