summaryrefslogtreecommitdiff
path: root/net-fs
diff options
context:
space:
mode:
authorFco Javier Felix <ffelix@inode64.com>2022-09-24 08:30:58 +0200
committerSam James <sam@gentoo.org>2022-09-30 03:46:28 +0100
commite24041ef403ad622cc187eea98e42b0fa291cf11 (patch)
tree31d8ccb21ed06eee982b9647894159c2eae693e0 /net-fs
parentx11-wm/jwm: Stabilize 2.4.2 x86, #867157 (diff)
downloadgentoo-e24041ef403ad622cc187eea98e42b0fa291cf11.tar.gz
gentoo-e24041ef403ad622cc187eea98e42b0fa291cf11.tar.bz2
gentoo-e24041ef403ad622cc187eea98e42b0fa291cf11.zip
net-fs/samba: Make libunwind optional (fix automagic dep)
It's only for debug and backtraces. Backport from samba-4.17, Look at the bugs in: https://gitlab.com/samba-team/samba/-/merge_requests/2401?commit_id=ac8064cb0d79db377df75a22a240632dbc37f99f https://gitlab.com/samba-team/samba/-/commit/14feb93d481011765f62614ab49b304e17e4f6fd See: https://github.com/gentoo/gentoo/pull/24280 Closes: https://bugs.gentoo.org/791349 Closes: https://github.com/gentoo/gentoo/pull/27422 Package-Manager: Portage-3.0.36, pkgcheck-0.10.14 Signed-off-by: Fco Javier Felix <web@inode64.com> Signed-off-by: Fco Javier Felix <ffelix@inode64.com> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-fs')
-rw-r--r--net-fs/samba/files/samba-4.15.9-libunwind-automagic.patch118
-rw-r--r--net-fs/samba/metadata.xml1
-rw-r--r--net-fs/samba/samba-4.15.9-r1.ebuild (renamed from net-fs/samba/samba-4.15.9.ebuild)11
-rw-r--r--net-fs/samba/samba-4.16.0-r2.ebuild (renamed from net-fs/samba/samba-4.16.0-r1.ebuild)11
-rw-r--r--net-fs/samba/samba-4.16.1-r1.ebuild (renamed from net-fs/samba/samba-4.16.1.ebuild)11
-rw-r--r--net-fs/samba/samba-4.16.2-r1.ebuild (renamed from net-fs/samba/samba-4.16.2.ebuild)11
-rw-r--r--net-fs/samba/samba-4.16.4-r1.ebuild (renamed from net-fs/samba/samba-4.16.4.ebuild)11
7 files changed, 159 insertions, 15 deletions
diff --git a/net-fs/samba/files/samba-4.15.9-libunwind-automagic.patch b/net-fs/samba/files/samba-4.15.9-libunwind-automagic.patch
new file mode 100644
index 000000000000..c3a2c802e6e9
--- /dev/null
+++ b/net-fs/samba/files/samba-4.15.9-libunwind-automagic.patch
@@ -0,0 +1,118 @@
+https://gitlab.com/samba-team/samba/-/commit/14feb93d481011765f62614ab49b304e17e4f6fd
+https://gitlab.com/samba-team/samba/-/merge_requests/2401?commit_id=ac8064cb0d79db377df75a22a240632dbc37f99f
+https://bugs.gentoo.org/791349
+
+From 14feb93d481011765f62614ab49b304e17e4f6fd Mon Sep 17 00:00:00 2001
+From: Andrew Bartlett <abartlet@samba.org>
+Date: Tue, 7 Jun 2022 15:07:59 +1200
+Subject: [PATCH] lib/util: Prefer backtrace_symbols() for internal backtraces
+
+Backtraces when Samba is in PANIC state are better with
+backtrace_symbols() than with libunwind on Ubuntu 20.04 x86_64
+so move libunwind to a off-by-default option, prompted for
+if backtrace_symbols() is not available.
+
+Based on a request by Fco Javier Felix <ffelix@inode64.com>
+
+Signed-off-by: Andrew Bartlett <abartlet@samba.org>
+Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
+--- a/lib/util/fault.c
++++ b/lib/util/fault.c
+@@ -222,9 +222,13 @@ _PUBLIC_ void smb_panic(const char *why)
+ void log_stack_trace(void)
+ {
+ #ifdef HAVE_LIBUNWIND
+- /* Try to use libunwind before any other technique since on ia64
+- * libunwind correctly walks the stack in more circumstances than
+- * backtrace.
++ /*
++ * --with-libunwind is required to use libunwind, the
++ * backtrace_symbols() code below is the default.
++ *
++ * This code is available because a previous version of this
++ * comment asserted that on ia64 libunwind correctly walks the
++ * stack in more circumstances than backtrace.
+ */
+ unw_cursor_t cursor;
+ unw_context_t uc;
+--- a/lib/util/wscript
++++ b/lib/util/wscript
+@@ -2,6 +2,15 @@ def options(opt):
+ ''' This is a bit strange, but disable is the flag, not enable. '''
+ opt.add_option('--disable-fault-handling', action='store_true', dest='disable_fault_handling', help=('disable the fault handlers'), default=False)
+
++ # We do not want libunwind by default (backtrace_symbols() in
++ # glibc is better) but allow (eg) IA-64 to build with it where it
++ # might be better (per old comment in fault.c)
++ opt.samba_add_onoff_option('libunwind',
++ default=None,
++ help='''Use libunwind instead of the default backtrace_symbols()
++ from libc, for example on IA-64 where it might give a better
++ backtrace.''')
++
+ opt.add_option('--with-systemd',
+ help=("Enable systemd integration"),
+ action='store_true', dest='enable_systemd')
+--- a/lib/util/wscript_configure
++++ b/lib/util/wscript_configure
+@@ -1,23 +1,35 @@
+ #!/usr/bin/env python
+-from waflib import Logs, Options
++from waflib import Logs, Options, Errors
+
+ import os, sys
+
+ if Options.options.disable_fault_handling:
+ conf.DEFINE('HAVE_DISABLE_FAULT_HANDLING',1)
+
+-# backtrace could be in libexecinfo or in libc
++# backtrace could be in libexecinfo or in libc.
++# This is our preferred backtrace handler (more useful output than libunwind as at Ubuntu 20.04 x86_64)
+ conf.CHECK_FUNCS_IN('backtrace backtrace_symbols', 'execinfo', checklibc=True, headers='execinfo.h')
+ conf.CHECK_HEADERS('execinfo.h')
+
+ conf.SET_TARGET_TYPE('LIBUNWIND', 'EMPTY')
+-if conf.check_cfg(package='libunwind-generic',
+- args='--cflags --libs',
+- msg='Checking for libunwind',
+- uselib_store='LIBUNWIND',
+- mandatory=False):
+- if conf.CHECK_HEADERS('libunwind.h'):
+- conf.SET_TARGET_TYPE('LIBUNWIND', 'SYSLIB')
++if Options.options.with_libunwind:
++ if conf.check_cfg(package='libunwind-generic',
++ args='--cflags --libs',
++ msg='Checking for libunwind',
++ uselib_store='LIBUNWIND',
++ mandatory=False):
++ if conf.CHECK_HEADERS('libunwind.h'):
++ conf.SET_TARGET_TYPE('LIBUNWIND', 'SYSLIB')
++ else:
++ raise Errors.WafError('--with-libunwind specified but libunwind not found')
++elif Options.options.with_libunwind == None:
++ if not conf.CONFIG_SET('HAVE_BACKTRACE_SYMBOLS') \
++ and not Options.options.disable_fault_handling:
++ raise Errors.WafError(
++'''backtrace_symbols() not found but
++--with-libunwind not specified.
++Use --without-libunwind to build without internal backtrace support or
++--disable-fault-handling to totally defer fault handling to the OS.''')
+
+ conf.CHECK_STRUCTURE_MEMBER('struct statvfs', 'f_frsize', define='HAVE_FRSIZE', headers='sys/statvfs.h')
+
+--- a/script/autobuild.py
++++ b/script/autobuild.py
+@@ -480,10 +480,11 @@ tasks = {
+ # MIT Kerberos from the current system. Runtime behaviour is
+ # confirmed via the ktest (static ccache and keytab) environment
+
++ # This environment also used to confirm we can still build with --with-libunwind
+ "samba-ktest-mit": {
+ "sequence": [
+ ("random-sleep", random_sleep(300, 900)),
+- ("configure", "./configure.developer --without-ad-dc --with-system-mitkrb5 " + samba_configure_params),
++ ("configure", "./configure.developer --without-ad-dc --with-libunwind --with-system-mitkrb5 " + samba_configure_params),
+ ("make", "make -j"),
+ ("test", make_test(include_envs=[
+ "ktest", # ktest is also tested in fileserver, samba and
+GitLab
diff --git a/net-fs/samba/metadata.xml b/net-fs/samba/metadata.xml
index 0430625e206a..eedfdee5aad4 100644
--- a/net-fs/samba/metadata.xml
+++ b/net-fs/samba/metadata.xml
@@ -29,6 +29,7 @@
bundled heimdal.</flag>
<flag name="system-mitkrb5">Use <pkg>app-crypt/mit-krb5</pkg> instead of
<pkg>app-crypt/heimdal</pkg>.</flag>
+ <flag name="unwind">Enable libunwind usage for backtraces</flag>
<flag name="winbind">Enables support for the winbind auth daemon</flag>
</use>
<upstream>
diff --git a/net-fs/samba/samba-4.15.9.ebuild b/net-fs/samba/samba-4.15.9-r1.ebuild
index 3ea8aa274e59..6042a3515c40 100644
--- a/net-fs/samba/samba-4.15.9.ebuild
+++ b/net-fs/samba/samba-4.15.9-r1.ebuild
@@ -23,8 +23,8 @@ S="${WORKDIR}/${MY_P}"
LICENSE="GPL-3"
SLOT="0"
IUSE="acl addc ads ceph client cluster cpu_flags_x86_aes cups debug fam
-glusterfs gpg iprint json ldap pam profiling-data python quota +regedit selinux
-snapper spotlight syslog system-heimdal +system-mitkrb5 systemd test winbind
+glusterfs gpg iprint json ldap llvm-libunwind pam profiling-data python quota +regedit selinux
+snapper spotlight syslog system-heimdal +system-mitkrb5 systemd test unwind winbind
zeroconf"
REQUIRED_USE="${PYTHON_REQUIRED_USE}
@@ -87,7 +87,6 @@ COMMON_DEPEND="
net-dns/bind-tools[gssapi]
)
")
- !alpha? ( !sparc? ( sys-libs/libunwind:= ) )
acl? ( virtual/acl )
ceph? ( sys-cluster/ceph )
cluster? ( net-libs/rpcsvc-proto )
@@ -108,6 +107,10 @@ COMMON_DEPEND="
system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl,${MULTILIB_USEDEP}] )
system-mitkrb5? ( >=app-crypt/mit-krb5-1.19[${MULTILIB_USEDEP}] )
systemd? ( sys-apps/systemd:0= )
+ unwind? (
+ llvm-libunwind? ( sys-libs/llvm-libunwind:= )
+ !llvm-libunwind? ( sys-libs/libunwind:= )
+ )
zeroconf? ( net-dns/avahi[dbus] )
"
DEPEND="${COMMON_DEPEND}
@@ -141,6 +144,7 @@ BDEPEND="${PYTHON_DEPS}
PATCHES=(
"${FILESDIR}/${PN}-4.4.0-pam.patch"
"${FILESDIR}/ldb-2.5.2-skip-wav-tevent-check.patch"
+ "${FILESDIR}/${PN}-4.15.9-libunwind-automagic.patch"
)
#CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
@@ -229,6 +233,7 @@ multilib_src_configure() {
$(multilib_native_use_with systemd)
--systemd-install-services
--with-systemddir="$(systemd_get_systemunitdir)"
+ $(multilib_native_use_with unwind libunwind)
$(multilib_native_use_with winbind)
$(multilib_native_usex python '' '--disable-python')
$(multilib_native_use_enable zeroconf avahi)
diff --git a/net-fs/samba/samba-4.16.0-r1.ebuild b/net-fs/samba/samba-4.16.0-r2.ebuild
index a7d3fa8bb5d3..5e93ab77f6a8 100644
--- a/net-fs/samba/samba-4.16.0-r1.ebuild
+++ b/net-fs/samba/samba-4.16.0-r2.ebuild
@@ -23,8 +23,8 @@ S="${WORKDIR}/${MY_P}"
LICENSE="GPL-3"
SLOT="0"
IUSE="acl addc ads ceph client cluster cpu_flags_x86_aes cups debug fam
-glusterfs gpg iprint json ldap pam profiling-data python quota +regedit selinux
-snapper spotlight syslog system-heimdal +system-mitkrb5 systemd test winbind
+glusterfs gpg iprint json ldap llvm-libunwind pam profiling-data python quota +regedit selinux
+snapper spotlight syslog system-heimdal +system-mitkrb5 systemd test unwind winbind
zeroconf"
REQUIRED_USE="${PYTHON_REQUIRED_USE}
@@ -87,7 +87,6 @@ COMMON_DEPEND="
net-dns/bind-tools[gssapi]
)
")
- !alpha? ( !sparc? ( sys-libs/libunwind:= ) )
acl? ( virtual/acl )
ceph? ( sys-cluster/ceph )
cluster? ( net-libs/rpcsvc-proto )
@@ -108,6 +107,10 @@ COMMON_DEPEND="
system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl,${MULTILIB_USEDEP}] )
system-mitkrb5? ( >=app-crypt/mit-krb5-1.19[${MULTILIB_USEDEP}] )
systemd? ( sys-apps/systemd:0= )
+ unwind? (
+ llvm-libunwind? ( sys-libs/llvm-libunwind:= )
+ !llvm-libunwind? ( sys-libs/libunwind:= )
+ )
zeroconf? ( net-dns/avahi[dbus] )
"
DEPEND="${COMMON_DEPEND}
@@ -141,6 +144,7 @@ BDEPEND="${PYTHON_DEPS}
PATCHES=(
"${FILESDIR}/${PN}-4.4.0-pam.patch"
+ "${FILESDIR}/${PN}-4.15.9-libunwind-automagic.patch"
)
#CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
@@ -229,6 +233,7 @@ multilib_src_configure() {
$(multilib_native_use_with systemd)
--systemd-install-services
--with-systemddir="$(systemd_get_systemunitdir)"
+ $(multilib_native_use_with unwind libunwind)
$(multilib_native_use_with winbind)
$(multilib_native_usex python '' '--disable-python')
$(multilib_native_use_enable zeroconf avahi)
diff --git a/net-fs/samba/samba-4.16.1.ebuild b/net-fs/samba/samba-4.16.1-r1.ebuild
index 8b16a80d66cb..0c212106d9e4 100644
--- a/net-fs/samba/samba-4.16.1.ebuild
+++ b/net-fs/samba/samba-4.16.1-r1.ebuild
@@ -23,8 +23,8 @@ S="${WORKDIR}/${MY_P}"
LICENSE="GPL-3"
SLOT="0"
IUSE="acl addc ads ceph client cluster cpu_flags_x86_aes cups debug fam
-glusterfs gpg iprint json ldap pam profiling-data python quota +regedit selinux
-snapper spotlight syslog system-heimdal +system-mitkrb5 systemd test winbind
+glusterfs gpg iprint json ldap llvm-libunwind pam profiling-data python quota +regedit selinux
+snapper spotlight syslog system-heimdal +system-mitkrb5 systemd test unwind winbind
zeroconf"
REQUIRED_USE="${PYTHON_REQUIRED_USE}
@@ -87,7 +87,6 @@ COMMON_DEPEND="
net-dns/bind-tools[gssapi]
)
")
- !alpha? ( !sparc? ( sys-libs/libunwind:= ) )
acl? ( virtual/acl )
ceph? ( sys-cluster/ceph )
cluster? ( net-libs/rpcsvc-proto )
@@ -108,6 +107,10 @@ COMMON_DEPEND="
system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl,${MULTILIB_USEDEP}] )
system-mitkrb5? ( >=app-crypt/mit-krb5-1.19[${MULTILIB_USEDEP}] )
systemd? ( sys-apps/systemd:0= )
+ unwind? (
+ llvm-libunwind? ( sys-libs/llvm-libunwind:= )
+ !llvm-libunwind? ( sys-libs/libunwind:= )
+ )
zeroconf? ( net-dns/avahi[dbus] )
"
DEPEND="${COMMON_DEPEND}
@@ -142,6 +145,7 @@ BDEPEND="${PYTHON_DEPS}
PATCHES=(
"${FILESDIR}/${PN}-4.4.0-pam.patch"
"${FILESDIR}/${PN}-4.16.1-netdb-defines.patch"
+ "${FILESDIR}/${PN}-4.15.9-libunwind-automagic.patch"
)
#CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
@@ -230,6 +234,7 @@ multilib_src_configure() {
$(multilib_native_use_with systemd)
--systemd-install-services
--with-systemddir="$(systemd_get_systemunitdir)"
+ $(multilib_native_use_with unwind libunwind)
$(multilib_native_use_with winbind)
$(multilib_native_usex python '' '--disable-python')
$(multilib_native_use_enable zeroconf avahi)
diff --git a/net-fs/samba/samba-4.16.2.ebuild b/net-fs/samba/samba-4.16.2-r1.ebuild
index e5115c4e9c41..994f304e789e 100644
--- a/net-fs/samba/samba-4.16.2.ebuild
+++ b/net-fs/samba/samba-4.16.2-r1.ebuild
@@ -23,8 +23,8 @@ S="${WORKDIR}/${MY_P}"
LICENSE="GPL-3"
SLOT="0"
IUSE="acl addc ads ceph client cluster cpu_flags_x86_aes cups debug fam
-glusterfs gpg iprint json ldap pam profiling-data python quota +regedit selinux
-snapper spotlight syslog system-heimdal +system-mitkrb5 systemd test winbind
+glusterfs gpg iprint json ldap llvm-libunwind pam profiling-data python quota +regedit selinux
+snapper spotlight syslog system-heimdal +system-mitkrb5 systemd test unwind winbind
zeroconf"
REQUIRED_USE="${PYTHON_REQUIRED_USE}
@@ -87,7 +87,6 @@ COMMON_DEPEND="
net-dns/bind-tools[gssapi]
)
")
- !alpha? ( !sparc? ( sys-libs/libunwind:= ) )
acl? ( virtual/acl )
ceph? ( sys-cluster/ceph )
cluster? ( net-libs/rpcsvc-proto )
@@ -108,6 +107,10 @@ COMMON_DEPEND="
system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl,${MULTILIB_USEDEP}] )
system-mitkrb5? ( >=app-crypt/mit-krb5-1.19[${MULTILIB_USEDEP}] )
systemd? ( sys-apps/systemd:0= )
+ unwind? (
+ llvm-libunwind? ( sys-libs/llvm-libunwind:= )
+ !llvm-libunwind? ( sys-libs/libunwind:= )
+ )
zeroconf? ( net-dns/avahi[dbus] )
"
DEPEND="${COMMON_DEPEND}
@@ -143,6 +146,7 @@ PATCHES=(
"${FILESDIR}/${PN}-4.4.0-pam.patch"
"${FILESDIR}/${PN}-4.16.1-netdb-defines.patch"
"${FILESDIR}/${PN}-4.16.2-fix-musl-without-innetgr.patch"
+ "${FILESDIR}/${PN}-4.15.9-libunwind-automagic.patch"
)
#CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
@@ -232,6 +236,7 @@ multilib_src_configure() {
$(multilib_native_use_with systemd)
--systemd-install-services
--with-systemddir="$(systemd_get_systemunitdir)"
+ $(multilib_native_use_with unwind libunwind)
$(multilib_native_use_with winbind)
$(multilib_native_usex python '' '--disable-python')
$(multilib_native_use_enable zeroconf avahi)
diff --git a/net-fs/samba/samba-4.16.4.ebuild b/net-fs/samba/samba-4.16.4-r1.ebuild
index ae46c2cab18c..6dc422deafb4 100644
--- a/net-fs/samba/samba-4.16.4.ebuild
+++ b/net-fs/samba/samba-4.16.4-r1.ebuild
@@ -23,8 +23,8 @@ S="${WORKDIR}/${MY_P}"
LICENSE="GPL-3"
SLOT="0"
IUSE="acl addc ads ceph client cluster cpu_flags_x86_aes cups debug fam
-glusterfs gpg iprint json ldap pam profiling-data python quota +regedit selinux
-snapper spotlight syslog system-heimdal +system-mitkrb5 systemd test winbind
+glusterfs gpg iprint json ldap llvm-libunwind pam profiling-data python quota +regedit selinux
+snapper spotlight syslog system-heimdal +system-mitkrb5 systemd test unwind winbind
zeroconf"
REQUIRED_USE="${PYTHON_REQUIRED_USE}
@@ -87,7 +87,6 @@ COMMON_DEPEND="
net-dns/bind-tools[gssapi]
)
")
- !alpha? ( !sparc? ( sys-libs/libunwind:= ) )
acl? ( virtual/acl )
ceph? ( sys-cluster/ceph )
cluster? ( net-libs/rpcsvc-proto )
@@ -108,6 +107,10 @@ COMMON_DEPEND="
system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl,${MULTILIB_USEDEP}] )
system-mitkrb5? ( >=app-crypt/mit-krb5-1.19[${MULTILIB_USEDEP}] )
systemd? ( sys-apps/systemd:0= )
+ unwind? (
+ llvm-libunwind? ( sys-libs/llvm-libunwind:= )
+ !llvm-libunwind? ( sys-libs/libunwind:= )
+ )
zeroconf? ( net-dns/avahi[dbus] )
"
DEPEND="${COMMON_DEPEND}
@@ -145,6 +148,7 @@ PATCHES=(
"${FILESDIR}/${PN}-4.16.2-fix-musl-without-innetgr.patch"
"${FILESDIR}/ldb-2.5.2-skip-wav-tevent-check.patch"
"${FILESDIR}/${P}-glibc-2.36.patch"
+ "${FILESDIR}/${PN}-4.15.9-libunwind-automagic.patch"
)
#CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
@@ -234,6 +238,7 @@ multilib_src_configure() {
$(multilib_native_use_with systemd)
--systemd-install-services
--with-systemddir="$(systemd_get_systemunitdir)"
+ $(multilib_native_use_with unwind libunwind)
$(multilib_native_use_with winbind)
$(multilib_native_usex python '' '--disable-python')
$(multilib_native_use_enable zeroconf avahi)