Skip to content

Commit 0d1f076

Browse files
[Flatpak SDK] rr unable to locate librrpage.so
https://bugs.webkit.org/show_bug.cgi?id=230942 Patch by Philippe Normand <[email protected]> on 2021-09-29 Reviewed by Sergio Villar Senin. Look for resources in cmake's install lib dir. * elements/sdk/rr.bst: * patches/rr/0001-cmake-Look-for-resources-in-cmake-s-install-lib-dir.patch: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@283213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent fe2d108 commit 0d1f076

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed

Tools/buildstream/ChangeLog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2021-09-29 Philippe Normand <[email protected]>
2+
3+
[Flatpak SDK] rr unable to locate librrpage.so
4+
https://bugs.webkit.org/show_bug.cgi?id=230942
5+
6+
Reviewed by Sergio Villar Senin.
7+
8+
Look for resources in cmake's install lib dir.
9+
10+
* elements/sdk/rr.bst:
11+
* patches/rr/0001-cmake-Look-for-resources-in-cmake-s-install-lib-dir.patch: Added.
12+
113
2021-09-28 Philippe Normand <[email protected]>
214

315
[Flatpak SDK] Update libsoup3 and friends

Tools/buildstream/elements/sdk/rr.bst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ sources:
1515
url: github_com:rr-debugger/rr
1616
track: master
1717
ref: 5.5.0-5-gc168a271dd5f3685834a74e5d96f60cc89a9f6c0
18+
- kind: patch
19+
path: patches/rr/0001-cmake-Look-for-resources-in-cmake-s-install-lib-dir.patch
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
From 26ba5099f19ba2e00f84aff797be7740fead4aee Mon Sep 17 00:00:00 2001
2+
From: Philippe Normand <[email protected]>
3+
Date: Wed, 29 Sep 2021 10:22:00 +0100
4+
Subject: [PATCH] cmake: Look for resources in cmake's install lib dir
5+
6+
---
7+
CMakeLists.txt | 4 ++++
8+
src/config.h.in | 6 ++++++
9+
src/util.cc | 11 +++--------
10+
3 files changed, 13 insertions(+), 8 deletions(-)
11+
create mode 100644 src/config.h.in
12+
13+
diff --git a/CMakeLists.txt b/CMakeLists.txt
14+
index e28d95aa..d38b3df2 100644
15+
--- a/CMakeLists.txt
16+
+++ b/CMakeLists.txt
17+
@@ -49,6 +49,10 @@ configure_file(
18+
${CMAKE_SOURCE_DIR}/src/git_revision.h.in
19+
${CMAKE_BINARY_DIR}/git_revision.h
20+
)
21+
+configure_file(
22+
+ ${CMAKE_SOURCE_DIR}/src/config.h.in
23+
+ ${CMAKE_BINARY_DIR}/config.h
24+
+)
25+
26+
set(FLAGS_COMMON "-D__USE_LARGEFILE64 -pthread")
27+
set(supports32bit true)
28+
diff --git a/src/config.h.in b/src/config.h.in
29+
new file mode 100644
30+
index 00000000..059aeb43
31+
--- /dev/null
32+
+++ b/src/config.h.in
33+
@@ -0,0 +1,6 @@
34+
+#ifndef RR_CONFIG_H_
35+
+#define RR_CONFIG_H_
36+
+
37+
+#define RESOURCES_LIB_DIR "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/"
38+
+
39+
+#endif
40+
diff --git a/src/util.cc b/src/util.cc
41+
index c57ae7b6..b2ac7bac 100644
42+
--- a/src/util.cc
43+
+++ b/src/util.cc
44+
@@ -45,6 +45,7 @@
45+
#include "kernel_metadata.h"
46+
#include "log.h"
47+
#include "seccomp-bpf.h"
48+
+#include "config.h"
49+
50+
void good_random(uint8_t* out, size_t out_len);
51+
52+
@@ -1261,8 +1262,7 @@ static string read_exe_dir() {
53+
string resource_path() {
54+
string resource_path = Flags::get().resource_path;
55+
if (resource_path.empty()) {
56+
- static string exe_path = read_exe_dir() + "../";
57+
- return exe_path;
58+
+ return RESOURCES_LIB_DIR;
59+
}
60+
return resource_path;
61+
}
62+
@@ -1294,16 +1294,11 @@ bool running_under_rr(bool cache) {
63+
64+
string find_helper_library(const char *basepath)
65+
{
66+
- string lib_path = resource_path() + "lib64/rr/";
67+
+ string lib_path = resource_path() + "rr/";
68+
string file_name = lib_path + basepath;
69+
if (access(file_name.c_str(), F_OK) == 0) {
70+
return lib_path;
71+
}
72+
- lib_path = resource_path() + "lib/rr/";
73+
- file_name = lib_path + basepath;
74+
- if (access(file_name.c_str(), F_OK) == 0) {
75+
- return lib_path;
76+
- }
77+
// File does not exist. Assume install put it in LD_LIBRARY_PATH.
78+
lib_path = "";
79+
return lib_path;
80+
--
81+
2.31.1
82+

0 commit comments

Comments
 (0)