Hi all, I wanted to package ksniff aka kubectl-sniff (https://github.com/eldadru/ksniff) for openSUSE. It allows sniffing the network traffic inside a Kubernetes pod and forwards it to a local wireshark instance. Very helpful sometimes. Anyways, to work properly it needs a "static tcpdump binary" that it can inject into the pod. I wanted to build it inside the knsiff package. But as soon as I add the "CFLAGS=-static" from the ksniff makefile, the configure breaks as the compiler cannot create executables.
https://build.opensuse.org/package/show/home:ojkastl_buildservice:Branch_dev...
Here is the interesting Makefile part:
"CFLAGS=-static ./configure --without-crypto && make" I added all of the %configure macro options manually and tried to add BuildRequires, but I am stuck. Which package do I have to add to get this working? Thanks in advance! Kind Regards, Johannes
[ 37s] + CFLAGS='-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DGUESS_TSO -static' [ 37s] + export CFLAGS [ 37s] + ./configure --without-crypto [ 37s] checking build system type... x86_64-unknown-linux-gnu [ 37s] checking host system type... x86_64-unknown-linux-gnu [ 37s] checking for gcc... gcc [ 37s] checking whether the C compiler works... no [ 37s] configure: error: in `/home/abuild/rpmbuild/BUILD/ksniff-1.6.2/tcpdump-4.9.2': [ 37s] configure: error: C compiler cannot create executables [ 37s] See `config.log' for more details [ 37s] error: Bad exit status from /var/tmp/rpm-tmp.l57W35 (%build)
The config.log says:
Supported LTO compression algorithms: zlib zstd ... rest of stderr output deleted ... configure:2867: $? = 0 configure:2856: gcc -V >&5 gcc: error: unrecognized command-line option '-V' gcc: fatal error: no input files compilation terminated. configure:2867: $? = 1 configure:2856: gcc -qversion >&5 gcc: error: unrecognized command-line option '-qversion'; did you mean '--version'? gcc: fatal error: no input files compilation terminated. configure:2867: $? = 1 configure:2887: checking whether the C compiler works configure:2909: gcc -static conftest.c >&5 /usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: cannot find -lc: No such file or directory collect2: error: ld returned 1 exit status configure:2913: $? = 1 configure:2951: result: no configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | /* end confdefs.h. */ |
-- Johannes Kastl Linux Consultant & Trainer Tel.: +49 (0) 151 2372 5802 Mail: kastl@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg http://www.b1-systems.de GF: Ralph Dehner Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537