Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Software not building #62

Open
freaknils opened this issue Nov 12, 2020 · 8 comments
Open

Software not building #62

freaknils opened this issue Nov 12, 2020 · 8 comments

Comments

@freaknils
Copy link

Hi,

is this software still under development/support?

I have got the following build error:

gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c aprx.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c ttyreader.c
In Datei, eingebunden von /usr/include/bits/libc-header-start.h:33,
                 von /usr/include/stdio.h:27,
                 von aprx.h:13,
                 von ttyreader.c:13:
/usr/include/features.h:187:3: Warnung: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
  187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
      |   ^~~~~~~
ttyreader.c: In Funktion »aprx_cfmakeraw«:
ttyreader.c:706:1: Warnung: Typ von »f« ist auf »int« voreingestellt [-Wimplicit-int]
  706 | aprx_cfmakeraw(t, f)
      | ^~~~~~~~~~~~~~
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c ax25.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c aprsis.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c beacon.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c config.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c netax25.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c erlang.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c aprxpolls.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c telemetry.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c igate.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c cellmalloc.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c historydb.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c keyhash.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c parse_aprs.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c dupecheck.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c kiss.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c interface.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c pbuf.c
In Datei, eingebunden von /usr/include/bits/libc-header-start.h:33,
                 von /usr/include/stdio.h:27,
                 von aprx.h:13,
                 von pbuf.c:13:
/usr/include/features.h:187:3: Warnung: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
  187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
      |   ^~~~~~~
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c digipeater.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c valgrind.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c filter.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c dprsgw.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c crc.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c agwpesocket.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c netresolver.c
gcc -g -O2 -pthread   -DAPRXVERSION="\"2.9.0-28-g13c6e79\"" -DVARRUN="\"/var/run\"" -DVARLOG="\"/var/log/aprx\"" -DCFGFILE="\"/etc/aprx.conf\"" -c timercmp.c
gcc  -o aprx aprx.o ttyreader.o ax25.o aprsis.o beacon.o config.o netax25.o erlang.o aprxpolls.o telemetry.o igate.o cellmalloc.o historydb.o keyhash.o parse_aprs.o dupecheck.o  kiss.o interface.o pbuf.o digipeater.o valgrind.o filter.o dprsgw.o  crc.o  agwpesocket.o netresolver.o timercmp.o  -lutil    -lm -pthread  
/usr/bin/ld: ttyreader.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: ttyreader.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: ax25.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: ax25.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: aprsis.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: aprsis.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: beacon.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: beacon.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: config.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: config.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: netax25.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: netax25.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: erlang.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: erlang.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: aprxpolls.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: aprxpolls.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: telemetry.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: telemetry.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: igate.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: igate.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: historydb.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: historydb.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: parse_aprs.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: parse_aprs.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: dupecheck.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: dupecheck.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: kiss.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: kiss.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: interface.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: interface.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: pbuf.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: pbuf.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: digipeater.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: digipeater.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: filter.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: filter.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: dprsgw.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: dprsgw.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: crc.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: crc.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: agwpesocket.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: agwpesocket.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: netresolver.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: netresolver.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
/usr/bin/ld: timercmp.o:/home/dl1ue/aprx/aprx.h:45: multiple definition of `pthr_attrs'; aprx.o:/home/dl1ue/aprx/aprx.h:45: first defined here
/usr/bin/ld: timercmp.o:/home/dl1ue/aprx/aprx.h:44: multiple definition of `aprsis_thread'; aprx.o:/home/dl1ue/aprx/aprx.h:44: first defined here
collect2: Fehler: ld gab 1 als Ende-Status zurück
make: *** [Makefile:102: aprx] Fehler 1

GCC:

gcc --version
gcc (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.

Is there a possible solution?
Thanks!

@thasti
Copy link

thasti commented Dec 20, 2020

GCC 10 uses -fno_common as a default, which causes problems with improperly declared externs. Try make CFLAGS=-fcommon when building.

Reference: https://gcc.gnu.org/gcc-10/porting_to.html

@IZ7BOJ
Copy link

IZ7BOJ commented Dec 7, 2021

Hi @thasti , I tried to compile on my raspberry Pi3 "bullseye" distro with -fno_common, but I got this result:
/usr/bin/ld: cellmalloc.o: in function cellmalloc': cellmalloc.c:(.text+0x45c): undefined reference to cellhead_to_clientptr'
/usr/bin/ld: cellmalloc.o: in function cellmallocmany': cellmalloc.c:(.text+0x53c): undefined reference to cellhead_to_clientptr'
/usr/bin/ld: cellmalloc.o: in function cellfree': cellmalloc.c:(.text+0x5a0): undefined reference to clientptr_to_cellhead'
/usr/bin/ld: cellmalloc.o: in function cellfreemany': cellmalloc.c:(.text+0x694): undefined reference to clientptr_to_cellhead'
collect2: error: ld returned 1 exit status
make: *** [Makefile:102: aprx] Errore 1

Any other suggestion?
Thanks in advance
Alfredo

@IZ7BOJ
Copy link

IZ7BOJ commented Dec 7, 2021

Hi, I fixed it with 'make CFLAGS="-fcommon -O2" '
I hope this helps
Alfredo IZ7BOJ

@PhirePhly
Copy link
Owner

Yeah, something about the tool chain has changed in the last few years so the build config is badly broken.

I'm planning on jettisoning autoconf and going to a much simpler static Makefile based build system, because I'm not supporting all the optional code blocks for reducing binary size like Igate support anymore and not willing to entertain supporting any platforms which fail autoconf tests for a functional libc.

@thasti
Copy link

thasti commented Dec 7, 2021

I'm not entirely convinced yet autoconf is the issue here (at least in the scope of the build issues reported above): From what I could make sense of back in the day, the new default in GCC 10 only exposed the presence of a number of improperly declared global symbols (see the link I posted above).

To me, these pointed more to deficiencies in the code than in the build system. Back then, I was simply too lazy to fix up all these issues in the code and instead went for -fcommon to retain the accepting behavior present in GCC 9 and earlier. I did not personally encounter any autoconf-related problems, and for portability across the more common OSes and architectures, keeping it might actually be a good idea?

@PhirePhly
Copy link
Owner

The legacy autoconf system is too complicated for me to be willing to try and figure out what the actual underlying issue is on this build failure; I've been tolerating it as well. And I don't see any portability advantages using autoconf since it isn't the 1980s anymore. I would rather just write unconditionally portable code.

@daniel-ayers
Copy link

Confirming that the build fails as above on Fedora 35 and the problem is resolved by using make CFLAGS="-fcommon -O2".

@jmhayes-table
Copy link

I fixed this by adding the keyword "extern" to the global variables aprsis_thread and pthr_attrs in aprx.h ... there's another example of this in netresolver.c once you get further in the build; it seems like a misunderstanding about the difference between defining and declaring variables. I'm not sure I understand why it's a global variable anyway, it doesn't get used in any other C file than aprsis.c so you can probably just remove it from the header file. This is on Ubuntu using gcc 11.4.0 under Ubuntu 22.0.4 ... it appears the compiler has gotten more strict about this kind of thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants