Closed pomputer closed 2 years ago
GCC 10 changed how global variables work. You can go back to the old behavior around this by adding -fcommon to the Makefile.
Thanks! That fixed it, but now I am getting a different error:
gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c dsd_main.c -o dsd_main.o gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c dsd_symbol.c -o dsd_symbol.o dsd_symbol.c: In function ‘getSymbol’: dsd_symbol.c:26:11: warning: variable ‘result’ set but not used [-Wunused-but-set-variable] 26 | ssize_t result; | ^
~gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c dsd_dibit.c -o dsd_dibit.o dsd_dibit.c: In function ‘skipDibit’: dsd_dibit.c:288:9: warning: variable ‘sample’ set but not used [-Wunused-but-set-variable] 288 | short sample; | ^~gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c dsd_frame_sync.c -o dsd_frame_sync.o gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c dsd_file.c -o dsd_file.o dsd_file.c: In function ‘closeMbeOutFile’: dsd_file.c:176:7: warning: variable ‘result’ set but not used [-Wunused-but-set-variable] 176 | int result; | ^~dsd_file.c:215:27: warning: ‘%s’ directive writing up to 1023 bytes into a region of size 252 [-Wformat-overflow=] 215 | sprintf (shell, "mv %s %s", opts->mbe_out_file, newfilename); | ^~ dsd_file.c:215:7: note: ‘sprintf’ output between 5 and 1091 bytes into a destination of size 255 215 | sprintf (shell, "mv %s %s", opts->mbe_out_file, newfilename); | ^~~~~~~~~~~~~~~~ gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c dsd_audio.c -o dsd_audio.o dsd_audio.c: In function ‘writeSynthesizedVoice’: dsd_audio.c:160:11: warning: variable ‘result’ set but not used [-Wunused-but-set-variable] 160 | ssize_t result; | ^~dsd_audio.c: In function ‘playSynthesizedVoice’: dsd_audio.c:188:11: warning: variable ‘result’ set but not used [-Wunused-but-set-variable] 188 | ssize_t result; | ^~gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c dsd_serial.c -o dsd_serial.o dsd_serial.c: In function ‘resumeScan’: dsd_serial.c:75:11: warning: variable ‘result’ set but not used [-Wunused-but-set-variable] 75 | ssize_t result; | ^~gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c dsd_frame.c -o dsd_frame.o gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c dsd_mbe.c -o dsd_mbe.o dsd_mbe.c: In function ‘playMbeFiles’: dsd_mbe.c:54:15: warning: implicit declaration of function ‘mbe_processAmbe2250Dataf’; did you mean ‘mbe_processAmbe2450Dataf’? [-Wimplicit-function-declaration] 54 | mbe_processAmbe2250Dataf (state->audio_out_temp_buf, &state->errs, &state->errs2, state->err_str, ambe_d, state->cur_mp, state->prev_mp, state->prev_mp_enhanced, opts->uvquality); | ^~~~~~~~ | mbe_processAmbe2450Dataf dsd_mbe.c: In function ‘processMbeFrame’: dsd_mbe.c:104:7: warning: implicit declaration of function ‘mbe_processAmbe3600x2250Framef’; did you mean ‘mbe_processAmbe3600x2450Framef’? [-Wimplicit-function-declaration] 104 | mbe_processAmbe3600x2250Framef (state->audio_out_temp_buf, &state->errs, &state->errs2, state->err_str, ambe_fr, ambe_d, state->cur_mp, state->prev_mp, state->prev_mp_enhanced, opts->uvquality); | ^~~~~~~~~~ | mbe_processAmbe3600x2450Framef gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c dsd_upsample.c -o dsd_upsample.o gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c p25p1_hdu.c -o p25p1_hdu.o p25p1_hdu.c: In function ‘processHDU’: p25p1_hdu.c:25:14: warning: variable ‘count’ set but not used [-Wunused-but-set-variable] 25 | int dibit, count, i, j; | ^~~~~ gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c p25p1_ldu1.c -o p25p1_ldu1.o gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c p25p1_ldu2.c -o p25p1_ldu2.o gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c p25p1_tdulc.c -o p25p1_tdulc.o p25p1_tdulc.c: In function ‘processTDULC’: p25p1_tdulc.c:25:14: warning: variable ‘count’ set but not used [-Wunused-but-set-variable] 25 | int dibit, count; | ^~~~~ gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c p25_lcw.c -o p25_lcw.o p25_lcw.c: In function ‘processP25lcw’: p25_lcw.c:7:8: warning: variable ‘tgid’ set but not used [-Wunused-but-set-variable] 7 | char tgid[17], tmpstr[255]; | ^~~~ gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c x2tdma_voice.c -o x2tdma_voice.o x2tdma_voice.c: In function ‘processX2TDMAvoice’: x2tdma_voice.c:35:8: warning: variable ‘parity’ set but not used [-Wunused-but-set-variable] 35 | char parity; | ^~x2tdma_voice.c:34:8: warning: variable ‘cachdata’ set but not used [-Wunused-but-set-variable] 34 | char cachdata[13]; | ^~~~ gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c x2tdma_data.c -o x2tdma_data.o x2tdma_data.c: In function ‘processX2TDMAdata’: x2tdma_data.c:30:7: warning: variable ‘aiei’ set but not used [-Wunused-but-set-variable] 30 | int aiei; | ^~~~ x2tdma_data.c:29:8: warning: variable ‘cc’ set but not used [-Wunused-but-set-variable] 29 | char cc[4]; | ^~ x2tdma_data.c:28:8: warning: variable ‘cachdata’ set but not used [-Wunused-but-set-variable] 28 | char cachdata[13]; | ^~~~ x2tdma_data.c:27:8: warning: variable ‘syncdata’ set but not used [-Wunused-but-set-variable] 27 | char syncdata[25]; | ^~~~ gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c dstar.c -o dstar.o dstar.c: In function ‘processDSTAR’: dstar.c:36:8: warning: variable ‘dstar’ set but not used [-Wunused-but-set-variable] 36 | char dstar[300]; | ^~~~~ gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c nxdn_voice.c -o nxdn_voice.o gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c nxdn_data.c -o nxdn_data.o nxdn_data.c: In function ‘processNXDNData’: nxdn_data.c:6:10: warning: variable ‘dibit’ set but not used [-Wunused-but-set-variable] 6 | int i, dibit; | ^~~~~ gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c dmr_voice.c -o dmr_voice.o dmr_voice.c: In function ‘processDMRvoice’: dmr_voice.c:33:8: warning: variable ‘cachdata’ set but not used [-Wunused-but-set-variable] 33 | char cachdata[13]; | ^~~~ dmr_voice.c:32:8: warning: variable ‘syncdata’ set but not used [-Wunused-but-set-variable] 32 | char syncdata[25]; | ^~~~ gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c dmr_data.c -o dmr_data.o dmr_data.c: In function ‘processDMRdata’: dmr_data.c:29:8: warning: variable ‘cc’ set but not used [-Wunused-but-set-variable] 29 | char cc[5]; | ^~ dmr_data.c:28:8: warning: variable ‘cachdata’ set but not used [-Wunused-but-set-variable] 28 | char cachdata[13]; | ^~~~ dmr_data.c:27:8: warning: variable ‘syncdata’ set but not used [-Wunused-but-set-variable] 27 | char syncdata[25]; | ^~~~ gcc -fcommon -O2 -Wall -I. -I/usr/local/include -I/usr/include -c provoice.c -o provoice.o gcc -fcommon -O2 -Wall -o dsd dsd_main.o dsd_symbol.o dsd_dibit.o dsd_frame_sync.o dsd_file.o dsd_audio.o dsd_serial.o dsd_frame.o dsd_mbe.o dsd_upsample.o p25p1_hdu.o p25p1_ldu1.o p25p1_ldu2.o p25p1_tdulc.o p25_lcw.o x2tdma_voice.o x2tdma_data.o dstar.o nxdn_voice.o nxdn_data.o dmr_voice.o dmr_data.o provoice.o -L/usr/local/lib -lm -lmbe /usr/bin/ld: dsd_mbe.o: in functionplayMbeFiles': dsd_mbe.c:(.text+0x223): undefined reference to
mbe_processAmbe2250Dataf' /usr/bin/ld: dsd_mbe.o: in functionprocessMbeFrame': dsd_mbe.c:(.text+0x2ef): undefined reference to
mbe_processAmbe3600x2250Framef' collect2: error: ld returned 1 exit status make: *** [Makefile:106: dsd] Error 1
Can someone please explain where to add the -fcommon flag? I have no experience in programming.
Can someone please explain where to add the -fcommon flag? I have no experience in programming.
Instead of that, I would suggest doing this:
include/dsd.h
change int exitflag;
to extern int exitflag;
src/dsd_main.c
add int exitflag = 0;
after #include "pa_devs.h"
make
again
Hi! I am trying to build dsd on ArchLinux, but getting this error: