SOLARIS: Support 64-bit SPARC userspace builds

Modify OpenAFS to respect user-specified ARCHFLAGS (-m32 or -m64) when
building on Solaris 10 and 11 SPARC platforms.  If ARCHFLAGS is
unset/unspecified, we will continue to build 32-bit userspace by
default.

Implement -m64 SPARC LWP via USE_UCONTEXT; leave the -m32 SPARC LWP
(default) implementation unchanged.

Kernelspace builds remain 64-bit, regardless of ARCHFLAGS value.

Change-Id: Ibb8e145d0cb8dfbe05de896b84c1d1135664b845
Reviewed-on: https://gerrit.openafs.org/14897
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
This commit is contained in:
Mark Vitale 2022-02-09 14:45:56 -05:00 committed by Andrew Deason
parent a06cafd6d6
commit 3db9ecd852
4 changed files with 58 additions and 3 deletions

View File

@ -470,15 +470,38 @@ case $AFS_SYSNAME in
;;
sun4x_5*)
case $AFS_SYSNAME in
sun4x_58|sun4x_59)
XARCHFLAGS=""
;;
*)
if test "x`echo "${ARCHFLAGS}" | grep m32`" != "x" ; then
CURRENTBUILDARCH=sparc
fi
if test "x`echo "${ARCHFLAGS}" | grep m64`" != "x" ; then
CURRENTBUILDARCH=sparcv9
fi
if test "x${CURRENTBUILDARCH}" = "x" ; then
CURRENTBUILDARCH=sparc
fi
if test "${CURRENTBUILDARCH}" = "sparcv9" ; then
XARCHFLAGS="-m64"
fi
;;
esac
LD="/usr/ccs/bin/ld"
MT_CFLAGS='-mt'
PAM_CFLAGS="-KPIC"
PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
SHLIB_CFLAGS="-KPIC"
XCFLAGS64='${XCFLAGS} -m64'
XCFLAGS="-dy -Bdynamic"
XCFLAGS0="-dy -Bdynamic"
XCFLAGS64="${XCFLAGS0} -m64"
XCFLAGS="${XCFLAGS0} ${XARCHFLAGS}"
XLDFLAGS64="-m64"
XLDFLAGS="${XARCHFLAGS}"
XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
SHLIB_LINKER="${CC} -G -dy -Bsymbolic -z text"
SHLIB_LINKER="${CC} ${XARCHFLAGS} -G -dy -Bsymbolic -z text"
LWP_OPTMZ="-g"
;;

View File

@ -92,6 +92,14 @@
#endif
#define ROOTINO UFSROOTINO
/*
* 64-bit SPARC LWP is implemented via USE_UCONTEXT.
* 32-bit SPARC LWP is implemented via process.default.s.
*/
#if defined(_LP64)
# define USE_UCONTEXT
#endif
#endif /* AFS_PARAM_H */
#else /* !defined(UKERNEL) */
@ -154,6 +162,10 @@
#endif
#define ROOTINO UFSROOTINO
#if defined(_LP64)
# define USE_UCONTEXT
#endif
#endif /* AFS_PARAM_H */
#endif /* !defined(UKERNEL) */

View File

@ -95,6 +95,14 @@
#endif
#define ROOTINO UFSROOTINO
/*
* 64-bit SPARC LWP is implemented via USE_UCONTEXT.
* 32-bit SPARC LWP is implemented via process.default.s.
*/
#if defined(_LP64)
# define USE_UCONTEXT
#endif
#endif /* AFS_PARAM_H */
#else /* !defined(UKERNEL) */
@ -160,6 +168,10 @@
#endif
#define ROOTINO UFSROOTINO
#if defined(_LP64)
# define USE_UCONTEXT
#endif
#endif /* AFS_PARAM_H */
#endif /* !defined(UKERNEL) */

View File

@ -63,6 +63,14 @@ process.default.s:
CFLAGS_process.o = @CFLAGS_NODANGLING_POINTER@
process.o : process.default.s process.i386.s process.amd64.s process.c lwp.o
@set -x; case "$(SYS_NAME)" in \
sun4x_510 | sun4x_511 ) \
if [ "${ARCHFLAGS}" = "-m64" ] ; then \
$(AFS_CCRULE_NOQ) -c ${srcdir}/process.c ; \
else \
$(PATH_CPP) -P -I${TOP_INCDIR} ${srcdir}/process.default.s > process.s; \
${AS} process.s -o process.o; \
$(RM) process.s ; \
fi;; \
sun4x_5* | arm_linux* ) \
$(PATH_CPP) -P -I${TOP_INCDIR} ${srcdir}/process.default.s > process.s; \
${AS} process.s -o process.o; \