Closed Martinfx closed 2 years ago
Hi, i am porting sniffglue to FreeBSD 13 but have issue with linker. I have default pcap library in /usr/lib/
e/work/target/x86_64-unknown-freebsd/release/deps/sniffglue-af1f7c1d0179cd7a" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-Wl,-O1" "-nodefaultlibs" "-fstack-protector-strong" = note: ld: error: undefined symbol: pcap_create >>> referenced by sniffglue.aa3ce2b3-cgu.12 >>> sniffglue-b7078bb5f15df165.sniffglue.aa3ce2b3-cgu.12.rcgu.o:(sniffglue::sniff::open::h9d191458254eeefa) in archive /wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libsniffglue-b7078bb5f15df165.rlib ld: error: undefined symbol: pcap_set_promisc >>> referenced by sniffglue.aa3ce2b3-cgu.12 >>> sniffglue-b7078bb5f15df165.sniffglue.aa3ce2b3-cgu.12.rcgu.o:(sniffglue::sniff::open::h9d191458254eeefa) in archive /wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libsniffglue-b7078bb5f15df165.rlib ld: error: undefined symbol: pcap_set_immediate_mode >>> referenced by sniffglue.aa3ce2b3-cgu.12 >>> sniffglue-b7078bb5f15df165.sniffglue.aa3ce2b3-cgu.12.rcgu.o:(sniffglue::sniff::open::h9d191458254eeefa) in archive /wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libsniffglue-b7078bb5f15df165.rlib ld: error: undefined symbol: pcap_activate >>> referenced by sniffglue.aa3ce2b3-cgu.12 >>> sniffglue-b7078bb5f15df165.sniffglue.aa3ce2b3-cgu.12.rcgu.o:(sniffglue::sniff::open::h9d191458254eeefa) in archive /wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libsniffglue-b7078bb5f15df165.rlib ld: error: undefined symbol: pcap_geterr >>> referenced by sniffglue.aa3ce2b3-cgu.12 >>> sniffglue-b7078bb5f15df165.sniffglue.aa3ce2b3-cgu.12.rcgu.o:(sniffglue::sniff::open::h9d191458254eeefa) in archive /wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libsniffglue-b7078bb5f15df165.rlib ld: error: undefined symbol: pcap_open_offline >>> referenced by sniffglue.aa3ce2b3-cgu.12 >>> sniffglue-b7078bb5f15df165.sniffglue.aa3ce2b3-cgu.12.rcgu.o:(sniffglue::sniff::open_file::h244c4e71acdc9f7c) in archive /wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libsniffglue-b7078bb5f15df165.rlib ld: error: undefined symbol: pcap_lookupdev >>> referenced by sniffglue.aa3ce2b3-cgu.12 >>> sniffglue-b7078bb5f15df165.sniffglue.aa3ce2b3-cgu.12.rcgu.o:(sniffglue::sniff::default_interface::he23480498e94270a) in archive /wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libsniffglue-b7078bb5f15df165.rlib ld: error: undefined symbol: pcap_datalink >>> referenced by sniffglue.aa3ce2b3-cgu.12 >>> sniffglue-b7078bb5f15df165.sniffglue.aa3ce2b3-cgu.12.rcgu.o:(sniffglue::sniff::Cap::datalink::h72364c637780cf57) in archive /wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libsniffglue-b7078bb5f15df165.rlib ld: error: undefined symbol: pcap_next_ex >>> referenced by sniffglue.aa3ce2b3-cgu.12 >>> sniffglue-b7078bb5f15df165.sniffglue.aa3ce2b3-cgu.12.rcgu.o:(sniffglue::sniff::Cap::next_pkt::h6e00dcf46819bfe4) in archive /wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libsniffglue-b7078bb5f15df165.rlib ld: error: undefined symbol: pcap_close >>> referenced by sniffglue.aa3ce2b3-cgu.12 >>> sniffglue-b7078bb5f15df165.sniffglue.aa3ce2b3-cgu.12.rcgu.o:(_$LT$sniffglue..sniff..Cap$u20$as$u20$core..ops..drop..Drop$GT$::drop::h15d2426d452514e8) in archive /wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libsniffglue-b7078bb5f15df165.rlib cc: error: linker command failed with exit code 1 (use -v to see invocation) error: could not compile `sniffglue` due to previous error Caused by: process didn't exit successfully: `CARGO=/usr/local/bin/cargo CARGO_BIN_NAME=sniffglue CARGO_CRATE_NAME=sniffglue CARGO_MANIFEST_DIR=/wrkdirs/usr/ports/devel/sniffglue/work/sniffglue-0.15.0 CARGO_PKG_AUTHORS='kpcyrd <git@rxv.cc>' CARGO_PKG_DESCRIPTION='Secure multithreaded packet sniffer' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE=GPL-3.0 CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=sniffglue CARGO_PKG_REPOSITORY='https://github.com/kpcyrd/sniffglue' CARGO_PKG_VERSION=0.15.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=15 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 LD_LIBRARY_PATH='/wrkdirs/usr/ports/devel/sniffglue/work/target/release/deps:/usr/local/lib' /usr/local/bin/rustc --crate-name sniffglue --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=2 -C embed-bitcode=no -C metadata=af1f7c1d0179cd7a -C extra-filename=-af1f7c1d0179cd7a --out-dir /wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps --target x86_64-unknown-freebsd -C linker=cc -L dependency=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps -L dependency=/wrkdirs/usr/ports/devel/sniffglue/work/target/release/deps --extern ansi_term=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libansi_term-2d1fb730bc962237.rlib --extern anyhow=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libanyhow-4cb8384e6e918bdd.rlib --extern atty=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libatty-eec43945c18dcfc4.rlib --extern base64=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libbase64-a118e9ad3391b037.rlib --extern bstr=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libbstr-c63d9240a61b6701.rlib --extern dhcp4r=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libdhcp4r-f93138e43de64715.rlib --extern dirs_next=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libdirs_next-9fb7419d96c41698.rlib --extern dns_parser=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libdns_parser-284a6e7f2862bde5.rlib --extern env_logger=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libenv_logger-924f03a86cb37e80.rlib --extern libc=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/liblibc-c0cac1b05d59e26a.rlib --extern log=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/liblog-63b073f5e7a6c5df.rlib --extern nix=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libnix-01c607906606c30a.rlib --extern nom=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libnom-f005dbd79a746dfa.rlib --extern num_cpus=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libnum_cpus-62b7676fa629119e.rlib --extern pcap_sys=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libpcap_sys-4be3fc960b6876c8.rlib --extern pktparse=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libpktparse-9a72259829c6233a.rlib --extern reduce=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libreduce-c73f8f7948c01f5e.rlib --extern serde=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libserde-15d42e0f481883f0.rlib --extern serde_derive=/wrkdirs/usr/ports/devel/sniffglue/work/target/release/deps/libserde_derive-0b490ee432686d8c.so --extern serde_json=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libserde_json-d0579b52f22d43b9.rlib --extern sha2=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libsha2-5876943b4e08c7e6.rlib --extern sniffglue=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libsniffglue-b7078bb5f15df165.rlib --extern structopt=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libstructopt-68a55774ab39285e.rlib --extern tls_parser=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libtls_parser-aa2109240878a5b6.rlib --extern toml=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libtoml-c9b406acce4f7d9f.rlib --extern users=/wrkdirs/usr/ports/devel/sniffglue/work/target/x86_64-unknown-freebsd/release/deps/libusers-08ecf72cc62afd7b.rlib -C link-arg=-fstack-protector-strong -L native=/usr/lib` (exit status: 1) *** Error code 101
I applied patch https://github.com/Martinfx/FreeBSD-Ports/pull/70/commits/c3262d6993ef872dcd4207b7653b0d3965b867f3 and fix broken buiild on FreeBSD.
Hi, i am porting sniffglue to FreeBSD 13 but have issue with linker. I have default pcap library in /usr/lib/