Page MenuHomePhabricator

compiling libssh 0.9.2 on Solaris 11
Open, Needs TriagePublic

Description

Compiling libssh 0.9.2 on Solaris 11.3 with GCC 9.2.0 fails with

[ 78%] Linking C executable sshd_direct-tcpip
Undefined first referenced
symbol in file
recv CMakeFiles/sshd_direct-tcpip.dir/sshd_direct-tcpip.c.o (symbol belongs to implicit dependency /lib/amd64/libsocket.so.1)
send CMakeFiles/sshd_direct-tcpip.dir/sshd_direct-tcpip.c.o (symbol belongs to implicit dependency /lib/amd64/libsocket.so.1)
gethostbyname CMakeFiles/sshd_direct-tcpip.dir/sshd_direct-tcpip.c.o (symbol belongs to implicit dependency /lib/amd64/libnsl.so.1)
socket CMakeFiles/sshd_direct-tcpip.dir/sshd_direct-tcpip.c.o (symbol belongs to implicit dependency /lib/amd64/libsocket.so.1)
connect CMakeFiles/sshd_direct-tcpip.dir/sshd_direct-tcpip.c.o (symbol belongs to implicit dependency /lib/amd64/libsocket.so.1)
shutdown CMakeFiles/sshd_direct-tcpip.dir/sshd_direct-tcpip.c.o (symbol belongs to implicit dependency /lib/amd64/libsocket.so.1)

A quick fix is to call cmake with correct LDFLAGS:

$ env LDFLAGS='-lnsl -lsocket' cmake ../libssh-0.9.2

Event Timeline

joernc created this task.Thu, Nov 28, 11:24 AM