diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..c9a618551d7d788cde5f4326178966a3917277e9 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.gz filter=lfs diff=lfs merge=lfs -text diff --git a/.lfsconfig b/.lfsconfig new file mode 100644 index 0000000000000000000000000000000000000000..ba19b1cc43cbf622b0f618653cdd0e2bd36680df --- /dev/null +++ b/.lfsconfig @@ -0,0 +1,2 @@ +[lfs] + url = https://artlfs.openeuler.openatom.cn/src-openEuler/SoftBR \ No newline at end of file diff --git a/0001-Modify-libdynamorio-to-static-library.patch b/0001-Modify-libdynamorio-to-static-library.patch new file mode 100644 index 0000000000000000000000000000000000000000..e973d05b9f8f81ba8147d1d58593b8d8c91e627d --- /dev/null +++ b/0001-Modify-libdynamorio-to-static-library.patch @@ -0,0 +1,25 @@ +From 2cf52338d63ae0331fa8efd26e4dd61376ebbad6 Mon Sep 17 00:00:00 2001 +From: wjx +Date: Thu, 5 Jun 2025 21:19:45 +0800 +Subject: [PATCH] Modify libdynamorio to static library + +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 47676e2..4088b2c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -23,7 +23,7 @@ target_include_directories(profiler PUBLIC ${PROJECT_SOURCE_DIR}/include ${PROJE + + add_subdirectory(third_party) + link_directories(${PROJECT_SOURCE_DIR}/third_party/DynamoRIO/lib64/debug) +-target_link_libraries(profiler PRIVATE pthread ${PROJECT_SOURCE_DIR}/third_party/DynamoRIO/lib64/release/libdynamorio.so unwind unwind-generic) ++target_link_libraries(profiler PRIVATE pthread ${PROJECT_SOURCE_DIR}/third_party/DynamoRIO/lib64/release/libdynamorio_static.a unwind unwind-generic) + + if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") + add_definitions(-D__x86_64__) +-- +2.25.1 + diff --git a/DynamoRIO-AArch64-Linux-10.0.0.tar.gz b/DynamoRIO-AArch64-Linux-10.0.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9c2d85205ea592a753ac5065efad713e63843b47 --- /dev/null +++ b/DynamoRIO-AArch64-Linux-10.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b532232023c46f99e82c8c70b5634c09222c12c07a928f7d08e15d37b20ac8a +size 166138532 diff --git a/SoftBR-1.0.0.zip b/SoftBR-1.0.0.zip new file mode 100644 index 0000000000000000000000000000000000000000..a943e013aeabbe2370c443c046751b975d5792a0 Binary files /dev/null and b/SoftBR-1.0.0.zip differ diff --git a/SoftBR.spec b/SoftBR.spec new file mode 100644 index 0000000000000000000000000000000000000000..2e9458aca9e5204a3aceed317a00e66f4635d2fb --- /dev/null +++ b/SoftBR.spec @@ -0,0 +1,48 @@ +Name: SoftBR +Version: 1.0.0 +Release: 1 +Summary: Software Implemented Architecture Independent Tool For Branch Tracking. +License: Apache-2.0 WITH LLVM-exception +URL: https://gitee.com/openeuler/SoftBR +Source0: SoftBR-1.0.0.zip +Source1: DynamoRIO-AArch64-Linux-10.0.0.tar.gz +Patch0: 0001-Modify-libdynamorio-to-static-library.patch + +BuildRequires: libunwind +BuildRequires: libunwind-devel +BuildRequires: clang +BuildRequires: cmake + + +ExclusiveArch: aarch64 +%description +Softbr is a software implemented architecture independent +branch tracking tool. It can be used to record branch jumps + (like LBR/BRBE). + +%prep +%setup -n SoftBR-1.0.0 +%autopatch -p1 +tar -zxvf %{SOURCE1} -C ./third_party +cd third_party +mv DynamoRIO-AArch64-Linux-10.0.0 DynamoRIO + + +%build +export CC=/usr/bin/clang +export CXX=/usr/bin/clang++ +mkdir ./build +cd build +cmake .. && make -j$(nproc) + + +%install +mkdir -p %{buildroot}%{_libdir} +install -m 0755 build/libprofiler.so %{buildroot}%{_libdir}/libprofiler.so + +%files -n %{name} +%{_libdir}/libprofiler.so + +%changelog +* Wed May 21 2025 Wangjiaxin - 1.0.0-1 +- Package init \ No newline at end of file