lwp: Link selclient and selserver with XLIBS

Commit e4d8329619 (lwp: Build src/lwp/test) fails to build on Solaris
11.3 or older due to undefined socket and resolver API symbols,
including recv, send, gethostbyname, socket, etc:

  Undefined                       first referenced
   symbol                             in file
  recv                                selsubs.o
  send                                selsubs.o
  gethostbyname                       selclient.o
  socket                              selclient.o
  connect                             selclient.o
  ld: fatal: symbol referencing errors

This is because on Solaris, these have historically been supplied via
-lsocket, -lresolv, and other libraries as defined in the OpenAFS
variable XLIBS.

Add XLIBS to the recipes for selclient and selserver to avoid these
errors when building on Solaris 11.3 or older.

On Solaris 11.4, XLIBS is not required to build because the APIs
formerly found via XLIBS are now largely provided in libc.so instead,
with libsocket.so and libresolv.so maintained for compatibility as
filters on libc.so.

Change-Id: I19a5cca20bd9ac335cd0e6424ed8aeb85d574bc8
Reviewed-on: https://gerrit.openafs.org/16033
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
This commit is contained in:
Mark Vitale 2025-01-07 14:27:50 -05:00 committed by Andrew Deason
parent 3b605e621f
commit 3ce2749b21

View File

@ -21,12 +21,12 @@ test: test.o ${LIBS}
selclient.o: selclient.c seltest.h selclient.o: selclient.c seltest.h
selclient: selclient.o selsubs.o ${LIBS} selclient: selclient.o selsubs.o ${LIBS}
$(AFS_LDRULE) selclient.o selsubs.o ${LIBS} $(AFS_LDRULE) selclient.o selsubs.o ${LIBS} ${XLIBS}
selserver.o: selserver.c seltest.h selserver.o: selserver.c seltest.h
selserver: selserver.o selsubs.o ${LIBS} selserver: selserver.o selsubs.o ${LIBS}
$(AFS_LDRULE) selserver.o selsubs.o ${LIBS} $(AFS_LDRULE) selserver.o selsubs.o ${LIBS} ${XLIBS}
selsubs.o: selsubs.c seltest.h selsubs.o: selsubs.c seltest.h