opnsense / ports

OPNsense ports on top of FreeBSD
https://opnsense.org/
Other
157 stars 112 forks source link

Compiling net-mgmt/netdata fails with error 1 on aarch64 #157

Closed JohannesNeu closed 1 year ago

JohannesNeu commented 2 years ago

Hi, while trying to compile OPNsense 22.7 for Raspberry Pi on a Raspberry Pi 4, I encountered an error with gmake compiling net-mgmt/netdata:

===>   netdata-1.36.0 depends on shared library: libJudy.so - found (/usr/local/lib/libJudy.so)
===>   Returning to build of netdata-1.36.0
===>   netdata-1.36.0 depends on shared library: liblz4.so - not found
===>   Installing existing package /.pkg-cache/All/liblz4-1.9.3,1.pkg
Installing liblz4-1.9.3,1...
Extracting liblz4-1.9.3,1: .......... done
===>   netdata-1.36.0 depends on shared library: liblz4.so - found (/usr/local/lib/liblz4.so)
===>   Returning to build of netdata-1.36.0
[20220815073151] ===> Configuring for netdata-1.36.0
configure.ac:39: warning: The macro `AC_PROG_CC_C99' is obsolete.
configure.ac:39: You should run autoupdate.
./lib/autoconf/c.m4:1659: AC_PROG_CC_C99 is expanded from...
configure.ac:39: the top level
configure.ac:322: warning: The macro `ACX_PTHREAD' is obsolete.
configure.ac:322: You should run autoupdate.
build/m4/ax_pthread.m4:92: ACX_PTHREAD is expanded from...
configure.ac:322: the top level
configure.ac:527: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:527: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
configure.ac:527: the top level
configure.ac:1048: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:1048: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
configure.ac:1048: the top level
configure.ac:1370: warning: The macro `AC_LANG_CPLUSPLUS' is obsolete.
configure.ac:1370: You should run autoupdate.
./lib/autoconf/c.m4:262: AC_LANG_CPLUSPLUS is expanded from...
configure.ac:1370: the top level
configure.ac:1376: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:1376: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
configure.ac:1376: the top level
configure: loading site script /usr/ports/Templates/config.site
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... (cached) /bin/mkdir -p
checking for gawk... (cached) /usr/bin/awk
checking whether gmake sets $(MAKE)... yes
checking whether gmake supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking whether gmake supports nested variables... (cached) yes
checking build system type... aarch64-portbld-freebsd13.1
checking host system type... aarch64-portbld-freebsd13.1
checking for gcc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether cc accepts -g... yes
checking for cc option to enable C11 features... none needed
checking whether cc understands -c and -o together... yes
checking whether gmake supports the include directive... yes (GNU style)
checking dependency style of cc... gcc3
checking whether the compiler supports GNU C++... yes
checking whether c++ accepts -g... yes
checking for c++ option to enable C++11 features... none needed
checking dependency style of c++... gcc3
checking pkg-config is at least version 0.9.0... yes
checking for stdio.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking for wchar.h... (cached) yes
checking for minix/config.h... (cached) no
checking for sys/prctl.h... no
checking for sys/vfs.h... no
checking for sys/statfs.h... no
checking for linux/magic.h... no
checking for sys/statvfs.h... (cached) yes
checking for sys/mount.h... (cached) yes
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking for ranlib... ranlib
checking for __attribute__((returns_nonnull))... yes
checking for __attribute__((malloc))... yes
checking for __attribute__((noreturn))... yes
checking for __attribute__((noinline))... yes
checking for __attribute__((format))... yes
checking for __attribute__((warn_unused_result))... yes
checking for struct timespec... (cached) yes
checking for clockid_t... yes
checking for library containing clock_gettime... none required
checking for clock_gettime... (cached) yes
checking for sched_setscheduler... yes
checking for sched_getscheduler... yes
checking for sched_getparam... yes
checking for sched_get_priority_min... yes
checking for sched_get_priority_max... yes
checking for getpriority... yes
checking for setpriority... yes
checking for nice... yes
checking for recvmmsg... yes
checking for int8_t... (cached) yes
checking for int16_t... (cached) yes
checking for int32_t... (cached) yes
checking for int64_t... (cached) yes
checking for uint8_t... (cached) yes
checking for uint16_t... (cached) yes
checking for uint32_t... (cached) yes
checking for uint64_t... (cached) yes
checking for inline... inline
checking for cc options needed to detect all undeclared functions... -fno-builtin
checking whether strerror_r is declared... (cached) yes
checking whether strerror_r returns char *... no
checking for _Generic... yes
checking for sys/mkdev.h... no
checking for sys/sysmacros.h... no
checking for sys/types.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking for arpa/nameser.h... (cached) yes
checking for netdb.h... (cached) yes
checking for resolv.h... (cached) yes
checking for accept4... (cached) yes
checking operating system... Host OS: freebsd
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking how to run the C preprocessor... cpp
checking for grep that handles long lines and -e... (cached) /usr/bin/grep
checking for egrep... (cached) /usr/bin/egrep
checking whether cc is Clang... yes
checking whether pthreads work with "-pthread" and "-lpthread"... yes
checking whether Clang needs flag to prevent "argument unused" warning when linking with -pthread... no
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking whether more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking for pthread_getname_np in -lpthread... yes
checking for sin in -lm... yes
checking if libm should be used... yes
checking for isfinite... no
checking for finite... no
checking for uv_fs_scandir_next in -luv... yes
checking for LZ4_initStream in -llz4... yes
checking for LZ4_compress_default in -llz4... yes
checking for ZLIB... yes
checking if zlib should be used... yes
checking for UUID... yes
checking for SHA256_Init in -lcrypto... yes
checking for X509_VERIFY_PARAM_set1_host in -lcrypto... yes
checking for JSON... yes
checking for json_object_get_type in -ljson-c... yes
checking whether byte ordering is bigendian... no
checking size of void *... 8
Detected 64-bit Build Environment
checking if netdata dbengine should be used... yes
checking if netdata https should be used... yes
checking if netdata compression should be used... yes
checking if json-c should be used... yes
checking for memory allocator... system
checking for mallopt... no
checking for mallinfo... no
checking for LIBCAP... no
checking if libcap should be used... no
checking is bundled protobuf available... no
checking for PROTOBUF... no
checking for protoc... no
checking for c++... /usr/bin/c++
checking if Cloud functionality should be enabled... no
checking if apps.plugin should be enabled... yes
checking for IPMIMONITORING... no
checking if freeipmi.plugin should be enabled... no
checking for httpConnect2 in -lcups... no
checking for cups-config... no
checking if cups.plugin should be enabled... no
checking for linux/netfilter/nfnetlink_conntrack.h... no
checking for NFACCT... no
checking for LIBMNL... no
checking if nfacct.plugin should be enabled... no
checking for YAJL... no
checking for xenstat_init in -lxenstat... no
checking for XENLIGHT... no
checking if xenstat.plugin should be enabled... no
checking for linux/perf_event.h... no
checking if perf.plugin should be enabled... no
checking if gtest and gmock can be found... checking for GTEST... no
checking for GMOCK... no
checking if git submodules are present for machine learning functionality... yes
checking whether C++ compiler accepts -std=c++11... yes
checking if ebpf.plugin should be enabled... no
checking if slabinfo.plugin should be enabled... no
checking for LIBCRYPTO... yes
checking for CRYPTO_new_ex_data in -lcrypto... yes
checking for LIBSSL... yes
checking for SSL_connect in -lssl... yes
checking for LIBCURL... no
checking for AWS_CPP_SDK_CORE... no
checking for AWS_CPP_SDK_KINESIS... no
checking if kinesis exporting connector should be enabled... no
checking for GRPC... no
checking for PUBSUB... no
checking for c++... (cached) /usr/bin/c++
checking if pubsub exporting connector should be enabled... detect
checking for snappy::RawCompress in -lsnappy... no
checking if prometheus remote write exporting connector should be enabled... no
checking for LIBMONGOC... no
checking if mongodb exporting connector should be enabled... no
checking for setns... no
checking if cgroup-network can be enabled... no
checking whether C compiler accepts -flto... yes
checking if -flto builds executables... yes
checking if LTO should be enabled... yes
checking whether we can use -latomic... no
checking for CMOCKA... no
configure: CMocka not found on the system. Unit tests disabled
checking that generated files are newer than configure... done
configure: creating ./config.status
...
c.plugin/zfs_common.o         -lm  -lz  -lcrypto -lssl -L/usr/local/lib -luuid   -luv -llz4  -lcrypto -lssl -ljson-c   libjudy.a       
    -lpthread 
ld: error: undefined symbol: JudyHSFreeArray
>>> referenced by ld-temp.o
>>>               lto.tmp:(dictionary_destroy)
>>> referenced by ld-temp.o
>>>               lto.tmp:(free_page_cache)

ld: error: undefined symbol: JudyHSGet
>>> referenced by ld-temp.o
>>>               lto.tmp:(dictionary_del_unsafe)
>>> referenced by ld-temp.o
>>>               lto.tmp:(dictionary_get)
>>> referenced by ld-temp.o
>>>               lto.tmp:(dictionary_get_and_acquire_item_unsafe)
>>> referenced 10 more times

ld: error: undefined symbol: JudyHSDel
>>> referenced by ld-temp.o
>>>               lto.tmp:(dictionary_del_unsafe)
>>> referenced by ld-temp.o
>>>               lto.tmp:(hashtable_delete_unsafe)

ld: error: undefined symbol: JudyHSIns
>>> referenced by ld-temp.o
>>>               lto.tmp:(dictionary_set_name_value_unsafe)
>>> referenced by ld-temp.o
>>>               lto.tmp:(string_strdupz)
>>> referenced by ld-temp.o
>>>               lto.tmp:(rrdeng_metric_init)
>>> referenced 1 more times

ld: error: undefined symbol: JudyLGet
>>> referenced by ld-temp.o
>>>               lto.tmp:(read_extent_cb)

ld: error: undefined symbol: JudyLFirst
>>> referenced by ld-temp.o
>>>               lto.tmp:(invalidate_oldest_committed)
>>> referenced by ld-temp.o
>>>               lto.tmp:(do_flush_pages)
>>> referenced by ld-temp.o
>>>               lto.tmp:(rrdeng_load_metric_init)
>>> referenced 3 more times

ld: error: undefined symbol: JudyLNext
>>> referenced by ld-temp.o
>>>               lto.tmp:(invalidate_oldest_committed)
>>> referenced by ld-temp.o
>>>               lto.tmp:(do_flush_pages)
>>> referenced by ld-temp.o
>>>               lto.tmp:(rrdeng_load_metric_init)
>>> referenced 1 more times

ld: error: undefined symbol: JudyLDel
>>> referenced by ld-temp.o
>>>               lto.tmp:(invalidate_oldest_committed)
>>> referenced by ld-temp.o
>>>               lto.tmp:(do_flush_pages)
>>> referenced by ld-temp.o
>>>               lto.tmp:(pg_cache_punch_hole)

ld: error: undefined symbol: JudyLIns
>>> referenced by ld-temp.o
>>>               lto.tmp:(rrdeng_store_metric_flush_current_page)
>>> referenced by ld-temp.o
>>>               lto.tmp:(pg_cache_insert)

ld: error: undefined symbol: JudyLLast
>>> referenced by ld-temp.o
>>>               lto.tmp:(rrdeng_load_metric_init)
>>> referenced by ld-temp.o
>>>               lto.tmp:(rrdeng_load_page_next)
>>> referenced by ld-temp.o
>>>               lto.tmp:(pg_cache_punch_hole)

ld: error: undefined symbol: JudyLFreeArray
>>> referenced by ld-temp.o
>>>               lto.tmp:(free_page_cache)
>>> referenced by ld-temp.o
>>>               lto.tmp:(free_page_cache)
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: *** [Makefile:5644: netdata] Error 1
gmake[3]: Leaving directory '/usr/obj/usr/ports/net-mgmt/netdata/work/netdata-v1.36.0'
gmake[2]: *** [Makefile:7340: all-recursive] Error 1
gmake[2]: Leaving directory '/usr/obj/usr/ports/net-mgmt/netdata/work/netdata-v1.36.0'
gmake[1]: *** [Makefile:3802: all] Error 2
gmake[1]: Leaving directory '/usr/obj/usr/ports/net-mgmt/netdata/work/netdata-v1.36.0'
[20220815074317] ===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/net-mgmt/netdata
fichtner commented 2 years ago

was broken for everyone. please try now with latest master

JohannesNeu commented 2 years ago

@fichtner I am compiling an arm image without netdata right now so it might take a little until I can try to test it. But the problem seems to be LTO and the netdata guys seem to have this problem with amd64 as well, at least thats what their new ticket states as build environment: https://github.com/netdata/netdata/issues/13527

fichtner commented 1 year ago

As far as I can see it was worked around for the time being so I'm closing this.

JohannesNeu commented 1 year ago

I checked with "make ports-netdata DEVICE=RPI" and did not get an error, the workaround version 1.36.1 pulled from upstream seems to fix the issue

fichtner commented 1 year ago

Nice, thanks for testing. :)