加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0003-upatch-helper-fix-object-upatch-id-duplicated-issue.patch 1.57 KB
一键复制 编辑 原始数据 按行查看 历史
RenoSeven 提交于 2024-09-18 18:40 . release 1.2.2-2
From 4efb5455073c23a6a90845eb541910eba6dc76f3 Mon Sep 17 00:00:00 2001
From: renoseven <dev@renoseven.net>
Date: Fri, 6 Sep 2024 22:14:11 +0800
Subject: [PATCH] upatch-helper: fix object upatch id duplicated issue
Signed-off-by: renoseven <dev@renoseven.net>
---
upatch-helper/Cargo.toml | 2 +-
upatch-helper/src/main.rs | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/upatch-helper/Cargo.toml b/upatch-helper/Cargo.toml
index 42f3548..b131b66 100644
--- a/upatch-helper/Cargo.toml
+++ b/upatch-helper/Cargo.toml
@@ -9,5 +9,5 @@ rust-version = "1.60"
build = "build.rs"
[dependencies]
-syscare-common = { package = "syscare-common", path = "../syscare-common" }
anyhow = { version = "1.0" }
+uuid = { version = "0.8", features = ["v4"] }
diff --git a/upatch-helper/src/main.rs b/upatch-helper/src/main.rs
index d98b167..303088c 100644
--- a/upatch-helper/src/main.rs
+++ b/upatch-helper/src/main.rs
@@ -15,7 +15,7 @@
use std::{os::unix::process::CommandExt, path::Path, process::Command};
use anyhow::{bail, Context};
-use syscare_common::os;
+use uuid::Uuid;
const UPATCH_CC_ENV: &str = "UPATCH_HELPER_CC";
const UPATCH_CXX_ENV: &str = "UPATCH_HELPER_CXX";
@@ -50,9 +50,9 @@ fn main() -> anyhow::Result<()> {
if exec_args.iter().any(|arg| arg == OUTPUT_FLAG) {
command.args(APPEND_ARGS);
command.arg(format!(
- "-Wa,--defsym,{}0x{:04x}=0",
+ "-Wa,--defsym,{}{}=0",
UPATCH_ID_PREFIX,
- os::process::id()
+ Uuid::new_v4(),
));
}
--
2.34.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化