Jiaoche
borad: RK3576
environment: Ubuntu22.04
toolchain: gcc-11
architecture: aarch64
 
Does the OpenPLC runtime v3 not support compilation with GCC-11? Could you take a look at this? Thanks!
 
Compiling OpenPLC Runtime v3 resulted in an error.
# ./ install.sh linux
Generating C files...
POUS.c
POUS.h
LOCATED_VARIABLES.h
VARIABLES.csv
Config0.c
Config0.h
Res0.c
Including Siemens S7 Protocol via snap7
Moving Files...
Compiling for Linux
Generating object files...
Generating glueVars...
varName: __QW1 varType: UINT
varName: __IW1 varType: UINT
Compiling main program...
/usr/bin/ld: /tmp/ccLL8tL2.o: in function `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release()':
dnp3.cpp
(.text._ZNSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE10_M_releaseEv[_ZNSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE10_M_releaseEv]+0x94): undefined reference to `__aarch64_ldadd4_acq_rel'
/usr/bin/ld: dnp3.cpp
(.text._ZNSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE10_M_releaseEv[_ZNSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE10_M_releaseEv]+0x150): undefined reference to `__aarch64_ldadd4_acq_rel'
/usr/bin/ld: /tmp/ccLL8tL2.o: in function `std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_copy()':
dnp3.cpp
(.text._ZNSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE15_M_add_ref_copyEv[_ZNSt16_Sp_counted_baseILN9__gnu_cxx12_Lock_policyE2EE15_M_add_ref_copyEv]+0x84): undefined reference to `__aarch64_ldadd4_acq_rel'
/usr/bin/ld: /usr/local/lib/libasiodnp3.so: undefined reference to `__aarch64_swp4_rel'
/usr/bin/ld: /usr/local/lib/libasiodnp3.so: undefined reference to `__aarch64_swp1_acq_rel'
/usr/bin/ld: /usr/local/lib/libasiodnp3.so: undefined reference to `__aarch64_ldadd8_acq_rel'
/usr/bin/ld: /usr/local/lib/libasiodnp3.so: undefined reference to `__aarch64_swp4_sync'
/usr/bin/ld: /usr/local/lib/libasiodnp3.so: undefined reference to `__aarch64_cas4_acq_rel'
/usr/bin/ld: /usr/local/lib/libasiodnp3.so: undefined reference to `__aarch64_ldset4_relax'
collect2: error: ld returned 1 exit status
Error compiling C files
Compilation finished with errors!
 
 
The error investigation was triggered by this Command 'g++-9 -std=gnu++11 *.cpp *.o -o openplc -I ./lib -pthread -fpermissive `pkg-config --cflags --libs libmodbus` -lsnap7 -lasiodnp3 -lasiopal -lopendnp3 -lopenpal -lrt -w $ETHERCAT_INC' from webserver/scripts/compile_program.sh.
Reply 0 0
thiagoralves
The issue seems to be on the DNP3 library. My recommendation is that you migrate to runtime v4 as the v3 runtime is pretty much stalled right now in terms of updates and features.
Reply 0 0
Jiaoche
The issue seems to be on the DNP3 library. My recommendation is that you migrate to runtime v4 as the v3 runtime is pretty much stalled right now in terms of updates and features.
I compiled v3 using gcc-9 without any errors. Perhaps this is a gcc toolchain issue? There might be some configuration that needs to be set in gcc-11 for successful compilation.
Reply 0 0
Reply