]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
SOLARIS: convert from ancient _depends_on to ELF dependencies
authorMichael Meffie <mmeffie@sinenomine.net>
Sat, 5 Nov 2016 16:42:19 +0000 (12:42 -0400)
committerStephan Wiesand <stephan.wiesand@desy.de>
Thu, 2 Mar 2017 09:42:19 +0000 (04:42 -0500)
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 <name> 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

Reviewed-on: https://gerrit.openafs.org/12453
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 37db7985fde9e6a5e71ae628d0b7124a27bf31c3)

Change-Id: I1a4ad8bface1ecf774e906b846c2e8263631d77a
Reviewed-on: https://gerrit.openafs.org/12514
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/afs/SOLARIS/osi_vfsops.c
src/libafs/MakefileProto.SOLARIS.in

index 8cc7f6afeea7a0a57e4ae2b84641ba2b0dea294f..dc58feb128bf9c430fc8701e30938de124b8ebc8 100644 (file)
@@ -509,14 +509,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
  */
index 4f4c8ed665ec11d50e648c6a82bb06ef64f03c62..c92308a56fda7435947c1225b5f32efc0b36fc82 100644 (file)
@@ -52,6 +52,12 @@ KDEFS_64 = -xarch=amd64 -xmodel=kernel
 <all>
 CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
 
+<sun4x_58 sunx86_58 sun4x_59 sunx86_59>
+LDFLAGS=-r -dy -N drv/ip -N drv/udp -N strmod/rpcmod
+
+<sun4x_510 sunx86_510 sun4x_511 sunx86_511>
+LDFLAGS=-r -dy -N drv/ip -N drv/udp -N strmod/rpcmod -N fs/ufs
+
 # Name of directory to hold object files and libraries.
 <all -sun4x_57 -sun4x_58 -sun4x_59 -sun4x_510 -sun4x_511 -sunx86_57 -sunx86_58 -sunx86_59 -sunx86_510 -sunx86_511>
 KOBJ = MODLOAD
@@ -160,9 +166,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}