summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-09-15 05:13:55 +0100
committerSam James <sam@gentoo.org>2023-09-15 05:33:09 +0100
commit8da9ea49f14cfc17a49174d51b608f7484daba19 (patch)
tree23de991a041c3ae81ed7f8bda9d504a500b02cfd /media-libs/alsa-lib/files
parentnet-misc/iperf: add 3.15 (diff)
downloadgentoo-8da9ea49f14cfc17a49174d51b608f7484daba19.tar.gz
gentoo-8da9ea49f14cfc17a49174d51b608f7484daba19.tar.bz2
gentoo-8da9ea49f14cfc17a49174d51b608f7484daba19.zip
media-libs/alsa-lib: fix 32-bit LFS mismatches
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-libs/alsa-lib/files')
-rw-r--r--media-libs/alsa-lib/files/alsa-lib-1.2.10-pcm-fix-segfault-32bit-libs.patch91
-rw-r--r--media-libs/alsa-lib/files/alsa-lib-1.2.10-reshuffle-included-files-config-h.patch174
2 files changed, 265 insertions, 0 deletions
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 <tiwai@suse.de>
+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 <tiwai@suse.de>
+--- a/src/pcm/pcm_direct.c
++++ b/src/pcm/pcm_direct.c
+@@ -19,6 +19,7 @@
+ *
+ */
+
++#include "pcm_local.h"
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stddef.h>
+--- a/src/pcm/pcm_dmix.c
++++ b/src/pcm/pcm_dmix.c
+@@ -26,7 +26,7 @@
+ *
+ */
+
+-#include "config.h"
++#include "pcm_local.h"
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stddef.h>
+--- a/src/pcm/pcm_dshare.c
++++ b/src/pcm/pcm_dshare.c
+@@ -26,6 +26,7 @@
+ *
+ */
+
++#include "pcm_local.h"
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stddef.h>
+--- a/src/pcm/pcm_dsnoop.c
++++ b/src/pcm/pcm_dsnoop.c
+@@ -26,6 +26,7 @@
+ *
+ */
+
++#include "pcm_local.h"
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stddef.h>
+--- 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 <stdio.h>
+@@ -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 <stdio.h>
+ #include <stdlib.h>
+ #include <stddef.h>
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 <perex@perex.cz>
+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 <perex@perex.cz>
+--- a/src/control/setup.c
++++ b/src/control/setup.c
+@@ -29,13 +29,13 @@
+ *
+ */
+
++#include "local.h"
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stdarg.h>
+ #include <unistd.h>
+ #include <string.h>
+ #include <ctype.h>
+-#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 <stdio.h>
+ #include <stdlib.h>
+ #include <stdarg.h>
+ #include <unistd.h>
+ #include <string.h>
+-#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 <stdio.h>
+ #include <stdlib.h>
+ #include <limits.h>
+-#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 <stdio.h>
+-#include <stdlib.h>
++#include "rawmidi_local.h"
+ #include <unistd.h>
+ #include <string.h>
+ #include <fcntl.h>
+ #include <sys/ioctl.h>
+-#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 <stdio.h>
+-#include <stdlib.h>
+-#include <limits.h>
+-#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 <poll.h>
+ #include "seq_local.h"
++#include <poll.h>
+
+ /****************************************************************************
+ * *
+--- a/src/seq/seq_hw.c
++++ b/src/seq/seq_hw.c
+@@ -20,9 +20,9 @@
+ *
+ */
+
++#include "seq_local.h"
+ #include <fcntl.h>
+ #include <sys/ioctl.h>
+-#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 <stdio.h>
+ #include <stdlib.h>
+ #include <limits.h>
+-#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 <malloc.h>
+ #endif
+-#include "local.h"
+
+ #ifndef DOC_HIDDEN
+
+--- a/src/seq/seqmid.c
++++ b/src/seq/seqmid.c
+@@ -20,14 +20,12 @@
+ *
+ */
+
+-#include <stdio.h>
+-#include <stdlib.h>
++#include "seq_local.h"
+ #include <unistd.h>
+ #include <string.h>
+ #include <fcntl.h>
+ #include <ctype.h>
+ #include <sys/ioctl.h>
+-#include "seq_local.h"
+
+ /**
+ * \brief queue controls - start/stop/continue
+--- a/src/userfile.c
++++ b/src/userfile.c
+@@ -18,7 +18,7 @@
+ *
+ */
+
+-#include <config.h>
++#include "config.h"
+ #include <string.h>
+ #include <errno.h>
+ #include <assert.h>
+