tag 957563 + patch
thanks
Attached is the patch mpg321_common.diff that adds -fcommon to CFLAGS (see
http://gcc.gnu.org/gcc-10/porting_to.html), plus adding "export" to make them
take effect, and demoting one error to warning again.
I've also attached the patch mpg321_extern.diff which fixes the actual cause
for the problem (builds fine, but didn't really test the resulting binary).
You might want to forward it to upstream.
Best regards,
Joachim
diff -Nru mpg321-0.3.2/debian/changelog mpg321-0.3.2/debian/changelog
--- mpg321-0.3.2/debian/changelog 2019-03-13 15:59:02.0 +0100
+++ mpg321-0.3.2/debian/changelog 2020-07-23 17:22:42.0 +0200
@@ -1,3 +1,13 @@
+mpg321 (0.3.2-3.1) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Export CFLAGS to make them take effect.
+ * Add -Wno-error=format-security to CFLAGS to disable the default from
+dpkg-buildflags as workaround for some build error.
+ * Add -fcommon to CFLAGS (Closes: #957563).
+
+ -- Joachim Reichel Thu, 23 Jul 2020 17:22:42 +0200
+
mpg321 (0.3.2-3) unstable; urgency=medium
* Fix compilation error
diff -Nru mpg321-0.3.2/debian/rules mpg321-0.3.2/debian/rules
--- mpg321-0.3.2/debian/rules 2012-05-01 08:53:43.0 +0200
+++ mpg321-0.3.2/debian/rules 2020-07-23 17:22:42.0 +0200
@@ -4,7 +4,7 @@
#export DH_VERBOSE=1
-CFLAGS = $(shell dpkg-buildflags --get CFLAGS) -Wall -Wunused
+export CFLAGS = $(shell dpkg-buildflags --get CFLAGS) -Wall -Wunused -Wno-error=format-security -fcommon
MPG321_ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
Description:
TODO: Put a short summary on the line above and replace this paragraph
with a longer explanation of this change. Complete the meta-information
with other relevant fields (see below for details).
---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:
Origin: ,
Bug:
Bug-Debian: https://bugs.debian.org/
Bug-Ubuntu: https://launchpad.net/bugs/
Forwarded:
Reviewed-By:
Last-Update: 2020-07-23
--- mpg321-0.3.2.orig/mpg321.h
+++ mpg321-0.3.2/mpg321.h
@@ -116,7 +116,7 @@ extern char *playlist_file;
extern int quit_now;
extern char remote_input_buf[PATH_MAX + 5];
extern int file_change;
-int loop_remaining;
+extern int loop_remaining;
extern int status;
extern int scrobbler_time;
@@ -233,8 +233,8 @@ RETSIGTYPE handle_sigchld(int sig);
#define FFT_BUFFER_SIZE_LOG 9
#define FFT_BUFFER_SIZE (1 << FFT_BUFFER_SIZE_LOG) /* 512 */
/*Temporary data stores to perform FFT in */
-double real[FFT_BUFFER_SIZE];
-double imag[FFT_BUFFER_SIZE];
+extern double real[FFT_BUFFER_SIZE];
+extern double imag[FFT_BUFFER_SIZE];
typedef struct {
double real[FFT_BUFFER_SIZE];
@@ -258,10 +258,10 @@ fft_state *fft_init(void);
/* Output buffer process */
void frame_buffer_p();
/* Semaphore array */
-int semarray;
+extern int semarray;
/* Input/Output buffer position */
-int mad_decoder_position;
-int output_buffer_position;
+extern int mad_decoder_position;
+extern int output_buffer_position;
/* Output Frame including needed information */
typedef struct {
unsigned char data[4*1152];
@@ -285,10 +285,10 @@ typedef struct {
} decoded_frames;
/* Output frame queue pointer */
-output_frame *Output_Queue;
+extern output_frame *Output_Queue;
/* Shared total decoded frames */
-decoded_frames *Decoded_Frames;
+extern decoded_frames *Decoded_Frames;
#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
/* */
--- mpg321-0.3.2.orig/mpg321.c
+++ mpg321-0.3.2/mpg321.c
@@ -90,6 +90,7 @@ mad_timer_t current_time;
mpg321_options options = { 0, NULL, NULL, 0 , 0, 0};
int status = MPG321_STOPPED;
int file_change = 0;
+int loop_remaining = 0;
int remote_restart = 0;
int muted = 0;
char *id3_get_tag (struct id3_tag const *tag, char const *what, unsigned int maxlen);
@@ -104,6 +105,15 @@ extern http_file_length;
/* ALSA Volume Range */
extern long volume_min,volume_max;
#endif
+
+double real[FFT_BUFFER_SIZE];
+double imag[FFT_BUFFER_SIZE];
+int semarray;
+int mad_decoder_position;
+int output_buffer_position;
+output_frame *Output_Queue;
+decoded_frames *Decoded_Frames;
+
/* Get the next frame in the round buffer */
int getnext_place(int position)
{