ecki / net-tools

Linux base networking tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

2.10: netstat linking fails becaus missing -lselinux

kloczek opened this issue · comments

[tkloczko@devel-g2v net-tools-2.10]$ grep SEL config.status
bool 'SELinux support' HAVE_SELINUX y

and linking fails on

/usr/bin/gcc -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Wall -fno-strict-aliasing  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -I. -I/home/tkloczko/rpmbuild/BUILD/net-tools-2.10/include -Ilib -c statistics.c
/usr/bin/gcc -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Wall -fno-strict-aliasing  -Wl,-z,relro -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,--build-id=sha1 -Llib -o netstat netstat.o statistics.o -lnet-tools
lib/netrom.c: In function 'NETROM_sprint':
lib/netrom.c:82:1: warning: function may return address of local variable [-Wreturn-local-addr]
   82 | }
      | ^
lib/netrom.c:78:10: note: declared here
   78 |     char buf[64];
      |          ^
/usr/bin/ld: /tmp/cci1FStg.lto.o: in function `prg_cache_load':
/home/tkloczko/rpmbuild/BUILD/net-tools-2.10/netstat.c:476: undefined reference to `getpidcon'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/net-tools-2.10/netstat.c:480: undefined reference to `freecon'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/net-tools-2.10/netstat.c:480: undefined reference to `freecon'
/usr/bin/ld: /home/tkloczko/rpmbuild/BUILD/net-tools-2.10/netstat.c:480: undefined reference to `freecon'
/usr/bin/ld: /tmp/cci1FStg.lto.o: in function `main':
/home/tkloczko/rpmbuild/BUILD/net-tools-2.10/netstat.c:2189: undefined reference to `is_selinux_enabled'

Just in case ..

[tkloczko@devel-g2v net-tools-2.10]$ pkg-config --libs libselinux
-L/usr/lib -lselinux

OK found that I had missing comfig.make.
Closing.