Skip to contentSkip to conversation

alsa-utils: fix conflics with pthread.h

PATCH Superseded Vicente Olivert Riera 2 participants 5 messages Dec 7, 2015 – Dec 10, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 alsa-utils: fix conflics with pthread.h

Backport two upstream patches to fix a build failure due to conflicts with pthread.h:

signal.h:27: error: conflicting types for 'sin_generator_init' ./signal.h:27: error: previous declaration of 'sin_generator_init' was here
signal.h:28: error: conflicting types for 'sin_generator_next_sample' ./signal.h:28: error: previous declaration of 'sin_generator_next_sample' was here
....

Upstream patches:

http://git.alsa-project.org/?p=alsa-utils.git;a=commit;h=3bf8e79c3bfee3ca14277aad3d9c406dfc053bbf
http://git.alsa-project.org/?p=alsa-utils.git;a=commit;h=ed0cce1b6061aade0077982cb5d22fa68ddffd2f

Fixes:

http://autobuild.buildroot.net/results/b11/b114ac7a25ac95a059418b07c6cad25714d19b77/

---
 .../0001-bat-Avoid-local-signal.h-file.patch       | 73 ++++++++++++++++++++++
 ...ass-incompatible-function-pointers-to-pth.patch | 61 ++++++++++++++++++
 2 files changed, 134 insertions(+)
 create mode 100644 package/alsa-utils/0001-bat-Avoid-local-signal.h-file.patch
 create mode 100644 package/alsa-utils/0002-bat-Don-t-pass-incompatible-function-pointers-to-pth.patch
package/alsa-utils/0001-bat-Avoid-local-signal.h-file.patch new file +73 -0
new file mode 100644
index 0000000..a5f7431
@@ -0,0 +1,73 @@
+bat: Avoid local signal.h file
+
+Patch backported from upstream:
+
+  http://git.alsa-project.org/?p=alsa-utils.git;a=commit;h=3bf8e79c3bfee3ca14277aad3d9c406dfc053bbf
+
+Signed-off-by: Vicente Olivert Riera <[email protected]>
+
+From 3bf8e79c3bfee3ca14277aad3d9c406dfc053bbf Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <[email protected]>
+Date: Mon, 9 Nov 2015 14:04:11 +0100
+Subject: [PATCH 1/2] bat: Avoid local signal.h file
+
+The local header file named as "signal.h" causes mysterious compile
+error when built with an old glibc.
+ signal.h:27: error: conflicting types for 'sin_generator_init'
+ ./signal.h:27: error: previous declaration of 'sin_generator_init' was here
+ signal.h:28: error: conflicting types for 'sin_generator_next_sample'
+ ./signal.h:28: error: previous declaration of 'sin_generator_next_sample' was here
+ ....
+
+This turned out to be the conflict of signal.h; namely, pthread.h that
+is included before our local signal.h also includes "pthread.h".
+Since our local "signal.h" has a higher priority, it gets loaded
+instead of the expected pthread's one.  Then we load it again, and it
+screws up.
+
+Although it's basically a bug of pthread, it's anyway not good to have
+a header file conflicting with the standard header file.  So, let's
+name it more explicitly as specific to BAT, bat-signal.h, for avoiding
+such a conflict.
+
+Signed-off-by: Takashi Iwai <[email protected]>
+---
+ bat/Makefile.am                | 2 +-
+ bat/alsa.c                     | 2 +-
+ bat/{signal.h => bat-signal.h} | 0
+ 3 files changed, 2 insertions(+), 2 deletions(-)
+ rename bat/{signal.h => bat-signal.h} (100%)
+
+diff --git a/bat/Makefile.am b/bat/Makefile.am
+index 842ae6b..f0dc5ab 100644
+--- a/bat/Makefile.am
++++ b/bat/Makefile.am
+@@ -13,7 +13,7 @@ bat_SOURCES = \
+ 
+ noinst_HEADERS = \
+ 	common.h \
+-	signal.h \
++	bat-signal.h \
+ 	alsa.h \
+ 	convert.h \
+ 	analyze.h
+diff --git a/bat/alsa.c b/bat/alsa.c
+index 582c604..d31a633 100644
+--- a/bat/alsa.c
++++ b/bat/alsa.c
+@@ -27,7 +27,7 @@
+ 
+ #include "common.h"
+ #include "alsa.h"
+-#include "signal.h"
++#include "bat-signal.h"
+ 
+ struct pcm_container {
+ 	snd_pcm_t *handle;
+diff --git a/bat/signal.h b/bat/bat-signal.h
+similarity index 100%
+rename from bat/signal.h
+rename to bat/bat-signal.h
+-- 
+2.4.10
+
package/alsa-utils/0002-bat-Don-t-pass-incompatible-function-pointers-to-pth.patch new file +61 -0

61 lines not on this page · raw message

Signature · 1 line
2.4.10
#1 lore raw

PATCH 1/1 alsa-utils: fix conflics with pthread.h

Quoted 35 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Vicente" == Vicente Olivert Riera <[email protected]> writes:

Backport two upstream patches to fix a build failure due to conflicts with pthread.h:

signal.h:27: error: conflicting types for 'sin_generator_init' ./signal.h:27: error: previous declaration of 'sin_generator_init' was here
signal.h:28: error: conflicting types for 'sin_generator_next_sample' ./signal.h:28: error: previous declaration of 'sin_generator_next_sample' was here
....

Upstream patches:

http://git.alsa-project.org/?p=alsa-utils.git;a=commit;h=3bf8e79c3bfee3ca14277aad3d9c406dfc053bbf
http://git.alsa-project.org/?p=alsa-utils.git;a=commit;h=ed0cce1b6061aade0077982cb5d22fa68ddffd2f

Fixes:

http://autobuild.buildroot.net/results/b11/b114ac7a25ac95a059418b07c6cad25714d19b77/

---
 .../0001-bat-Avoid-local-signal.h-file.patch       | 73 ++++++++++++++++++++++
 ...ass-incompatible-function-pointers-to-pth.patch | 61 ++++++++++++++++++
 2 files changed, 134 insertions(+)
 create mode 100644 package/alsa-utils/0001-bat-Avoid-local-signal.h-file.patch
 create mode 100644 package/alsa-utils/0002-bat-Don-t-pass-incompatible-function-pointers-to-pth.patch
package/alsa-utils/0001-bat-Avoid-local-signal.h-file.patch new file +0 -0
new file mode 100644
index 0000000..a5f7431

package/alsa-utils/0001-bat-Avoid-local-signal.h-file.patch line 70

Quoted 5 lines
package/alsa-utils/0001-bat-Avoid-local-signal.h-file.patch new file +4 -0
 
+diff --git a/bat/signal.h b/bat/bat-signal.h
+similarity index 100%
+rename from bat/signal.h
+rename to bat/bat-signal.h

This is a git patch with renames that is only handled by gnu patch from version 2.7 on (from 2012). I know it is it ugly, but I think we should use a classic "full" patch here (E.G. not generated by git format-patch -M) for compatibility with older distributions.

Care to respin the patch with that fixed?

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH v2 1/1 alsa-utils: fix conflics with pthread.h

Backport two upstream patches to fix a build failure due to conflicts with pthread.h:

signal.h:27: error: conflicting types for 'sin_generator_init' ./signal.h:27: error: previous declaration of 'sin_generator_init' was here
signal.h:28: error: conflicting types for 'sin_generator_next_sample' ./signal.h:28: error: previous declaration of 'sin_generator_next_sample' was here
....

Upstream patches:

http://git.alsa-project.org/?p=alsa-utils.git;a=commit;h=3bf8e79c3bfee3ca14277aad3d9c406dfc053bbf
http://git.alsa-project.org/?p=alsa-utils.git;a=commit;h=ed0cce1b6061aade0077982cb5d22fa68ddffd2f

Fixes:

http://autobuild.buildroot.net/results/b11/b114ac7a25ac95a059418b07c6cad25714d19b77/

---
 .../0001-bat-Avoid-local-signal.h-file.patch       | 143 +++++++++++++++++++++
 ...ass-incompatible-function-pointers-to-pth.patch |  61 +++++++++
 2 files changed, 204 insertions(+)
 create mode 100644 package/alsa-utils/0001-bat-Avoid-local-signal.h-file.patch
 create mode 100644 package/alsa-utils/0002-bat-Don-t-pass-incompatible-function-pointers-to-pth.patch
package/alsa-utils/0001-bat-Avoid-local-signal.h-file.patch new file +143 -0
new file mode 100644
index 0000000..250f77d
@@ -0,0 +1,143 @@
+bat: Avoid local signal.h file
+
+Patch backported from upstream:
+
+  http://git.alsa-project.org/?p=alsa-utils.git;a=commit;h=3bf8e79c3bfee3ca14277aad3d9c406dfc053bbf
+
+Signed-off-by: Vicente Olivert Riera <[email protected]>
+
+From 3bf8e79c3bfee3ca14277aad3d9c406dfc053bbf Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <[email protected]>
+Date: Mon, 9 Nov 2015 14:04:11 +0100
+Subject: [PATCH 1/2] bat: Avoid local signal.h file
+
+The local header file named as "signal.h" causes mysterious compile
+error when built with an old glibc.
+ signal.h:27: error: conflicting types for 'sin_generator_init'
+ ./signal.h:27: error: previous declaration of 'sin_generator_init' was here
+ signal.h:28: error: conflicting types for 'sin_generator_next_sample'
+ ./signal.h:28: error: previous declaration of 'sin_generator_next_sample' was here
+ ....
+
+This turned out to be the conflict of signal.h; namely, pthread.h that
+is included before our local signal.h also includes "pthread.h".
+Since our local "signal.h" has a higher priority, it gets loaded
+instead of the expected pthread's one.  Then we load it again, and it
+screws up.
+
+Although it's basically a bug of pthread, it's anyway not good to have
+a header file conflicting with the standard header file.  So, let's
+name it more explicitly as specific to BAT, bat-signal.h, for avoiding
+such a conflict.
+
+Signed-off-by: Takashi Iwai <[email protected]>
+---
+ bat/Makefile.am  |  2 +-
+ bat/alsa.c       |  2 +-
+ bat/bat-signal.h | 30 ++++++++++++++++++++++++++++++
+ bat/signal.h     | 30 ------------------------------
+ 4 files changed, 32 insertions(+), 32 deletions(-)
+ create mode 100644 bat/bat-signal.h
+ delete mode 100644 bat/signal.h
+
+diff --git a/bat/Makefile.am b/bat/Makefile.am
+index 842ae6b..f0dc5ab 100644
+--- a/bat/Makefile.am
++++ b/bat/Makefile.am
+@@ -13,7 +13,7 @@ bat_SOURCES = \
+ 
+ noinst_HEADERS = \
+ 	common.h \
+-	signal.h \
++	bat-signal.h \
+ 	alsa.h \
+ 	convert.h \
+ 	analyze.h
+diff --git a/bat/alsa.c b/bat/alsa.c
+index 582c604..d31a633 100644
+--- a/bat/alsa.c
++++ b/bat/alsa.c
+@@ -27,7 +27,7 @@
+ 
+ #include "common.h"
+ #include "alsa.h"
+-#include "signal.h"
++#include "bat-signal.h"
+ 
+ struct pcm_container {
+ 	snd_pcm_t *handle;
+diff --git a/bat/bat-signal.h b/bat/bat-signal.h
+new file mode 100644
+index 0000000..a295517
+--- /dev/null
++++ b/bat/bat-signal.h
+@@ -0,0 +1,30 @@
++/*
++ * Copyright (C) 2015 Caleb Crome
++ * Copyright (C) 2013-2015 Intel Corporation
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ */
++
++/*
++ * Here's a generic sine wave generator that will work indefinitely
++ * for any frequency.
++ *
++ * Note:  the state & phasor are stored as doubles (and updated as
++ * doubles) because after a million samples the magnitude drifts a
++ * bit.  If we really need floats, it can be done with periodic
++ * renormalization of the state_real+state_imag magnitudes.
++ */
++
++int sin_generator_init(struct sin_generator *, float, float, float);
++float sin_generator_next_sample(struct sin_generator *);
++void sin_generator_vfill(struct sin_generator *, float *, int);
++int generate_sine_wave(struct bat *, int, void *);
+diff --git a/bat/signal.h b/bat/signal.h
+deleted file mode 100644
+index a295517..0000000
+--- a/bat/signal.h
++++ /dev/null
+@@ -1,30 +0,0 @@
+-/*
+- * Copyright (C) 2015 Caleb Crome
+- * Copyright (C) 2013-2015 Intel Corporation
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU General Public License for more details.
+- *
+- */
+-
+-/*
+- * Here's a generic sine wave generator that will work indefinitely
+- * for any frequency.
+- *
+- * Note:  the state & phasor are stored as doubles (and updated as
+- * doubles) because after a million samples the magnitude drifts a
+- * bit.  If we really need floats, it can be done with periodic
+- * renormalization of the state_real+state_imag magnitudes.
+- */
+-
+-int sin_generator_init(struct sin_generator *, float, float, float);
+-float sin_generator_next_sample(struct sin_generator *);
+-void sin_generator_vfill(struct sin_generator *, float *, int);
+-int generate_sine_wave(struct bat *, int, void *);
+-- 
+2.4.10
+
package/alsa-utils/0002-bat-Don-t-pass-incompatible-function-pointers-to-pth.patch new file +61 -0

61 lines not on this page · raw message

Signature · 1 line
2.4.10
#3 lore raw

PATCH v2 1/1 alsa-utils: fix conflics with pthread.h

package/alsa-utils/0002-bat-Don-t-pass-incompatible-function-pointers-to-pth.patch line 1

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Vicente" == Vicente Olivert Riera <[email protected]> writes:

Backport two upstream patches to fix a build failure due to conflicts with pthread.h:

+++ b/package/alsa-utils/0002-bat-Don-t-pass-incompatible-function-pointers-to-pth.patch

package/alsa-utils/0002-bat-Don-t-pass-incompatible-function-pointers-to-pth.patch new file +1 -0
@@ -0,0 +1,61 @@
+bat: Don't pass incompatible function pointers to

The end of that line somehow got stripped.

Committed with that fixed, thanks.

Signature · 2 lines
Venlig hilsen,
Peter Korsgaard 
#4 lore raw

PATCH 1/1 alsa-utils: fix conflics with pthread.h

In reply to Peter Korsgaard

Hello Peter,

Quoted 11 lines · Peter Korsgaard

package/alsa-utils/0001-bat-Avoid-local-signal.h-file.patch line 70

Quoted 4 lines
package/alsa-utils/0001-bat-Avoid-local-signal.h-file.patch new file +4 -0
+diff --git a/bat/signal.h b/bat/bat-signal.h
+similarity index 100%
+rename from bat/signal.h
+rename to bat/bat-signal.h

This is a git patch with renames that is only handled by gnu patch from version 2.7 on (from 2012). I know it is it ugly, but I think we should use a classic "full" patch here (E.G. not generated by git format-patch -M) for compatibility with older distributions.

Care to respin the patch with that fixed?

Done:

http://patchwork.ozlabs.org/patch/554448/

Regards,

Vincent.