From: Michael Meffie Date: Sat, 5 Nov 2016 16:42:19 +0000 (-0400) Subject: SOLARIS: convert from ancient _depends_on to ELF dependencies X-Git-Tag: openafs-stable-1_8_0pre1~19 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=37db7985fde9e6a5e71ae628d0b7124a27bf31c3 SOLARIS: convert from ancient _depends_on to ELF dependencies The ancient way of declaring module dependencies with _depends_on has been deprecated since SunOS 2.6 (circa 1996). The presence of the old _depends_on symbol triggers a warning message on the console starting with Solaris 12, and the kernel runtime loader (krtld) feature of using the _depends_on symbol to load dependencies may be removed in a future version of Solaris. Convert the kernel module from the ancient _depends_on method to modern ELF dependencies. Remove the old _depends_on symbol and specify the -dy and -N linker options to set the ELF dependencies at link time, as recommended in the Solaris device driver developer guidelines [1]. This commit does not change the declared dependencies, which may be vestiges of ancient afs versions. [1]: http://docs.oracle.com/cd/E19455-01/805-7378/6j6un037u/index.html#loading-16 Change-Id: Ic5abd82108cd59c0796a8d7659ddaffa791dbeee Reviewed-on: https://gerrit.openafs.org/12453 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- diff --git a/src/afs/SOLARIS/osi_vfsops.c b/src/afs/SOLARIS/osi_vfsops.c index 14695d2..86e5f78 100644 --- a/src/afs/SOLARIS/osi_vfsops.c +++ b/src/afs/SOLARIS/osi_vfsops.c @@ -483,14 +483,6 @@ static struct sysent afssysent = { }; #endif /* AFS_SUN511_ENV */ -/* inter-module dependencies */ -char _depends_on[] = -#if AFS_SUN510_ENV - "drv/ip drv/udp strmod/rpcmod fs/ufs"; -#else - "drv/ip drv/udp strmod/rpcmod"; -#endif - /* * Info/Structs to link the afs module into the kernel */ diff --git a/src/libafs/MakefileProto.SOLARIS.in b/src/libafs/MakefileProto.SOLARIS.in index d1ca97f..956136c 100644 --- a/src/libafs/MakefileProto.SOLARIS.in +++ b/src/libafs/MakefileProto.SOLARIS.in @@ -53,6 +53,12 @@ KDEFS_64 = -xarch=amd64 -xmodel=kernel CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG} + +LDFLAGS=-r -dy -N drv/ip -N drv/udp -N strmod/rpcmod + + +LDFLAGS=-r -dy -N drv/ip -N drv/udp -N strmod/rpcmod -N fs/ufs + # Name of directory to hold object files and libraries. KOBJ = MODLOAD32 MODLOAD64 @@ -140,9 +146,9 @@ dest_libafs: $(LIBAFS) $(LIBAFSNONFS) ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS) $(RM) -f $@ - $(LD) -r -o $@ $(AFSAOBJS) ${AFSNFSOBJS} + $(LD) $(LDFLAGS) -o $@ $(AFSAOBJS) ${AFSNFSOBJS} ${LIBAFSNONFS}: $(AFSAOBJS) $(AFSNONFSOBJS) $(RM) -f $@ - $(LD) -r -o $@ $(AFSAOBJS) ${AFSNONFSOBJS} + $(LD) $(LDFLAGS) -o $@ $(AFSAOBJS) ${AFSNONFSOBJS}