[Update] Fix RPATH problem by ld.so.conf.d

This commit is contained in:
Mingchuan Wu 2023-03-06 14:42:42 +08:00
parent 6a3500d976
commit 52de1c95e7
2 changed files with 45 additions and 5 deletions

View File

@ -0,0 +1,24 @@
From 3f7bcee573a1b504a151f491c12e26e752c68cea Mon Sep 17 00:00:00 2001
From: Mingchuan Wu <wumingchuan1992@foxmail.com>
Date: Mon, 6 Mar 2023 11:51:49 +0800
Subject: [PATCH] [Build] Fix strip problem.
---
CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1cfb776..720bac9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -91,6 +91,7 @@ add_library(pin_user SHARED
target_link_libraries(pin_user
MLIRServerAPI
)
+add_custom_command(TARGET pin_user COMMAND strip libpin_user.so)
add_custom_command(TARGET pin_user COMMAND sha256sum libpin_user.so > libpin_user.sha256)
# pin_server
--
Gitee

View File

@ -1,6 +1,6 @@
Name: pin-server
Version: 0.4.0
Release: 4
Release: 5
Summary: Pin (Plug-IN framework) server provides plugin APIs for compiler optimization developers to develop optimization pass.
License: Apache 2.0
URL: https://gitee.com/openeuler/pin-server
@ -24,6 +24,7 @@ Patch11: 0011-Pin-server-Add-NopOp-EHElseOp-AsmOp-SwitchOp-LabelOp.patch
Patch12: 0012-Pin-server-Support-Vectortype.patch
Patch13: 0013-Pin-server-Support-Vectortype.patch
Patch14: 0014-Pin-server-Fix-AWC-pass-can-complice-can-compile-a-c.patch
Patch15: 0015-Pin-server-Fix-strip-problem.patch
%description
Pin (Plug-IN framework) server provides plugin APIs for compiler optimization developers to develop optimization pass.
@ -36,9 +37,6 @@ Requires: grpc protobuf
%description demo
A demo for pin-server
# skip debuginfo packages
%global debug_package %{nil}
%prep
%setup -q
@ -56,6 +54,7 @@ A demo for pin-server
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
mkdir -p _build
cd _build
@ -69,8 +68,18 @@ cd _build
cd _build
%make_install
mkdir -p %{buildroot}/etc/ld.so.conf.d
echo "{_libdir}" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf
find %{_bindir} -type f -name "pin_server" -exec strip "{}" ";"
find %{_libdir} -type f -name "*.so" -exec strip "{}" ";"
find %{_libdir} -type f -name "libMLIRPluginServer.so" -exec strip "{}" ";"
find %{_libdir} -type f -name "libMLIRServerAPI.so" -exec strip "{}" ";"
%post
/sbin/ldconfig
%postun
/sbin/ldconfig
%files
%license LICENSE
@ -83,8 +92,15 @@ find %{_libdir} -type f -name "*.so" -exec strip "{}" ";"
%attr(0755,root,root) %{_libdir}/libMLIRServerAPI.so
%attr(0755,root,root) %{_libdir}/libMLIRServerAPI.so.12
%attr(0644,root,root) %{_libdir}/libpin_user.sha256
%config(noreplace) /etc/ld.so.conf.d/%{name}-%{_arch}.conf
%changelog
* Mon Mar 6 2023 wumingchuan <wumingchuan1992@foxmail.com> - 0.4.0-5
- Type:Update
- ID:NA
- SUG:NA
- DESC: Fix RPATH problem by ld.so.conf.d
* Fri Mar 3 2023 wumingchuan <wumingchuan1992@foxmail.com> - 0.4.0-4
- Type:Update
- ID:NA