From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6DD6515808A for ; Fri, 15 Sep 2023 04:33:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B0D392BC017; Fri, 15 Sep 2023 04:33:39 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 912362BC017 for ; Fri, 15 Sep 2023 04:33:39 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9726E335D17 for ; Fri, 15 Sep 2023 04:33:38 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 47F4B11AD for ; Fri, 15 Sep 2023 04:33:37 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1694752389.8da9ea49f14cfc17a49174d51b608f7484daba19.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/alsa-lib/, media-libs/alsa-lib/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-libs/alsa-lib/alsa-lib-1.2.10-r2.ebuild media-libs/alsa-lib/files/alsa-lib-1.2.10-pcm-fix-segfault-32bit-libs.patch media-libs/alsa-lib/files/alsa-lib-1.2.10-reshuffle-included-files-config-h.patch X-VCS-Directories: media-libs/alsa-lib/ media-libs/alsa-lib/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 8da9ea49f14cfc17a49174d51b608f7484daba19 X-VCS-Branch: master Date: Fri, 15 Sep 2023 04:33:37 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 6a2be437-6dbc-436c-a741-ab757c3e9b66 X-Archives-Hash: 60832e9f105788f5b91727e5f43e495c commit: 8da9ea49f14cfc17a49174d51b608f7484daba19 Author: Sam James gentoo org> AuthorDate: Fri Sep 15 04:13:55 2023 +0000 Commit: Sam James gentoo org> CommitDate: Fri Sep 15 04:33:09 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8da9ea49 media-libs/alsa-lib: fix 32-bit LFS mismatches Signed-off-by: Sam James gentoo.org> media-libs/alsa-lib/alsa-lib-1.2.10-r2.ebuild | 102 ++++++++++++ ...sa-lib-1.2.10-pcm-fix-segfault-32bit-libs.patch | 91 +++++++++++ ...-1.2.10-reshuffle-included-files-config-h.patch | 174 +++++++++++++++++++++ 3 files changed, 367 insertions(+) diff --git a/media-libs/alsa-lib/alsa-lib-1.2.10-r2.ebuild b/media-libs/alsa-lib/alsa-lib-1.2.10-r2.ebuild new file mode 100644 index 000000000000..4b5a3c65e8bb --- /dev/null +++ b/media-libs/alsa-lib/alsa-lib-1.2.10-r2.ebuild @@ -0,0 +1,102 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..11} ) +inherit autotools multilib-minimal flag-o-matic python-single-r1 + +DESCRIPTION="Advanced Linux Sound Architecture Library" +HOMEPAGE="https://alsa-project.org/wiki/Main_Page" +if [[ ${PV} == *_p* ]] ; then + # Please set correct commit ID for a snapshot release! + COMMIT="abe805ed6c7f38e48002e575535afd1f673b9bcd" + SRC_URI="https://git.alsa-project.org/?p=${PN}.git;a=snapshot;h=${COMMIT};sf=tgz -> ${P}.tar.gz" + S="${WORKDIR}"/${PN}-${COMMIT:0:7} +else + # TODO: Upstream does publish .sig files, so someone could implement verify-sig ;) + SRC_URI="https://www.alsa-project.org/files/pub/lib/${P}.tar.bz2" +fi + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux" +IUSE="alisp debug doc python" +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +RDEPEND=" + media-libs/alsa-topology-conf + media-libs/alsa-ucm-conf + python? ( ${PYTHON_DEPS} ) +" +DEPEND="${RDEPEND}" +BDEPEND="doc? ( >=app-doc/doxygen-1.2.6 )" + +PATCHES=( + "${FILESDIR}/${PN}-1.1.6-missing_files.patch" # bug #652422 + "${FILESDIR}/${P}-musl-string.patch" # bug #913573, backport + "${FILESDIR}/${P}-ump-header-detection.patch" # bug #913573, backport + "${FILESDIR}/${P}-pcm-fix-segfault-32bit-libs.patch" # backport + "${FILESDIR}/${P}-reshuffle-included-files-config-h.patch" # backport +) + +pkg_setup() { + use python && python-single-r1_pkg_setup +} + +src_prepare() { + default + + find . -name Makefile.am -exec sed -i -e '/CFLAGS/s:-g -O2::' {} + || die + # bug #545950 + sed -i -e '5s:^$:\nAM_CPPFLAGS = -I$(top_srcdir)/include:' test/lsb/Makefile.am || die + + eautoreconf +} + +multilib_src_configure() { + # Broken upstream. Could in theory work with -flto-partitions=none + # but it's a hack to workaround the real problem and not strictly safe. + # bug #616108, bug #669086, and https://github.com/alsa-project/alsa-lib/issues/6. + # (This bug is closed as of 1.2.9 but there's been no clear actual fix to it. + # Let us know if you can identify one.) + filter-lto + + local myeconfargs=( + --disable-maintainer-mode + --disable-resmgr + --enable-aload + --enable-rawmidi + --enable-seq + --enable-shared + --enable-thread-safety + + $(multilib_native_use_enable python) + $(use_enable alisp) + $(use_with debug) + ) + + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" +} + +multilib_src_compile() { + emake + + if multilib_is_native_abi && use doc; then + emake doc + grep -FZrl "${S}" doc/doxygen/html | \ + xargs -0 sed -i -e "s:${S}::" || die + fi +} + +multilib_src_install() { + multilib_is_native_abi && use doc && local HTML_DOCS=( doc/doxygen/html/. ) + + default +} + +multilib_src_install_all() { + find "${ED}" -type f -name '*.la' -delete || die + + dodoc ChangeLog doc/asoundrc.txt NOTES TODO +} diff --git a/media-libs/alsa-lib/files/alsa-lib-1.2.10-pcm-fix-segfault-32bit-libs.patch b/media-libs/alsa-lib/files/alsa-lib-1.2.10-pcm-fix-segfault-32bit-libs.patch new file mode 100644 index 000000000000..4cd3614ee943 --- /dev/null +++ b/media-libs/alsa-lib/files/alsa-lib-1.2.10-pcm-fix-segfault-32bit-libs.patch @@ -0,0 +1,91 @@ +https://github.com/alsa-project/alsa-lib/commit/0e3dfb9f705ca78be34cd70fd59d67c431e29cc7 + +From 0e3dfb9f705ca78be34cd70fd59d67c431e29cc7 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Sat, 9 Sep 2023 17:42:03 +0200 +Subject: [PATCH] pcm: Fix segfault with 32bit libs + +The recent rearrangement of header inclusion order caused a regression +showing segfaults on 32bit Arm. The primary reason is the +inconsistent compile condition depending on the inclusion of config.h; +while most of other code include pcm_local.h (that implicitly includes +config.h) at first, pcm_direct.c doesn't do it, hence the access with +direct plugins crashes. + +For fixing it, we need to include config.h at the beginning. But, +it's better to include pcm_local.h for all relevant code for +consistency. The patch does it, and also it adds the guard in +pcm_local.h for double inclusions. + +Fixes: ad3a8b8b314e ("reshuffle included files to include config.h as first") +Link: https://github.com/alsa-project/alsa-lib/issues/352 +Signed-off-by: Takashi Iwai +--- a/src/pcm/pcm_direct.c ++++ b/src/pcm/pcm_direct.c +@@ -19,6 +19,7 @@ + * + */ + ++#include "pcm_local.h" + #include + #include + #include +--- a/src/pcm/pcm_dmix.c ++++ b/src/pcm/pcm_dmix.c +@@ -26,7 +26,7 @@ + * + */ + +-#include "config.h" ++#include "pcm_local.h" + #include + #include + #include +--- a/src/pcm/pcm_dshare.c ++++ b/src/pcm/pcm_dshare.c +@@ -26,6 +26,7 @@ + * + */ + ++#include "pcm_local.h" + #include + #include + #include +--- a/src/pcm/pcm_dsnoop.c ++++ b/src/pcm/pcm_dsnoop.c +@@ -26,6 +26,7 @@ + * + */ + ++#include "pcm_local.h" + #include + #include + #include +--- a/src/pcm/pcm_local.h ++++ b/src/pcm/pcm_local.h +@@ -20,6 +20,9 @@ + * + */ + ++#ifndef __PCM_LOCAL_H ++#define __PCM_LOCAL_H ++ + #include "config.h" + + #include +@@ -1223,3 +1226,5 @@ static inline void snd_pcm_unlock(snd_pcm_t *pcm) + #define snd_pcm_lock(pcm) do {} while (0) + #define snd_pcm_unlock(pcm) do {} while (0) + #endif /* THREAD_SAFE_API */ ++ ++#endif /* __PCM_LOCAL_H */ +--- a/src/pcm/pcm_shm.c ++++ b/src/pcm/pcm_shm.c +@@ -26,6 +26,7 @@ + * + */ + ++#include "pcm_local.h" + #include + #include + #include diff --git a/media-libs/alsa-lib/files/alsa-lib-1.2.10-reshuffle-included-files-config-h.patch b/media-libs/alsa-lib/files/alsa-lib-1.2.10-reshuffle-included-files-config-h.patch new file mode 100644 index 000000000000..42493fef6af1 --- /dev/null +++ b/media-libs/alsa-lib/files/alsa-lib-1.2.10-reshuffle-included-files-config-h.patch @@ -0,0 +1,174 @@ +https://github.com/alsa-project/alsa-lib/commit/81a7a93636d9472fcb0c2ff32d9bfdf6ed10763d + +From 81a7a93636d9472fcb0c2ff32d9bfdf6ed10763d Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 13 Sep 2023 12:27:21 +0200 +Subject: [PATCH] reshuffle included files to include config.h as first - v2 + +config.h may contain defines like _FILE_OFFSET_BITS which influence +the system wide include files (off_t types, open -> open64 function +usage etc.). + +Fixes: ad3a8b8b ("reshuffle included files to include config.h as first") +Related: https://github.com/alsa-project/alsa-lib/pull/333 +Signed-off-by: Jaroslav Kysela +--- a/src/control/setup.c ++++ b/src/control/setup.c +@@ -29,13 +29,13 @@ + * + */ + ++#include "local.h" + #include + #include + #include + #include + #include + #include +-#include "local.h" + + #ifndef DOC_HIDDEN + typedef struct { +--- a/src/rawmidi/rawmidi.c ++++ b/src/rawmidi/rawmidi.c +@@ -144,12 +144,12 @@ This example shows open and read/write rawmidi operations. + * Shows open and read/write rawmidi operations. + */ + ++#include "rawmidi_local.h" + #include + #include + #include + #include + #include +-#include "rawmidi_local.h" + + /** + * \brief setup the default parameters +--- a/src/rawmidi/rawmidi_local.h ++++ b/src/rawmidi/rawmidi_local.h +@@ -19,10 +19,10 @@ + * + */ + ++#include "local.h" + #include + #include + #include +-#include "local.h" + + typedef struct { + int (*close)(snd_rawmidi_t *rawmidi); +--- a/src/rawmidi/rawmidi_virt.c ++++ b/src/rawmidi/rawmidi_virt.c +@@ -19,13 +19,11 @@ + * + */ + +-#include +-#include ++#include "rawmidi_local.h" + #include + #include + #include + #include +-#include "rawmidi_local.h" + #include "seq.h" + #include "seq_midi_event.h" + +--- a/src/rawmidi/ump.c ++++ b/src/rawmidi/ump.c +@@ -4,10 +4,6 @@ + * \brief Universal MIDI Protocol (UMP) Interface + */ + +-#include +-#include +-#include +-#include "local.h" + #include "rawmidi_local.h" + #include "ump_local.h" + +--- a/src/seq/seq.c ++++ b/src/seq/seq.c +@@ -777,8 +777,8 @@ void event_filter(snd_seq_t *seq, snd_seq_event_t *ev) + + */ + +-#include + #include "seq_local.h" ++#include + + /**************************************************************************** + * * +--- a/src/seq/seq_hw.c ++++ b/src/seq/seq_hw.c +@@ -20,9 +20,9 @@ + * + */ + ++#include "seq_local.h" + #include + #include +-#include "seq_local.h" + + #ifndef PIC + /* entry for static linking */ +--- a/src/seq/seq_local.h ++++ b/src/seq/seq_local.h +@@ -23,10 +23,10 @@ + #ifndef __SEQ_LOCAL_H + #define __SEQ_LOCAL_H + ++#include "local.h" + #include + #include + #include +-#include "local.h" + + #define SND_SEQ_OBUF_SIZE (16*1024) /* default size */ + #define SND_SEQ_IBUF_SIZE 500 /* in event_size aligned */ +--- a/src/seq/seq_midi_event.c ++++ b/src/seq/seq_midi_event.c +@@ -28,10 +28,10 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + ++#include "local.h" + #if HAVE_MALLOC_H + #include + #endif +-#include "local.h" + + #ifndef DOC_HIDDEN + +--- a/src/seq/seqmid.c ++++ b/src/seq/seqmid.c +@@ -20,14 +20,12 @@ + * + */ + +-#include +-#include ++#include "seq_local.h" + #include + #include + #include + #include + #include +-#include "seq_local.h" + + /** + * \brief queue controls - start/stop/continue +--- a/src/userfile.c ++++ b/src/userfile.c +@@ -18,7 +18,7 @@ + * + */ + +-#include ++#include "config.h" + #include + #include + #include +