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.000000000 +0100 +++ mpg321-0.3.2/debian/changelog 2020-07-23 17:22:42.000000000 +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 <reic...@debian.org> 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.000000000 +0200 +++ mpg321-0.3.2/debian/rules 2020-07-23 17:22:42.000000000 +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: <short summary of the patch> 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: <vendor|upstream|other>, <url of original patch> Bug: <url in upstream bugtracker> Bug-Debian: https://bugs.debian.org/<bugnumber> Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber> Forwarded: <no|not-needed|url proving that it has been forwarded> Reviewed-By: <name and email of someone who approved the patch> 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) {