Bug #6793
openUnit tests failed to build on Solaris
Description
Hello,
I am trying to prepare a package for suricata on current Oracle Solaris. Till now I had few issues which I was able to resolve so I have suricata built and running on x86 and on sparv9 platforms. When I get rules updated from emerging threats it just analyses and fills my fast.log with alerts as expected.
I wanted to have unit tests passing on both mentioned platforms as a baseline for pre-integration testing, but 'gmake check' fails to build with following output:
(cd /scratch/userland-gate/components/suricata/build/amd64 ; \
/usr/bin/env \
/usr/gnu/bin/make \
check)
make[1]: Entering directory '/scratch/userland-gate/components/suricata/build/amd64'
Making check in libhtp
...
Making check in rust
gmake[1]: Entering directory '/scratch/userland-gate/components/suricata/build/amd64/rust'
\
CARGO_HOME="/scratch/userland-gate/i386/home/.cargo" \
CARGO_TARGET_DIR="/scratch/userland-gate/components/suricata/build/amd64/rust/target" \
/usr/bin/cargo build --release \
--features " "
Finished release [optimized + debuginfo] target(s) in 0.25s
if test -e ../rust/target/release/suricata.lib; then \
gcp -a ../rust/target/release/suricata.lib \
../rust/target/release/libsuricata_rust.a; \
fi
if test -e ../rust/target/release/libsuricata.a; then \
gcp -a ../rust/target/release/libsuricata.a \
../rust/target/release/libsuricata_rust.a; \
fi
gmake gen/rust-bindings.h
gmake[2]: Entering directory '/scratch/userland-gate/components/suricata/build/amd64/rust'
gmake[2]: 'gen/rust-bindings.h' is up to date.
gmake[2]: Leaving directory '/scratch/userland-gate/components/suricata/build/amd64/rust'
CARGO_HOME="/scratch/userland-gate/i386/home/.cargo" \
CARGO_TARGET_DIR="/scratch/userland-gate/components/suricata/build/amd64/rust/target" \
/usr/bin/cargo test --all --release --features " "
Compiling suricata v7.0.3 (/scratch/userland-gate/components/suricata/build/amd64/rust)
error: linking with `gcc` failed: exit status: 1
|
= note: LC_ALL="C" PATH="/usr/lib/amd64/rustlib/x86_64-pc-solaris/bin:/usr/bin::/home/mrehak/usr/bin/SunOS:/home/mrehak/usr/bin:/home/mrehak/.local/bin:/opt/onbld/bin:/opt/teamware/bin:/usr/sbin" VSLANG="1033" "gcc" "-m64" "/tmp/rustcE81VVf/symbols.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.0.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.10.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.11.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.12.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.13.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.14.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.15.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.2.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.3.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.4.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.5.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.6.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.7.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.8.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.9.rcgu.o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.3o1ovxi1wh2jza4u.rcgu.o" "-Wl,-z,ignore" "-L" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps" "-L" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib" "-Wl,-Bstatic" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libhex-39cf8b5364cf42da.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libbase64-549b3850469b8ea3.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libtest-0088594108d6a425.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libgetopts-64775d4981add77d.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libunicode_width-57f8445e86412ecb.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/librustc_std_workspace_std-6389237b254ee400.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/liblibc-d55eaed147db23a0.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libsha1-6e6822496c10b6e4.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/liblzma_rs-336ec0cf2d9a5de6.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libbendy-90afbad3a5eb78ae.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libfailure-1fc39296d52208a2.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum-d239d672c6934b41.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum_rational-5218853e13af5d36.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum_iter-c310695acf6c2ed5.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum_complex-570b06e258c869ee.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum_bigint-ca80c2fdfeb1c21f.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libsha2-46cb9a82e7842d22.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libhkdf-cdf4edb8eff6268b.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libhmac-c631d811c6e0b468.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libaes_gcm-3ad6afc2b9c38e9e.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libghash-cf5f86bb63d80184.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libpolyval-eb52c47f1bd6f640.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libuniversal_hash-e521422013d7c92a.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libctr-b4af0898c9b23d23.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libaead-c2a75f5d0f04cfbd.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libaes-6b7debe472d468a3.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libcpufeatures-201eea5cdd0bf7d7.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libopaque_debug-02666893334404ac.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libcipher-c9f901a85e7bedb6.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libflate2-396652743ce92cd1.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libminiz_oxide-f3e37dd62fefca7d.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libadler-7b8e764e1faff175.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libcrc32fast-00bbcc1b182a0196.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libbrotli-4676a459bd6641df.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libbrotli_decompressor-dbb35c86bdcf2391.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/liballoc_stdlib-0c992bfaaedc10b4.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/liballoc_no_stdlib-33bc76ac7f4434a0.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libmd5-ddf25a85c01c3802.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libcfg_if-36de6f95beab3be7.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libdigest-182b75b2bebe06fa.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libsubtle-3848acc728152901.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libblock_buffer-96170bbf979ac4f1.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libcrypto_common-ec449dc18acd1f4f.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libgeneric_array-4042697e6768f8d8.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libtypenum-526debf6ab24a6d0.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libsawp_modbus-ed3f7f90ead1b971.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum_enum-fac5f910347b682c.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libsawp-a4029e0879b457d8.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libsawp_flags-4133fdece585dead.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libregex-45fdfac86b97d2b0.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libaho_corasick-304063c7decc5f40.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libregex_syntax-f1eed4ba8a13d2fd.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libuuid-fb25ff75ee77436a.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libntp_parser-d8835790568d53ab.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libsnmp_parser-29361034bbc91ea6.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libipsec_parser-a05d3ab584d300dc.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libx509_parser-9bc76bd90d2ba058.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libdata_encoding-8ee8c8a8e1fb6bda.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/liblazy_static-e5dca1d7e3b0ade7.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/liboid_registry-51a08b888abad762.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libtls_parser-d0b17c95bd4248ba.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libphf-576e600cd83bcf3a.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libphf_shared-2dd331082d8ff1d3.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libsiphasher-4bf82afe3ea9c74e.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libenum_primitive-9ab86f02341ed759.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum_traits-9ab6ed4d795e915c.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnom_derive-18e33adaea22c5f8.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libkerberos_parser-fd144182e07db8a8.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libder_parser-0e374560c2b00542.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libder_parser-98df17ecbb8e1d55.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum_bigint-685828623ccd24f7.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum_integer-5d4561288a6710fb.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libasn1_rs-dd1bde06da0931d8.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libthiserror-05d85fe54ea38da9.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/librusticata_macros-a796b07296697106.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnom-eafe5fbd36dbdff4.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libnum_traits-e3b56d5229f7609c.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libtime-25ab7864cd2e26a0.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libitoa-f4211105b6598274.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libwidestring-6e0f878e96e26547.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libmemchr-6d2005ae5c00832b.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libcrc-1e800284c720093b.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libbyteorder-1b698e50a1244e54.rlib" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/libbitflags-9fa967c817c98f7b.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libstd-c2675ffd3ef69749.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libpanic_unwind-134c5b652bf21c2a.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libobject-a704be805bff979c.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libmemchr-8172626ee379f52b.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libaddr2line-bce76ac9675c4dcf.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libgimli-472c05c711a649b5.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/librustc_demangle-eaa79fd006b0fec6.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libstd_detect-c2dfc4d2d7c6ae2d.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libhashbrown-01a0f48ea205b14a.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libminiz_oxide-ba32891df7cb9d0a.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libadler-5f7c65198b9c943a.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/librustc_std_workspace_alloc-564ff9fc23fcb2d4.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libunwind-655be21158a0e2a8.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libcfg_if-1316e793f61a66fd.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/liblibc-013b442a87660a87.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/liballoc-8bca0a1964c59102.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/librustc_std_workspace_core-c017c49da4dac27d.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libcore-1c06a9a737a16920.rlib" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib/libcompiler_builtins-621aca4cd2d5caed.rlib" "-Wl,-Bdynamic" "-lsendfile" "-llgrp" "-lsocket" "-lposix4" "-lpthread" "-lresolv" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lsendfile" "-llgrp" "-L" "/usr/lib/amd64/rustlib/x86_64-pc-solaris/lib" "-o" "/scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee" "-nodefaultlibs"
= note: Undefinedfirst referenced
symbol in file
HttpRangeAppendData /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.4.rcgu.o
AppLayerProtoDetectPMRegisterPatternCSwPP /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.10.rcgu.o
AppLayerParserSetStreamDepth /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.10.rcgu.o
AppLayerRequestProtocolTLSUpgrade /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.11.rcgu.o
FileFlowFlagsToFlags /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.10.rcgu.o
AppLayerProtoDetectConfProtoDetectionEnabledDefault /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.15.rcgu.o
AppLayerProtoDetectConfProtoDetectionEnabled /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
FlowGetSourcePort /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
SRepCatGetByShortname /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.14.rcgu.o
AppLayerParserConfParserEnabled /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
AppLayerFrameSetLengthById /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
StringToAppProto /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
AppLayerFrameAddEventById /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.3.rcgu.o
HttpRangeContainerOpenFile /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.8.rcgu.o
FlowGetFlags /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
AppLayerParserStateIssetFlag /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
AppLayerProtoDetectPPParseConfPorts /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.10.rcgu.o
FlowGetLastTimeAsParts /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
ConfGetChildValueBool /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.8.rcgu.o
ConfGet /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.8.rcgu.o
HTTP2MimicHttp1Request /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.4.rcgu.o
ConfGetNode /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.8.rcgu.o
AppLayerRegisterParserAlias /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.2.rcgu.o
AppLayerRegisterProtocolDetection /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
AppLayerParserStateSetFlag /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
AppLayerProtoDetectPPRegister /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.10.rcgu.o
AppLayerProtoDetectPMRegisterPatternCS /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.15.rcgu.o
FlowGetDestinationPort /scratch/userland-gate/components/suricata/build/amd64/rust/target/release/deps/suricata-0870267ba3a75dee.suricata.5d75387f-cgu.1.rcgu.o
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
error: could not compile `suricata` (lib test) due to previous error
gmake[1]: *** [Makefile:578: check] Error 101
gmake[1]: Leaving directory '/scratch/userland-gate/components/suricata/build/amd64/rust'
gmake: *** [Makefile:493: check-recursive] Error 1
All these symbols looks like they are contained by rust/target/release/libsuricata_rust.a:
$ nm ./rust/target/release/libsuricata_rust.a | grep HttpRangeAppendData [1013] | 0| 0|NOTY |GLOB |0 |UNDEF |HttpRangeAppendData [2042] | 0| 0|NOTY |GLOB |0 |UNDEF |HttpRangeAppendData
I see that libsuricata_rust.a is copied by a command above and is present on the place, but is not used in the 'gcc' command. If I add ./rust/target/release/libsuricata_rust.a into the command line above and re-run the results is same.
Any advice?
Thank you,
Martin
Files
Updated by Jason Ish almost 2 years ago
I'm going to guess you'll get the same if you cd rust; cargo test? Would isolate the problem just a little bit.
I don't know anything about linking on Solaris, but when the Rust unit tests are run, code in the C library is referenced, but not available. On Linux, Windows, Mac and few others we test like FreeBSD, this is OK as long as any execution path in a test does not depend on these functions. However, on Solaris it appears to be complaining that these references, while unused in test context, don't exist.
I'd first look at the RUST_LDADD flags in configure.ac. I'm pretty sure the Solaris flags haven't not been updated since we added Rust. In fact, as I'm looking at it right now, you could try adding:
RUST_LDADD="-ldl"
as that will have some affect on the linking here.
Updated by Martin Rehak almost 2 years ago
Hi Jason,
thanks for quick answer.
Yes, cd rust; cargo test is enough to replicate the issue.
Regardless what I am putting into RUST_LDADD the result is still same. And I don't think it complains about missing system library, but it rather cannot find rust/target/release/libsuricata_rust.a which contains all undefined symbols. The file is on the place where it has been copied by cp above.
/scratch/userland-gate/components/suricata/build/amd64$ file rust/target/release/libsuricata_rust.a rust/target/release/libsuricata_rust.a: current ar archive, 32-bit symbol table
But it is 32-bit though C code was built using
-m64 to generate 64-bit binaries.$ file ./src/.libs/suricata ./src/.libs/suricata: ELF 64-bit LSB dynamic lib AMD64 Version 1, position-independent executable, dynamically linked, not stripped
Also if I browse through
rust/target subdirs there are huge mix of 32 and 64 bit archives and dynamic libraries. I don't know anything about Rust and Cargo, but I would say asking ld to link 32 and 64 bit libraries together should fail.
What I don't understand at all is where all the compiled rust code ends up. I don't see anything rust related in deliverables, so the only options are that it is not delivered at all or are part of suricata binary. I thought suricata uses some rust code during runtime according to this:
https://suricata.io/2017/08/01/rust-and-suricata/
Do I need rust at all?
Could you throw more light into this, please?
Thank you,
m.
Updated by Jason Ish almost 2 years ago
So by seeing it fail in `cargo test`, you can forget about all the C stuff, this is pure Rust and where you should focus.
`cargo test` does not build any C. What you would be looking for is Rust (or more likely llvm) options that allow code to reference symbols that don't exist when they are not used.
But yes, Rust is required.
Unfortunately, Solaris isn't in our support matrix at all (https://docs.suricata.io/en/latest/support-status.html), and its only in Rust's tier 2 support so its possible that we're trigging something that is broken, or doing something that simply won't work on Solaris.
Updated by Victor Julien almost 2 years ago
- Target version changed from 7.0.3 to TBD
- Affected Versions 7.0.3 added
Updated by Philippe Antoine 5 months ago
- Status changed from New to Feedback
Is this still a problem in 8 ? Cargo test works fine on other platforms, indicating that we do not need HttpRangeAppendData
Updated by Martin Rehak 4 months ago
Philippe Antoine wrote in #note-5:
Is this still a problem in 8 ? Cargo test works fine on other platforms, indicating that we do not need
HttpRangeAppendData
Hi Philippe, sorry for delay. I have just tried suricata-8.0.0, but I have other problem while building nix-0.28 module. It's some termios related issue which seems to be fixed in 0.30. So I plan to postpone the upgrade to suricata-8.0.0 for a while till at least nix-0.30 is required.
Does that make sense, please?
Thank you,
m.
Updated by Philippe Antoine 4 months ago
Hi Philippe, sorry for delay. I have just tried suricata-8.0.0, but I have other problem while building nix-0.28 module. It's some termios related issue which seems to be fixed in 0.30. So I plan to postpone the upgrade to suricata-8.0.0 for a while till at least nix-0.30 is required.
Does that make sense, please?
Sure, maybe I will ping you in one year if there is no news in between.;.
Updated by Martin Rehak 18 days ago ยท Edited
- File porting.tgz porting.tgz added
- Affected Versions 8.0.3 added
- Affected Versions deleted (
7.0.3)
Philippe Antoine wrote in #note-7:
Hi Philippe, sorry for delay. I have just tried suricata-8.0.0, but I have other problem while building nix-0.28 module. It's some termios related issue which seems to be fixed in 0.30. So I plan to postpone the upgrade to suricata-8.0.0 for a while till at least nix-0.30 is required.
Hi Philippe,
I have successfully delivered suricata-8.0.3 to Solaris. I am sorry to say your change did not help the issue above. Let me summarize all my changes to make it work.
Porting changes¶
Please take a look at porting.tgz attached and consider merging. Without all these suricata will fail to build on Solaris. Let me know if you need help understanding them.
Solaris specific libraries and compiler settings¶
This is necessary to make the project build 'all':
--- a/configure.ac
+++ b/configure.ac
@@ -296,7 +296,9 @@
;;
*-*-solaris*)
AC_MSG_WARN([support for Solaris/Illumos/SunOS is experimental])
- LDFLAGS="${LDFLAGS} -lsocket -lnsl"
+ CPPFLAGS="${CPPFLAGS} -D__EXTENSIONS__"
+ LDFLAGS="${LDFLAGS} -lsocket -lnsl -lm"
+ RUST_LDADD="-lc"
;;
*)
AC_MSG_WARN([unsupported OS this may or may not work])
I would also like to ask you to consider merging this to help me maintain patches.
Unit tests¶
'gmake check' explodes with the issue filed originally (at the top).
This will get me further:
$ RUSTFLAGS="-Clink-arg=--verbose -Clink-arg=$(BUILD_DIR)/src/libsuricata_c.a" gmake check
...
Compiling suricata v8.0.2 (/builds/mrehak/suricata/components/suricata/suricata-8.0.2/rust)
error: linking with `gcc` failed: exit status: 1
|
= note: "gcc" "-m64" "/tmp/rustcofEBbh/symbols.o" "<17 object files omitted>" "-Wl,-z,ignore" "-Wl,-Bstatic
" "/builds/mrehak/suricata/components/suricata/build/amd64/rust/target/release/deps/{libhex-339d8b69a9dc3b48.r
lib,libpsl-00f0e2452735c63b.rlib,libpsl_types-00a1a7a89707d9a3.rlib}.rlib" "<sysroot>/lib/amd64/rustlib/x86_64
-pc-solaris/lib/{libtest-*,libgetopts-*,libunicode_width-*,librustc_std_workspace_std-*}.rlib" "/builds/mrehak
/suricata/components/suricata/build/amd64/rust/target/release/deps/{libsuricata_htp.rlib,libbstr-e21ae25abdfa8
b3d.rlib,libregex_automata-ece784606863a0c3.rlib,libsuricata_lua_sys-811f072cb410de2f.rlib,liblzma_rs-76501070
a6523ab8.rlib,libbendy-695c263a86bc18ed.rlib,libfailure-61849248e40ae3af.rlib,libhkdf-6454403bd0ddb565.rlib,li
bhmac-be44fbb508672353.rlib,libaes_gcm-d0b8245ee814b753.rlib,libghash-765798becf0a10ac.rlib,libpolyval-1a8a4ae
7b42092ce.rlib,libuniversal_hash-12e8211726aa0975.rlib,libctr-c8b5671222f6503b.rlib,libaead-faf8d23c7425a567.r
lib,libaes-da8c67f962555558.rlib,libopaque_debug-bd9bdb33e709d99f.rlib,libcipher-c37ff3c45329dd4e.rlib,libbrot
li-e316e5e524950d8e.rlib,libbrotli_decompressor-a4bde3f5610c3a5e.rlib,liballoc_stdlib-f761a4612761da08.rlib,li
balloc_no_stdlib-189f199caad3d7ca.rlib,libtest_case-0c37a8ac15df26ed.rlib,libsawp_pop3-92fd523aceb1c66a.rlib,l
ibflate2-46c76eb219adfa4b.rlib,libminiz_oxide-97525b890c0db2fa.rlib,libadler2-33bef3132fab223a.rlib,liblibz_sy
s-7d01b7bfe3e6ab12.rlib,libcrc32fast-f753e3e0ba61c9b2.rlib,libsawp_modbus-4cad26fc496c516b.rlib,libnum_enum-24
7082b33e11bf31.rlib,libsawp-436c558bc4d0b638.rlib,libsawp_flags-9e1a42fbdeb08a6c.rlib,libregex-8ae72e6d2689302
5.rlib,libaho_corasick-decea8976bb9cab7.rlib,libregex_syntax-4e70637bf5523464.rlib,libuuid-00a7b1cfdeb8de64.rl
ib,liblibc-224cd59a55314691.rlib,libsha2-3dc2c6e4008cff68.rlib,libsha1-a01df422f7b302d8.rlib,libcpufeatures-22
54debf44222bec.rlib,libmd5-d516758f5ed3e1f6.rlib,libcfg_if-03e1a4577388c520.rlib,libdigest-e96d0cc9c40a88db.rl
ib,libsubtle-8894c53467bda10c.rlib,libblock_buffer-12f7f5c4d6036380.rlib,libcrypto_common-2fab9775e06b153d.rli
b,libgeneric_array-b68fd64b5a06355e.rlib,libtypenum-69845261680bb1a9.rlib,libnum-16468499757a4282.rlib,libnum_
rational-69203c3c6ff87a1d.rlib,libnum_iter-037dfb337f01cb69.rlib,libnum_complex-1b413f68dd90ff21.rlib,libnum_b
igint-283e1091546a4bc3.rlib,libbase64-b094e027c12c4c8f.rlib,libsuricata_sys-2201b194df5a623f.rlib,libntp_parse
r-bd8018d565b67980.rlib,libsnmp_parser-5979716b3c206d1b.rlib,libipsec_parser-e0d97bb07a51da18.rlib,libldap_par
ser-ca329fc80852e963.rlib,libasn1_rs-002b3f9a76e40a7f.rlib,libthiserror-99704ecf27897471.rlib,libx509_parser-5
0bd61ca7d66b15a.rlib,libdata_encoding-f11ce02049fcd99b.rlib,liblazy_static-fc44f1426dadfd55.rlib,liboid_regist
ry-0b8a8e5c8b9fddc1.rlib,libtls_parser-6c8b57415afe0341.rlib,libphf-361331d1d772109e.rlib,libphf_shared-b75417
8077e64596.rlib,libsiphasher-58f98ac2ab3d9444.rlib,libenum_primitive-c52b836a42e24a53.rlib,libnum_traits-acb71
1fdc99f383b.rlib,libnom_derive-0cb6cf550db3f909.rlib,libkerberos_parser-5f16f844b13ba3d1.rlib,libder_parser-93
4f6fbb56ac1b89.rlib,libnum_bigint-e0d1257f2e49a3fb.rlib,libnum_integer-001e5a1f24dfca69.rlib,libasn1_rs-86bb4b
66b6bc82ea.rlib,libthiserror-bb2bd65a8c09342a.rlib,librusticata_macros-c148afd87da9b0a8.rlib,libnom-d167161021
884f1f.rlib,libnum_traits-2ccf4b7ac212e1be.rlib,libtime-667133a9b0850fb3.rlib,libitoa-e6fd0c70c7b57ec5.rlib,li
btime_core-2aee215dfad79ff5.rlib,libnum_conv-9083ece088d133ca.rlib,libderanged-d0feb5871ea2b53c.rlib,libpowerf
mt-3308a5fcfb614d31.rlib,libwidestring-4dbe281f4216b86d.rlib,liblru-6e5ba15e30700aff.rlib,libhashbrown-3ebb649
338f4ac23.rlib,libfoldhash-fe92de2e01df6ec8.rlib,libequivalent-bc9881891e7456ae.rlib,liballocator_api2-7220f60
7acddf94f.rlib,libmemchr-68d0ac209788929c.rlib,libcrc-c8786de02d31ccdf.rlib,libbyteorder-4c5e2a1f20ca9435.rlib
,libbitflags-5daf76ee1d05ef3d.rlib}.rlib" "<sysroot>/lib/amd64/rustlib/x86_64-pc-solaris/lib/{libstd-*,libpani
c_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,librustc_demangle-*,libstd_detect-*,libhashbrown-
*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,libcfg_if-*,liblibc-*,liballoc-*,lib
rustc_std_workspace_core-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lz" "-lsendfile" "-llgrp"
"-lsocket" "-lposix4" "-lpthread" "-lresolv" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lsendfile" "-llgrp" "
-L" "/tmp/rustcofEBbh/raw-dylibs" "-L" "/builds/mrehak/suricata/components/suricata/build/amd64/rust/target/re
lease/build/suricata-lua-sys-9281dac473d333b0/out/lua" "-o" "/builds/mrehak/suricata/components/suricata/build
/amd64/rust/target/release/deps/suricata-a3aa53680c08ae30" "-nodefaultlibs" "--verbose" "/builds/mrehak/surica
ta/components/suricata/build/amd64/src/libsuricata_c.a"
...
Undefined first referenced
symbol in file
luaL_checkudata /builds/mrehak/suricata/components/suricata/build/amd64/src/libs
uricata_c.a(util-lua-filelib.o)
yaml_event_delete /builds/mrehak/suricata/components/suricata/build/amd64/src/libs
uricata_c.a(conf-yaml-loader.o)
pcap_set_snaplen /builds/mrehak/suricata/components/suricata/build/amd64/src/libs
uricata_c.a(source-pcap.o)
json_object_clear /builds/mrehak/suricata/components/suricata/build/amd64/src/libs
uricata_c.a(output-json-stats.o)
...
pcre2_substring_get_bynumber_8 /builds/mrehak/suricata/components/suricata/build/amd64/src/libsuricata_c.a(detect-flowint.o)
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.3322
...
And this will make unit tests build:
$ RUSTFLAGS="-Clink-arg=--verbose -Clink-arg=$(BUILD_DIR)/src/libsuricata_c.a -Clink-arg=-lpcap -Clink-arg=-ljansson -Clink-arg=-lpcre2-8 -Clink-arg=-llua -Clink-arg=-lyaml -Clink-arg=-llz4" gmake check
But it will stop here because it will not find RUST's libstd:
...
test x509::time::test::test_format_timestamp ... ok
test result: ok. 524 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s
Running unittests src/lib.rs (/builds/mrehak/suricata/components/suricata/build/amd64/rust/target/release/deps/suricata_derive-2f9760b09dcdd063)
ld.so.1: suricata_derive-2f9760b09dcdd063: fatal: libstd-f771808591eda51c.so: open failed: No such file or directory
error: test failed, to rerun pass `-p suricata-derive --lib`
...
I can help it this way:
$ RUSTFLAGS="-Clink-arg=--verbose -Clink-arg=$(BUILD_DIR)/src/libsuricata_c.a -Clink-arg=-lpcap -Clink-arg=-ljansson -Clink-arg=-lpcre2-8 -Clink-arg=-llua -Clink-arg=-lyaml -Clink-arg=-llz4 -Clink-arg=-Wl,-R$$(rustc --print target-libdir)" gmake check
With this hack I am able to make ALL tests build and pass.
Conclusion¶
I would guess some automake/autoconf variables used for 'cargo test' must be missing on Solaris because suricata, rust code inside and all scripts work well without hacking.
I know some of the issues I have showed doesn't relate to $(SUBJ), but I wanted to give you a context.
Please advice and I will file separate bugs, prepare github commits and/or test whatever changes on Solaris so I can drive this to state when suricata unit tests are production ready on Solaris without hacking.
Thank you very much for your time,
m.
Updated by Victor Julien 18 days ago
@ligi please follow https://docs.suricata.io/en/latest/devguide/contributing/contribution-process.html if you want this to get merged.
Updated by Martin Rehak 13 days ago
- Affected Versions 8.0.2 added
- Affected Versions deleted (
8.0.3)
Hi,
I am continuing in porting changes submission in separate bug.
https://redmine.openinfosecfoundation.org/issues/7005
Please let me know if you have some advice what could I try in respect to unit tests issue.
Thank you,
Martin