1 |
commit: 3884552b6dd1bdeea1ca82bd23b6736c519ebe90 |
2 |
Author: Han Gao <rabenda.cn <AT> gmail <DOT> com> |
3 |
AuthorDate: Sun Mar 27 13:05:18 2022 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Mar 30 18:56:21 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3884552b |
7 |
|
8 |
dev-qt/qtcore: use link option -pthread instead of -lpthread |
9 |
|
10 |
Bug: https://bugs.gentoo.org/803470 |
11 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
12 |
Signed-off-by: Han Gao <rabenda.cn <AT> gmail.com> |
13 |
Closes: https://github.com/gentoo/gentoo/pull/24711 |
14 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
15 |
|
16 |
dev-qt/qtcore/files/qtcore-5.15.3-pthread.patch | 41 +++++++++++++++++++++++++ |
17 |
dev-qt/qtcore/qtcore-5.15.3.ebuild | 4 +++ |
18 |
2 files changed, 45 insertions(+) |
19 |
|
20 |
diff --git a/dev-qt/qtcore/files/qtcore-5.15.3-pthread.patch b/dev-qt/qtcore/files/qtcore-5.15.3-pthread.patch |
21 |
new file mode 100644 |
22 |
index 000000000000..c83c59ac3113 |
23 |
--- /dev/null |
24 |
+++ b/dev-qt/qtcore/files/qtcore-5.15.3-pthread.patch |
25 |
@@ -0,0 +1,41 @@ |
26 |
+# Use link option -pthread instead of -lpthread |
27 |
+ |
28 |
+# https://github.com/riscv-collab/riscv-gcc/issues/12 use Option 4 |
29 |
+# https://stackoverflow.com/questions/23250863/difference-between-pthread-and-lpthread-while-compiling |
30 |
+# In riscv, "-pthread" equivalent to add link option "--push-state --as-needed -latomic --pop-state" |
31 |
+ |
32 |
+diff --git a/mkspecs/common/linux.conf b/mkspecs/common/linux.conf |
33 |
+index 544cc227..add969be 100644 |
34 |
+--- a/mkspecs/common/linux.conf |
35 |
++++ b/mkspecs/common/linux.conf |
36 |
+@@ -33,7 +33,7 @@ QMAKE_LIBS_EGL = -lEGL |
37 |
+ QMAKE_LIBS_OPENGL = -lGL |
38 |
+ QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 |
39 |
+ QMAKE_LIBS_OPENVG = -lOpenVG |
40 |
+-QMAKE_LIBS_THREAD = -lpthread |
41 |
++QMAKE_LIBS_THREAD = -pthread |
42 |
+ QMAKE_LIBS_VULKAN = |
43 |
+ |
44 |
+ QMAKE_INCDIR_WAYLAND = |
45 |
+diff --git a/src/corelib/configure.json b/src/corelib/configure.json |
46 |
+index 9b5d19d4..da028fb2 100644 |
47 |
+--- a/src/corelib/configure.json |
48 |
++++ b/src/corelib/configure.json |
49 |
+@@ -355,7 +355,7 @@ |
50 |
+ "std::future<int> f = std::async([]() { return 42; });", |
51 |
+ "(void)f.get();" |
52 |
+ ], |
53 |
+- "qmake": "unix:LIBS += -lpthread" |
54 |
++ "qmake": "unix:LIBS += -pthread" |
55 |
+ } |
56 |
+ }, |
57 |
+ "cxx11_random": { |
58 |
+@@ -466,7 +466,7 @@ |
59 |
+ "shm_open(\"test\", O_RDWR | O_CREAT | O_EXCL, 0666);", |
60 |
+ "shm_unlink(\"test\");" |
61 |
+ ], |
62 |
+- "qmake": "linux: LIBS += -lpthread -lrt" |
63 |
++ "qmake": "linux: LIBS += -pthread -lrt" |
64 |
+ } |
65 |
+ }, |
66 |
+ "linkat": { |
67 |
|
68 |
diff --git a/dev-qt/qtcore/qtcore-5.15.3.ebuild b/dev-qt/qtcore/qtcore-5.15.3.ebuild |
69 |
index 156e4f73b725..8e924cdfabd0 100644 |
70 |
--- a/dev-qt/qtcore/qtcore-5.15.3.ebuild |
71 |
+++ b/dev-qt/qtcore/qtcore-5.15.3.ebuild |
72 |
@@ -43,6 +43,10 @@ QT5_GENTOO_PRIVATE_CONFIG=( |
73 |
!:xml |
74 |
) |
75 |
|
76 |
+PATCHES=( |
77 |
+ "${FILESDIR}"/${PN}-5.15.3-pthread.patch # bug 803470 |
78 |
+) |
79 |
+ |
80 |
pkg_pretend() { |
81 |
use kernel_linux || return |
82 |
get_running_version |