1 |
commit: abadda5a754ae656af46a3a02f7bedc50343a797 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Sep 13 18:45:15 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Sep 13 18:45:23 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=abadda5a |
7 |
|
8 |
dev-libs/boehm-gc: fix configure tests with Clang 15 |
9 |
|
10 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
11 |
|
12 |
dev-libs/boehm-gc/boehm-gc-8.2.2-r1.ebuild | 63 ++++++++++++++++++++++ |
13 |
.../files/boehm-gc-8.2.2-clang-15-configure.patch | 43 +++++++++++++++ |
14 |
2 files changed, 106 insertions(+) |
15 |
|
16 |
diff --git a/dev-libs/boehm-gc/boehm-gc-8.2.2-r1.ebuild b/dev-libs/boehm-gc/boehm-gc-8.2.2-r1.ebuild |
17 |
new file mode 100644 |
18 |
index 000000000000..28f0b8b30a27 |
19 |
--- /dev/null |
20 |
+++ b/dev-libs/boehm-gc/boehm-gc-8.2.2-r1.ebuild |
21 |
@@ -0,0 +1,63 @@ |
22 |
+# Copyright 1999-2022 Gentoo Authors |
23 |
+# Distributed under the terms of the GNU General Public License v2 |
24 |
+ |
25 |
+EAPI=8 |
26 |
+ |
27 |
+# autotools for Clang 15 configure patch |
28 |
+inherit autotools multilib-minimal #libtool |
29 |
+ |
30 |
+MY_P="gc-${PV}" |
31 |
+ |
32 |
+DESCRIPTION="The Boehm-Demers-Weiser conservative garbage collector" |
33 |
+HOMEPAGE="https://www.hboehm.info/gc/ https://github.com/ivmai/bdwgc/" |
34 |
+SRC_URI="https://github.com/ivmai/bdwgc/releases/download/v${PV}/${MY_P}.tar.gz" |
35 |
+S="${WORKDIR}/${MY_P}" |
36 |
+ |
37 |
+LICENSE="boehm-gc" |
38 |
+# SONAME: libgc.so.1 libgccpp.so.1 |
39 |
+# We've been using subslot 0 for these instead of "1.1". |
40 |
+SLOT="0" |
41 |
+# Upstream marked this version as "Pre-release" |
42 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
43 |
+IUSE="cxx +large static-libs +threads" |
44 |
+ |
45 |
+RDEPEND=">=dev-libs/libatomic_ops-7.4[${MULTILIB_USEDEP}]" |
46 |
+DEPEND="${RDEPEND}" |
47 |
+BDEPEND="virtual/pkgconfig" |
48 |
+ |
49 |
+PATCHES=( |
50 |
+ "${FILESDIR}"/${PN}-8.2.2-clang-15-configure.patch |
51 |
+) |
52 |
+ |
53 |
+src_prepare() { |
54 |
+ default |
55 |
+ |
56 |
+ # bug #594754 |
57 |
+ #elibtoolize |
58 |
+ |
59 |
+ eautoreconf |
60 |
+} |
61 |
+ |
62 |
+multilib_src_configure() { |
63 |
+ local config=( |
64 |
+ --disable-docs |
65 |
+ --with-libatomic-ops |
66 |
+ $(use_enable cxx cplusplus) |
67 |
+ $(use_enable static-libs static) |
68 |
+ $(use threads || echo --disable-threads) |
69 |
+ $(use_enable large large-config) |
70 |
+ ) |
71 |
+ |
72 |
+ ECONF_SOURCE="${S}" econf "${config[@]}" |
73 |
+} |
74 |
+ |
75 |
+multilib_src_install_all() { |
76 |
+ local HTML_DOCS=( doc/*.md ) |
77 |
+ einstalldocs |
78 |
+ dodoc doc/README{.environment,.linux,.macros} |
79 |
+ |
80 |
+ # Package provides .pc files |
81 |
+ find "${ED}" -name '*.la' -delete || die |
82 |
+ |
83 |
+ newman doc/gc.man GC_malloc.1 |
84 |
+} |
85 |
|
86 |
diff --git a/dev-libs/boehm-gc/files/boehm-gc-8.2.2-clang-15-configure.patch b/dev-libs/boehm-gc/files/boehm-gc-8.2.2-clang-15-configure.patch |
87 |
new file mode 100644 |
88 |
index 000000000000..87045eaa912f |
89 |
--- /dev/null |
90 |
+++ b/dev-libs/boehm-gc/files/boehm-gc-8.2.2-clang-15-configure.patch |
91 |
@@ -0,0 +1,43 @@ |
92 |
+https://github.com/ivmai/bdwgc/pull/474 |
93 |
+ |
94 |
+From b3428e52cb9af18d6c85d0027b9c86e9b44e2e4f Mon Sep 17 00:00:00 2001 |
95 |
+From: Sam James <sam@g.o> |
96 |
+Date: Tue, 13 Sep 2022 19:37:59 +0100 |
97 |
+Subject: [PATCH] Fix configure with Clang 15 (implicit function declarations) |
98 |
+ |
99 |
+Clang 15 makes implicit function declarations an error by default |
100 |
+which leads to configure falsely thinking `pthread_setname_np` is |
101 |
+not present: |
102 |
+``` |
103 |
+checking for pthread_setname_np... no |
104 |
+``` |
105 |
+ |
106 |
+This fixes that issue and the following errors: |
107 |
+``` |
108 |
+error: call to undeclared function 'pthread_setname_np'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] |
109 |
+error: call to undeclared function 'pthread_setname_np'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] |
110 |
+``` |
111 |
+ |
112 |
+Signed-off-by: Sam James <sam@g.o> |
113 |
+--- a/configure.ac |
114 |
++++ b/configure.ac |
115 |
+@@ -834,12 +834,16 @@ AS_IF([test "$THREADS" = posix], |
116 |
+ [AC_MSG_CHECKING(for pthread_setname_np) |
117 |
+ old_CFLAGS="$CFLAGS" |
118 |
+ CFLAGS="$CFLAGS $CFLAGS_EXTRA -Werror" |
119 |
+- AC_TRY_COMPILE([#include <pthread.h>], |
120 |
++ AC_TRY_COMPILE([ |
121 |
++#define _GNU_SOURCE 1 |
122 |
++#include <pthread.h>], |
123 |
+ [pthread_setname_np("thread-name")], |
124 |
+ [AC_MSG_RESULT([yes (w/o tid)]) |
125 |
+ AC_DEFINE([HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID], [1], |
126 |
+ [Define to use 'pthread_setname_np(const char*)' function.])], |
127 |
+- [AC_TRY_COMPILE([#include <pthread.h>], |
128 |
++ [AC_TRY_COMPILE([ |
129 |
++#define _GNU_SOURCE 1 |
130 |
++#include <pthread.h>], |
131 |
+ [pthread_setname_np(pthread_self(), "thread-name-%u", 0)], |
132 |
+ [AC_MSG_RESULT([yes (with tid and arg)]) |
133 |
+ AC_DEFINE([HAVE_PTHREAD_SETNAME_NP_WITH_TID_AND_ARG], [1], |
134 |
+ |