Compiling failed on aarch64 linux #llinbpq


group@...
 

I'm compiling  LatestLinBPQSource.zip  on Manjaro ARM and encountered with this error:

gcc ARDOP.o Dragon.o IPCode.o FLDigi.o linether.o TNCEmulators.o CMSAuth.o APRSCode.o BPQtoAGW.o KAMPactor.o AEAPactor.o HALDriver.o MULTIPSK.o BBSHTMLConfig.o ChatHTMLConfig.o HTMLCommonCode.o BBSUtilities.o bpqaxip.o BPQINP3.o BPQNRR.o cMain.o Cmd.o CommonCode.o compatbits.o config.o datadefs.o FBBRoutines.o HFCommon.o Housekeeping.o HTTPcode.o kiss.o L2Code.o L3Code.o L4Code.o lzhuf32.o MailCommands.o MailDataDefs.o LinBPQ.o MailRouting.o MailTCP.o MBLRoutines.o md5.o Moncode.o NNTPRoutines.o RigControl.o TelnetV6.o WINMOR.o TNCCode.o UZ7HODrv.o WPRoutines.o SCSTrackeMulti.o SCSPactor.o SCSTracker.o HanksRT.o  UIRoutines.o AGWAPI.o AGWMoncode.o -Xlinker -Map=output.map -lrt -lm -lpthread -lconfig -lpcap -o linbpq
/usr/bin/ld: Dragon.o:/home/marly/LinBPQ/CHeaders.h:358: c `InOctets'; ARDOP.o:/home/marly/LinBPQ/CHeaders.h:358: first defined here
/usr/bin/ld: Dragon.o:/home/marly/LinBPQ/CHeaders.h:359: multiple definition of `OutOctets'; ARDOP.o:/home/marly/LinBPQ/CHeaders.h:359: first defined here
****** omitted ******
/usr/bin/ld: AGWMoncode.o:/home/marly/LinBPQ/CHeaders.h:358: multiple definition of `InOctets'; ARDOP.o:/home/marly/LinBPQ/CHeaders.h:358: first defined here
/usr/bin/ld: AGWMoncode.o:/home/marly/LinBPQ/CHeaders.h:359: multiple definition of `OutOctets'; ARDOP.o:/home/marly/LinBPQ/CHeaders.h:359: first defined here
collect2: error: ld returned 1 exit status
make: *** [makefile:20: linbpq] Error 1
The compiling environment :
$ cat /etc/lsb-release
DISTRIB_ID=Manjaro-ARM
DISTRIB_RELEASE=22.07
DISTRIB_CODENAME=
DISTRIB_DESCRIPTION="Manjaro ARM Linux"

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: /build/gcc/src/gcc/configure --enable-languages=c,c++,fortran,go,lto,objc,obj-c++ --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://github.com/archlinuxarm/PKGBUILDs/issues --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-multilib --disable-werror --host=aarch64-unknown-linux-gnu --build=aarch64-unknown-linux-gnu --with-arch=armv8-a --enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.1.0 (GCC)
I've read somewhere in group that LinBPQ is 32-bit only. Does it possible to compile and run on aarch64 ? 


John G8BPQ
 

This is caused by a change to a default setting in gcc10+. Either use an older gcc or compile with CFLAGS -fcommon.

Only 32 bit LinBPQ is supported, though the 32 bit version runs fine on 64 bit systems so long as they have 32 bit compatibility enabled

The vast majority of features work in 64 bit, but some of the less commonly used drivers have not been tested, and I suspect there is a bug in IPGATEWAY on 64 bit.

73,
John
 

On 24/07/2022 10:00, group@... wrote:
I'm compiling  LatestLinBPQSource.zip  on Manjaro ARM and encountered with this error:

gcc ARDOP.o Dragon.o IPCode.o FLDigi.o linether.o TNCEmulators.o CMSAuth.o APRSCode.o BPQtoAGW.o KAMPactor.o AEAPactor.o HALDriver.o MULTIPSK.o BBSHTMLConfig.o ChatHTMLConfig.o HTMLCommonCode.o BBSUtilities.o bpqaxip.o BPQINP3.o BPQNRR.o cMain.o Cmd.o CommonCode.o compatbits.o config.o datadefs.o FBBRoutines.o HFCommon.o Housekeeping.o HTTPcode.o kiss.o L2Code.o L3Code.o L4Code.o lzhuf32.o MailCommands.o MailDataDefs.o LinBPQ.o MailRouting.o MailTCP.o MBLRoutines.o md5.o Moncode.o NNTPRoutines.o RigControl.o TelnetV6.o WINMOR.o TNCCode.o UZ7HODrv.o WPRoutines.o SCSTrackeMulti.o SCSPactor.o SCSTracker.o HanksRT.o  UIRoutines.o AGWAPI.o AGWMoncode.o -Xlinker -Map=output.map -lrt -lm -lpthread -lconfig -lpcap -o linbpq
/usr/bin/ld: Dragon.o:/home/marly/LinBPQ/CHeaders.h:358: c `InOctets'; ARDOP.o:/home/marly/LinBPQ/CHeaders.h:358: first defined here
/usr/bin/ld: Dragon.o:/home/marly/LinBPQ/CHeaders.h:359: multiple definition of `OutOctets'; ARDOP.o:/home/marly/LinBPQ/CHeaders.h:359: first defined here
****** omitted ******
/usr/bin/ld: AGWMoncode.o:/home/marly/LinBPQ/CHeaders.h:358: multiple definition of `InOctets'; ARDOP.o:/home/marly/LinBPQ/CHeaders.h:358: first defined here
/usr/bin/ld: AGWMoncode.o:/home/marly/LinBPQ/CHeaders.h:359: multiple definition of `OutOctets'; ARDOP.o:/home/marly/LinBPQ/CHeaders.h:359: first defined here
collect2: error: ld returned 1 exit status
make: *** [makefile:20: linbpq] Error 1
The compiling environment :
$ cat /etc/lsb-release
DISTRIB_ID=Manjaro-ARM
DISTRIB_RELEASE=22.07
DISTRIB_CODENAME=
DISTRIB_DESCRIPTION="Manjaro ARM Linux"

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-unknown-linux-gnu/12.1.0/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: /build/gcc/src/gcc/configure --enable-languages=c,c++,fortran,go,lto,objc,obj-c++ --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://github.com/archlinuxarm/PKGBUILDs/issues --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-multilib --disable-werror --host=aarch64-unknown-linux-gnu --build=aarch64-unknown-linux-gnu --with-arch=armv8-a --enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.1.0 (GCC)
I've read somewhere in group that LinBPQ is 32-bit only. Does it possible to compile and run on aarch64 ? 


group@...
 

Thanks for the help, it works now !

BTW, I'm running Manjaro ARM on a $5 cost S905 TV box, which shipped with 1G ram and quad 2GHz soc. Currently I have managed to build and run AX.25 (in kernel), direwolf, Pat, Linfbb and LinBPQ on it , things are getting more and more interesting now :D

73,
BH2VJW


group@...
 

I found myself compiling the wrong code ... The code I pulled from g8bpq / LinBPQ could be successfully compiled with -fcommon option, but run ./linbpq would always complain Segmentation fault:

           PID: 44795 (linbpq)
           UID: 1000 (marly)
           GID: 1000 (marly)
        Signal: 11 (SEGV)
     Timestamp: Mon 2022-07-25 15:12:58 CST (43min ago)
  Command Line: ./linbpq
    Executable: /home/marly/LinBPQ/linbpq
 Control Group: /user.slice/user-1000.slice/session-36.scope
          Unit: session-36.scope
         Slice: user-1000.slice
       Session: 36
     Owner UID: 1000 (marly)
       Boot ID: d5fa61d0a2c14ee29ef9269436fe2c96
    Machine ID: 4ef1f00ff29c47de9dccb0a3ab36f5e7
      Hostname: manjaro-minimal
       Storage: /var/lib/systemd/coredump/core.linbpq.1000.d5fa61d0a2c14ee29ef9269436fe2c96.44795.1658733178000000.zst (presen>
     Disk Size: 82.7K
       Message: Process 44795 (linbpq) of user 1000 dumped core.
                
                Module linux-vdso.so.1 with build-id faa2ed8100a9566346456d83ea907d810d4b1773
                Stack trace of thread 44795:
                #0  0x0000aaaad880ab34 n/a (n/a + 0x0)
                #1  0x0000aaaad880ab7c n/a (n/a + 0x0)
                #2  0x0000aaaad884cabc n/a (n/a + 0x0)
                #3  0x0000ffff8bba7b80 n/a (n/a + 0x0)
                #4  0x0000ffff8bba7c60 n/a (n/a + 0x0)
                #5  0x0000aaaad87990b0 n/a (n/a + 0x0)
                ELF object binary architecture: AARCH64

While the code from LatestLinBPQSource.zip  complains about this error:

/home/marly/bpq/CommonSource/BBSUtilities.c:9797: undefined reference to `config_set_auto_convert'
collect2: error: ld returned 1 exit status
make: *** [makefile:31: linbpq] Error 1

Is there a way to bypass this issue ?

73,
BH2VJW


John G8BPQ
 

It seems config_set_option has replaced config_set_auto_convert in the latest libconfig

Try finding the the block (it should be around line 9794)
 
#ifdef FREEBSD
    config_set_option(&cfg, CONFIG_OPTION_AUTOCONVERT, 1);
#else
    config_set_auto_convert (&cfg, 1);
#endif

are replace with

    config_set_option(&cfg, CONFIG_OPTION_AUTOCONVERT, 1);

73,
John




On 25/07/2022 09:04, group@... wrote:
I found myself compiling the wrong code ... The code I pulled from g8bpq / LinBPQ could be successfully compiled with -fcommon option, but run ./linbpq would always complain Segmentation fault:

           PID: 44795 (linbpq)
           UID: 1000 (marly)
           GID: 1000 (marly)
        Signal: 11 (SEGV)
     Timestamp: Mon 2022-07-25 15:12:58 CST (43min ago)
  Command Line: ./linbpq
    Executable: /home/marly/LinBPQ/linbpq
 Control Group: /user.slice/user-1000.slice/session-36.scope
          Unit: session-36.scope
         Slice: user-1000.slice
       Session: 36
     Owner UID: 1000 (marly)
       Boot ID: d5fa61d0a2c14ee29ef9269436fe2c96
    Machine ID: 4ef1f00ff29c47de9dccb0a3ab36f5e7
      Hostname: manjaro-minimal
       Storage: /var/lib/systemd/coredump/core.linbpq.1000.d5fa61d0a2c14ee29ef9269436fe2c96.44795.1658733178000000.zst (presen>
     Disk Size: 82.7K
       Message: Process 44795 (linbpq) of user 1000 dumped core.
                
                Module linux-vdso.so.1 with build-id faa2ed8100a9566346456d83ea907d810d4b1773
                Stack trace of thread 44795:
                #0  0x0000aaaad880ab34 n/a (n/a + 0x0)
                #1  0x0000aaaad880ab7c n/a (n/a + 0x0)
                #2  0x0000aaaad884cabc n/a (n/a + 0x0)
                #3  0x0000ffff8bba7b80 n/a (n/a + 0x0)
                #4  0x0000ffff8bba7c60 n/a (n/a + 0x0)
                #5  0x0000aaaad87990b0 n/a (n/a + 0x0)
                ELF object binary architecture: AARCH64

While the code from LatestLinBPQSource.zip  complains about this error:

/home/marly/bpq/CommonSource/BBSUtilities.c:9797: undefined reference to `config_set_auto_convert'
collect2: error: ld returned 1 exit status
make: *** [makefile:31: linbpq] Error 1

Is there a way to bypass this issue ?

73,
BH2VJW


group@...
 

Thanks for you help, LinBPQ is up and running now :D

$ ./linbpq
G8BPQ AX25 Packet Switch System Version 6.0.23.1 June 2022
Copyright � 2001-2022 John Wiseman G8BPQ
Current Directory is /home/marly/bpq/CommonSource

Configuration file Preprocessor.
Using Configuration file /home/marly/bpq/CommonSource/bpq32.cfg
Conversion (probably) successful

PORTS 0xaaaae914e7e8 LINKS 0xaaaae914f710 DESTS 0xaaaae9153d10 ROUTES 0xaaaae915c1e0 L4 0xaaaae915dfe0 BUFFERS 0xaaaae9165ff8

Route/Node recovery file BPQNODES.dat not found - Continuing without it
Initialising Port 01     Telnet Server

A brief summary for others compiling LinBPQ on Manjaro ARM:

1. Need 2 changes in makefile:
a) Line 22, change all: CFLAGS = -DLINBPQ -MMD -g to all: CFLAGS = -DLINBPQ -MMD -g -fcommon. Gcc would throw out multiple definition error without -fcommon option.
b) Line 31, change libminiupnpc.a to libminiupnpc.so. In Manjaro, there is /usr/lib/libminiupnpc.so provided by miniupnpc package.
2. Need 1 change in BBSUtilities.c:
Line 9797, change config_set_auto_convert (&cfg, 1); to config_set_option(&cfg, CONFIG_OPTION_AUTOCONVERT, 1); .

73,
BH2VJW