From 5b4ee885785091680264aa372800dcbe24ae6b07 Mon Sep 17 00:00:00 2001 From: fly_1997 Date: Mon, 20 Oct 2025 15:53:35 +0800 Subject: [PATCH] remove rpath (cherry picked from commit 130c1f24e23a066bdb0f8255ffc014c1d63d6c0d) --- 0002-remove-rpath.patch | 123 ++++++++++++++++++++++++++++++++++++++++ oeAware-manager.spec | 6 +- 2 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 0002-remove-rpath.patch diff --git a/0002-remove-rpath.patch b/0002-remove-rpath.patch new file mode 100644 index 0000000..8fe3449 --- /dev/null +++ b/0002-remove-rpath.patch @@ -0,0 +1,123 @@ +From 91e6217329e1d99bbf3377edb6a8fad1c2bb365e Mon Sep 17 00:00:00 2001 +From: fly_1997 +Date: Mon, 20 Oct 2025 14:33:38 +0800 +Subject: [PATCH] remove rpath + +--- + CMakeLists.txt | 1 + + build.sh | 9 +++++---- + src/plugin/collect/pmu/CMakeLists.txt | 12 ------------ + src/plugin/scenario/analysis/CMakeLists.txt | 4 +--- + uninstall.sh | 7 +++++++ + 5 files changed, 14 insertions(+), 19 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 79e0158..5106319 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.16) + + project(oeAware-manager) + ++set(CMAKE_SKIP_RPATH TRUE) + set(CMAKE_CXX_STANDARD 14) + set(CMAKE_CXX_FLAGS "-rdynamic -std=c++14 -g -Wl,-z,relro,-z,now -Wall -Wextra -fPIC") + set(SDK_OUTPUT_LIBRARY_DIRECTORY ${CMAKE_BINARY_DIR}/output/sdk) +diff --git a/build.sh b/build.sh +index 93d5253..a6811cb 100644 +--- a/build.sh ++++ b/build.sh +@@ -97,8 +97,10 @@ elif [[ "$os_arch" == "aarch64" && "$build_kperf_by_src" == "ON" ]]; then + git checkout $libkperf_version + sh build.sh + cd .. +- mkdir ${script_dir}/include/oeaware/data/libkperf +- cp ${libkperf_inc}/* ${script_dir}/include/oeaware/data/libkperf ++ echo "install libkperf to system path" ++ mkdir /usr/include/libkperf ++ cp ${libkperf_inc}/* /usr/include/libkperf ++ cp ${libkperf_lib}/* /usr/lib64/ + elif [[ "$os_arch" == "aarch64" && "$build_kperf_by_src" == "OFF" ]]; then + echo "[NOTE] use libkperf by rpm" + libkperf_inc=/usr/include/libkperf +@@ -106,8 +108,7 @@ elif [[ "$os_arch" == "aarch64" && "$build_kperf_by_src" == "OFF" ]]; then + fi + + +-cmake .. -DLIB_KPERF_LIBPATH=${libkperf_lib} -DLIB_KPERF_INCPATH=${script_dir}/include/oeaware/data \ +- -DWITH_TEST=${with_test} -DWITH_DEBUG=${with_debug} -DWITH_ASAN=${with_asan} \ ++cmake .. -DWITH_TEST=${with_test} -DWITH_DEBUG=${with_debug} -DWITH_ASAN=${with_asan} \ + -DWITH_OPTIMIZATION=${with_optimization} -DENABLE_EBPF=${enable_ebpf} \ + -DWITH_REALTIME=${with_realtime} + make -j$(nproc) +\ No newline at end of file +diff --git a/src/plugin/collect/pmu/CMakeLists.txt b/src/plugin/collect/pmu/CMakeLists.txt +index 2ed0c57..8d00364 100644 +--- a/src/plugin/collect/pmu/CMakeLists.txt ++++ b/src/plugin/collect/pmu/CMakeLists.txt +@@ -1,9 +1,5 @@ + project(pmu_plugin) + +-# libkperf +-message("-- libkperf library path: ${LIB_KPERF_LIBPATH}") +-message("-- libkperf include path: ${LIB_KPERF_INCPATH}") +- + set(pmu_src + pmu_counting_collector.cpp + pmu_sampling_collector.cpp +@@ -17,14 +13,6 @@ set(pmu_src + + add_library(pmu SHARED ${pmu_src}) + +-include_directories(pmu PRIVATE +- ${LIB_KPERF_INCPATH} +-) +- +-target_link_directories(pmu PUBLIC +- ${LIB_KPERF_LIBPATH} +-) +- + if (WITH_ASAN) + enable_asan(pmu) + endif() +diff --git a/src/plugin/scenario/analysis/CMakeLists.txt b/src/plugin/scenario/analysis/CMakeLists.txt +index 277a0ec..a67a37d 100644 +--- a/src/plugin/scenario/analysis/CMakeLists.txt ++++ b/src/plugin/scenario/analysis/CMakeLists.txt +@@ -1,6 +1,4 @@ + project(analysis) +-message("-- libkperf library path: ${LIB_KPERF_LIBPATH}") +-message("-- libkperf include path: ${LIB_KPERF_INCPATH}") + + set(analysis_src + analysis/analysis.cpp +@@ -26,9 +24,9 @@ set(oeaware_src analysis_oeaware.cpp) + add_library(analysis_lib OBJECT ${analysis_src}) + + target_include_directories(analysis_lib PUBLIC ++ ${CMAKE_SOURCE_DIR}/include/oeaware/data + ${CMAKE_CURRENT_SOURCE_DIR}/analysis + ${CMAKE_CURRENT_SOURCE_DIR}/common +- ${LIB_KPERF_INCPATH} + ../../../common + /usr/include/libnl3 + ) +diff --git a/uninstall.sh b/uninstall.sh +index e0e703b..290cded 100755 +--- a/uninstall.sh ++++ b/uninstall.sh +@@ -1,4 +1,11 @@ + #! /bin/bash ++ ++set -e ++ ++#remove libkperf ++rm -rf /usr/include/libkperf ++rm -rf /usr/lib64/libkperf.so* ++ + #remove header + rm -rf /usr/include/oeaware + #remove config +-- +2.33.0 + diff --git a/oeAware-manager.spec b/oeAware-manager.spec index fbaa61c..368122f 100644 --- a/oeAware-manager.spec +++ b/oeAware-manager.spec @@ -1,11 +1,12 @@ Name: oeAware-manager Version: v2.1.1 -Release: 2 +Release: 3 Summary: OeAware is a framework for implementing low-load collection, sensing, and tuning on openEuler. License: MulanPSL2 URL: https://gitee.com/openeuler/%{name} Source0: %{name}-%{version}.tar.gz Patch1: 0001-fix-numa_sched_tune-6.6-sched-feature.patch +Patch2: 0002-remove-rpath.patch BuildRequires: cmake make gcc-c++ BuildRequires: boost-devel @@ -107,6 +108,9 @@ fi %attr(0644, root, root) %{_includedir}/oeaware/data/*.h %changelog +* Mon Oct 20 2025 fly_1997 -v2.1.1-3 +- remove rpath. + * Fri Sep 19 2025 heppen -v2.1.1-2 - fix: numa_sched_tune adapt to kernel 6.6 sched feature path. -- Gitee