From 76f8d59084f057e3fead722f0b1163399e891ef5 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Wed, 15 Jul 2009 14:57:56 -0400 Subject: [PATCH] MacOS 10.6 support update Make things build on MacOS 10.6 again. Don't break 10.5 build. Fix an error in the MacOS port which was left from previous head. Reviewed-on: http://gerrit.openafs.org/96 Verified-by: Derrick Brashear Reviewed-by: Russ Allbery Reviewed-by: Derrick Brashear (cherry picked from commit 1d1ae6195bd03c4348a57914cf892e06b507d855) Reviewed-on: http://gerrit.openafs.org/355 Tested-by: Derrick Brashear --- acinclude.m4 | 3 + src/afsd/afsd.c | 5 +- src/cf/osconf.m4 | 18 ++++++ src/config/afs_sysnames.h | 4 ++ src/config/param.x86_darwin_100.h | 44 ++++++++++++- src/des/conf-darwin.h | 4 +- src/des/make_p.c | 4 +- src/des/misc.c | 4 +- src/gtx/curseswindows.c | 2 +- src/libafs/MakefileProto.DARWIN.in | 99 ++++++++++++++---------------- src/lwp/Makefile.in | 30 +++++---- src/lwp/process.amd64.s | 4 +- src/pam/afs_auth.c | 4 +- src/pam/afs_password.c | 4 +- src/pam/afs_setcred.c | 4 +- src/ptserver/Makefile.in | 1 - src/usd/usd_file.c | 7 ++- src/util/pthread_glock.c | 2 + 18 files changed, 159 insertions(+), 84 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index e0f51da93..f3a90eafe 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -550,6 +550,9 @@ else i386-apple-darwin9.*) AFS_SYSNAME="x86_darwin_90" ;; + i?86-apple-darwin10.*) + AFS_SYSNAME="x86_darwin_100" + ;; sparc-sun-solaris2.5*) AFS_SYSNAME="sun4x_55" enable_login="yes" diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index d4454f667..b469efc3a 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -162,12 +162,13 @@ void set_staticaddrs(void); #include #endif #include +#ifndef AFS_DARWIN100_ENV /* Symbols from the DiskArbitration framework */ kern_return_t DiskArbStart(mach_port_t *); kern_return_t DiskArbDiskAppearedWithMountpointPing_auto(char *, unsigned int, char *); #define DISK_ARB_NETWORK_DISK_FLAG 8 - +#endif #include #include #include @@ -2564,6 +2565,7 @@ HandleMTab() #endif /* AFS_SUN5_ENV */ #endif /* unreasonable systems */ #ifdef AFS_DARWIN_ENV +#ifndef AFS_DARWIN100_ENV mach_port_t diskarb_port; kern_return_t status; @@ -2576,6 +2578,7 @@ HandleMTab() } return status; +#endif #endif /* AFS_DARWIN_ENV */ return 0; } diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4 index 361c0b5ab..96b81e5fb 100644 --- a/src/cf/osconf.m4 +++ b/src/cf/osconf.m4 @@ -548,6 +548,24 @@ case $AFS_SYSNAME in RANLIB="ranlib -c" ;; + *_darwin_100) + AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration -framework SystemConfiguration -framework IOKit -framework CoreFoundation" + LEX="lex -l" + MT_CFLAGS='-DAFS_PTHREAD_ENV -D_REENTRANT ${XCFLAGS} ${ARCHFLAGS}' + KROOT= + KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers' + LD="cc" + KERN_OPTMZ="-Os" + LWP_OPTMZ="-Os" + OPTMZ="-Os" + REGEX_OBJ="regex.o" + TXLIBS="-lncurses" + EXTRA_VLIBOBJS="fstab.o" + SHLIB_LINKER="${MT_CC} -dynamiclib" + SHLIB_SUFFIX="dylib" + RANLIB="ranlib -c" + ;; + ppc_linux*) KERN_OPTMZ=-O2 LEX="flex -l" diff --git a/src/config/afs_sysnames.h b/src/config/afs_sysnames.h index 5ccbd2897..946892243 100644 --- a/src/config/afs_sysnames.h +++ b/src/config/afs_sysnames.h @@ -62,6 +62,10 @@ #define SYS_NAME_ID_x86_darwin_80 509 #define SYS_NAME_ID_ppc_darwin_90 510 #define SYS_NAME_ID_x86_darwin_90 511 +#define SYS_NAME_ID_ppc_darwin_100 512 +#define SYS_NAME_ID_ppc64_darwin_100 513 +#define SYS_NAME_ID_x86_darwin_100 514 +#define SYS_NAME_ID_amd64_darwin_100 515 #define SYS_NAME_ID_next_mach20 601 #define SYS_NAME_ID_next_mach30 602 diff --git a/src/config/param.x86_darwin_100.h b/src/config/param.x86_darwin_100.h index 49cdd44ba..de9390139 100644 --- a/src/config/param.x86_darwin_100.h +++ b/src/config/param.x86_darwin_100.h @@ -10,7 +10,7 @@ #define AFS_64BIT_IOPS_ENV 1 #if defined(__ppc__) #define AFS_PPC_ENV 1 -#elif defined(__i386__) +#elif defined(__i386__) || defined(__amd64__) #define AFS_X86_ENV 1 #else #error Unsupported architecture @@ -49,7 +49,20 @@ #define SYS_NAME "ppc_darwin_100" #define SYS_NAME_ID SYS_NAME_ID_ppc_darwin_100 #define AFSBIG_ENDIAN 1 -#elif defined(__i386__) +#elif defined(__ppc64__) +#define sys_ppc_darwin_12 1 +#define sys_ppc_darwin_13 1 +#define sys_ppc_darwin_14 1 +#define sys_ppc_darwin_60 1 +#define sys_ppc_darwin_70 1 +#define sys_ppc_darwin_80 1 +#define sys_ppc_darwin_90 1 +#define sys_ppc_darwin_100 1 +#define sys_ppc64_darwin_100 1 +#define SYS_NAME "ppc64_darwin_100" +#define SYS_NAME_ID SYS_NAME_ID_ppc64_darwin_100 +#define AFSBIG_ENDIAN 1 +#elif defined(__i386__) #define sys_x86_darwin_12 1 #define sys_x86_darwin_13 1 #define sys_x86_darwin_14 1 @@ -61,6 +74,19 @@ #define SYS_NAME "x86_darwin_100" #define SYS_NAME_ID SYS_NAME_ID_x86_darwin_100 #define AFSLITTLE_ENDIAN 1 +#elif defined(__amd64__) +#define sys_x86_darwin_12 1 +#define sys_x86_darwin_13 1 +#define sys_x86_darwin_14 1 +#define sys_x86_darwin_60 1 +#define sys_x86_darwin_70 1 +#define sys_x86_darwin_80 1 +#define sys_x86_darwin_90 1 +#define sys_x86_darwin_100 1 +#define sys_amd64_darwin_100 1 +#define SYS_NAME "amd64_darwin_100" +#define SYS_NAME_ID SYS_NAME_ID_amd64_darwin_100 +#define AFSLITTLE_ENDIAN 1 #else #error Unsupported architecture #endif @@ -111,7 +137,7 @@ #define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */ #if defined(__ppc__) #define AFS_PPC_ENV 1 -#elif defined(__i386__) +#elif defined(__i386__) || defined(__amd64__) #define AFS_X86_ENV 1 #else #error Unsupported architecture @@ -158,6 +184,18 @@ #define SYS_NAME "x86_darwin_100" #define SYS_NAME_ID SYS_NAME_ID_x86_darwin_100 #define AFSLITTLE_ENDIAN 1 +#elif defined(__amd64__) +#define sys_x86_darwin_12 1 +#define sys_x86_darwin_13 1 +#define sys_x86_darwin_14 1 +#define sys_x86_darwin_60 1 +#define sys_x86_darwin_70 1 +#define sys_x86_darwin_80 1 +#define sys_x86_darwin_100 1 +#define sys_amd64_darwin_100 1 +#define SYS_NAME "amd64_darwin_100" +#define SYS_NAME_ID SYS_NAME_ID_amd64_darwin_100 +#define AFSLITTLE_ENDIAN 1 #else #error Unsupported architecture #endif diff --git a/src/des/conf-darwin.h b/src/des/conf-darwin.h index 2bf8e1f98..f686e4660 100644 --- a/src/des/conf-darwin.h +++ b/src/des/conf-darwin.h @@ -1,9 +1,9 @@ #define BITS32 #define BIG #undef BSDUNIX -#if defined(__ppc__) +#if defined(__ppc__) || defined(__ppc64__) #define MSBFIRST -#elif defined(__i386__) +#elif defined(__i386__) || defined(__amd64__) #define LSBFIRST #else #error "MSBFIRST or LSBFIRST undefined" diff --git a/src/des/make_p.c b/src/des/make_p.c index c4dd119ef..1e61e483a 100644 --- a/src/des/make_p.c +++ b/src/des/make_p.c @@ -38,12 +38,12 @@ gen(FILE * stream) fprintf(stream, " P_temp_p = (unsigned char *) &P_temp;\n"); #ifdef AFS_DARWIN80_ENV - fprintf(stream, "#if defined(__i386__)\n"); + fprintf(stream, "#if defined(__i386__) || defined(__amd64__)\n"); fprintf(stream, " R2 = P_prime[0][*P_temp_p++];\n"); fprintf(stream, " R2 |= P_prime[1][*P_temp_p++];\n"); fprintf(stream, " R2 |= P_prime[2][*P_temp_p++];\n"); fprintf(stream, " R2 |= P_prime[3][*P_temp_p];\n"); - fprintf(stream, "#elif defined(__ppc__)\n"); + fprintf(stream, "#elif defined(__ppc__) || defined(__ppc64__)\n"); fprintf(stream, " R2 = P_prime[3][*P_temp_p++];\n"); fprintf(stream, " R2 |= P_prime[2][*P_temp_p++];\n"); fprintf(stream, " R2 |= P_prime[1][*P_temp_p++];\n"); diff --git a/src/des/misc.c b/src/des/misc.c index 6a16de3cd..7d0e129c0 100644 --- a/src/des/misc.c +++ b/src/des/misc.c @@ -270,8 +270,8 @@ swap_long_bytes_bit_number(afs_uint32 x) #if !defined(KERNEL) && defined(AFS_DARWIN80_ENV) char *_darwin_whichstr[] = { - "#if defined(__ppc__)\n", - "#elif defined(__i386__)\n", + "#if defined(__ppc__) || defined(__ppc64__)\n", + "#elif defined(__i386__) || defined(__amd64__)\n", "#else\n#error architecture unsupported\n#endif\n" }; int _darwin_which = 1; diff --git a/src/gtx/curseswindows.c b/src/gtx/curseswindows.c index 5ba79a9c0..365477b43 100644 --- a/src/gtx/curseswindows.c +++ b/src/gtx/curseswindows.c @@ -808,7 +808,7 @@ gator_cursesgwin_getdimensions(gwp, aparms) #if defined(AFS_DARWIN_ENV) && !defined(AFS_DARWIN60_ENV) aparms->maxx = cwp->wp->maxx; aparms->maxy = cwp->wp->maxy; -#elif defined(AFS_NBSD_ENV) +#elif defined(AFS_NBSD_ENV) || defined(AFS_DARWIN100_ENV) aparms->maxx = getmaxx(cwp->wp); aparms->maxy = getmaxy(cwp->wp); #else diff --git a/src/libafs/MakefileProto.DARWIN.in b/src/libafs/MakefileProto.DARWIN.in index 4533298c7..12f008f1a 100644 --- a/src/libafs/MakefileProto.DARWIN.in +++ b/src/libafs/MakefileProto.DARWIN.in @@ -33,49 +33,29 @@ AFS_OS_NONFSOBJS = osi_vfsops.o KDEFS= DBUG = DEFINES= -D_KERNEL -DKERNEL -DKERNEL_PRIVATE -DDIAGNOSTIC -DUSE_SELECT -DMACH_USER_API -DMACH_KERNEL +KINCLUDES=-I${KROOT}/System/Library/Frameworks/Kernel.framework/Headers + KOPTS_DBUG=-g - + KOPTS_DBUG=-ggdb - + KOPTS_ppc=-static -nostdinc -nostdlib -fno-builtin -finline -fno-keep-inline-functions -msoft-float -mlong-branch -fsigned-bitfields -arch ppc -Dppc -DPPC -D__PPC__ -DPAGE_SIZE_FIXED -mcpu=750 -mmultiple -fschedule-insns -force_cpusubtype_ALL KOPTS_x86=-static -nostdinc -nostdlib -fno-builtin -finline -fno-keep-inline-functions -msoft-float -mlong-branch -fsigned-bitfields -arch i386 -Di386 -DI386 -D__I386__ -DPAGE_SIZE_FIXED -march=i686 -mpreferred-stack-boundary=2 -falign-functions=4 -ARCH_ppc=$(shell echo "${ARCHFLAGS}" | grep -q -w ppc && echo yes) -ARCH_x86=$(shell echo "${ARCHFLAGS}" | grep -q -w i386 && echo yes) -ifeq ($(ARCH_ppc),yes) -ifeq ($(ARCH_x86),yes) -MODLD=$(CC) -static $(KOPTS_DBUG) -nostdlib -arch ppc -arch i386 +KOPTS_amd64=-static -nostdinc -nostdlib -fno-builtin -finline -fno-keep-inline-functions -msoft-float -mlong-branch -fsigned-bitfields -arch x86_64 -Damd64 -DAMD64 -D__AMD64__ -DPAGE_SIZE_FIXED -march=x86-64 -mpreferred-stack-boundary=4 -falign-functions=4 +ARCH_ppc=$(shell echo "${ARCHFLAGS}" | grep -q -w ppc && echo yes || echo ${ARCHFLAGS} | egrep -q -w -v 'ppc|i386|x86_64' && arch | grep -q -w ppc && echo yes) +ARCH_x86=$(shell echo "${ARCHFLAGS}" | grep -q -w i386 && echo yes || echo ${ARCHFLAGS} | egrep -q -w -v 'ppc|i386|x86_64' && arch | grep -q -w i386 && echo yes) +ARCH_amd64=$(shell echo "${ARCHFLAGS}" | grep -q -w x86_64 && echo yes || echo ${ARCHFLAGS} | egrep -q -w -v 'ppc|i386|x86_64' && arch | grep -q -w x86_64 && echo yes) +OBJ_ppc=$(shell echo "${ARCH_ppc}" | grep -q -w yes && echo "$@.ppc") +OBJ_x86=$(shell echo "${ARCH_x86}" | grep -q -w yes && echo "$@.x86") +OBJ_amd64=$(shell echo "${ARCH_amd64}" | grep -q -w yes && echo "$@.amd64") +MODLD=$(CC) -static $(KOPTS_DBUG) -nostdlib $(ARCHFLAGS) + CFLAGS_ppc=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS_ppc) $(KOPTS_DBUG) CFLAGS_x86=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS_x86) $(KOPTS_DBUG) -else -MODLD=$(CC) -static $(KOPTS_DBUG) -nostdlib -arch ppc -KOPTS=$(KOPTS_ppc) -CFLAGS=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS) -endif -else -ifeq ($(ARCH_x86),yes) -MODLD=$(CC) -static $(KOPTS_DBUG) -nostdlib -arch i386 -KOPTS=$(KOPTS_x86) -else -_ARCH=$(shell arch) -MODLD=$(CC) -static $(KOPTS_DBUG) -nostdlib -arch $(_ARCH) -KOPTS=$(KOPTS_$(shell echo $(_ARCH) | sed 's/i386/x86/')) -endif -CFLAGS=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS) -endif - -MODLD=$(LD) -CFLAGS=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS) - -KOPTS=-static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch - -KOPTS=-no-cpp-precomp -static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch - -KOPTS=-no-precomp -static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch - -KINCLUDES=-I${KROOT}/System/Library/Frameworks/Kernel.framework/Headers - +CFLAGS_amd64=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS_amd64) $(KOPTS_DBUG) + # Name of directory to hold object files and libraries. KOBJ = MODLOAD @@ -86,26 +66,41 @@ DESTDIRS = single_destdir include Makefile.common - -ifeq ($(ARCH_ppc),yes) -ifeq ($(ARCH_x86),yes) + # override suffix rule; unfortunately, this causes a warning message .c.o: - $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(CFLAGS_ppc) $(CFLAGS-$@) -o $(patsubst %.o,%.ppc.o,$@) -c $< - $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(CFLAGS_x86) $(CFLAGS-$@) -o $(patsubst %.o,%.x86.o,$@) -c $< - lipo -create $(patsubst %.o,%.ppc.o,$@) $(patsubst %.o,%.x86.o,$@) -output $@ -CRULE_NOOPT= \ - $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(CFLAGS_ppc) $(CFLAGS-$@) -o $(patsubst %.o,%.ppc.o,$@) -c $? && \ - $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(CFLAGS_x86) $(CFLAGS-$@) -o $(patsubst %.o,%.x86.o,$@) -c $? && \ - lipo -create $(patsubst %.o,%.ppc.o,$@) $(patsubst %.o,%.x86.o,$@) -output $@ -CRULE_OPT= \ - $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(KERN_OPTMZ) $(CFLAGS_ppc) $(CFLAGS-$@) -o $(patsubst %.o,%.ppc.o,$@) -c $? && \ - $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(KERN_OPTMZ) $(CFLAGS_x86) $(CFLAGS-$@) -o $(patsubst %.o,%.x86.o,$@) -c $? && \ - lipo -create $(patsubst %.o,%.ppc.o,$@) $(patsubst %.o,%.x86.o,$@) -output $@ +ifeq ($(ARCH_ppc),yes) + $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(CFLAGS_ppc) $(CFLAGS-$@) -o $(patsubst %.o,%.o.ppc,$@) -c $< endif +ifeq ($(ARCH_x86),yes) + $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(CFLAGS_x86) $(CFLAGS-$@) -o $(patsubst %.o,%.o.x86,$@) -c $< endif - +ifeq ($(ARCH_amd64),yes) + $(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(CFLAGS_amd64) $(CFLAGS-$@) -o $(patsubst %.o,%.o.amd64,$@) -c $< +endif + lipo -create ${OBJ_ppc} ${OBJ_x86} ${OBJ_amd64} -output $@; + +CRULE_NOOPT_ppc=$(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(CFLAGS_ppc) $(CFLAGS-$@) -o $(patsubst %.o,%.o.ppc,$@) -c $? +CRULE_NOOPT_x86=$(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(CFLAGS_x86) $(CFLAGS-$@) -o $(patsubst %.o,%.o.x86,$@) -c $? +CRULE_NOOPT_amd64=$(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(CFLAGS_amd64) $(CFLAGS-$@) -o $(patsubst %.o,%.o.amd64,$@) -c $? +CRULE_NOOPT=$(shell echo "${ARCH_ppc}" | grep -q -w yes && echo "${CRULE_NOOPT_ppc};"; echo "${ARCH_x86}" | grep -q -w yes && echo "${CRULE_NOOPT_x86};"; echo "${ARCH_amd64}" | grep -q -w x86_64 && echo "${CRULE_NOOPT_amd64};"; echo "lipo -create ${OBJ_ppc} ${OBJ_x86} ${OBJ_amd64}-output $@") + +CRULE_OPT_ppc=$(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(KERN_OPTMZ) $(CFLAGS_ppc) $(CFLAGS-$@) -o $(patsubst %.o,%.o.ppc,$@) -c $? +CRULE_OPT_x86=$(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(KERN_OPTMZ) $(CFLAGS_x86) $(CFLAGS-$@) -o $(patsubst %.o,%.o.x86,$@) -c $? +CRULE_OPT_amd64=$(CC) $(COMMON_INCLUDE) $(KERN_DBG) $(KERN_OPTMZ) $(CFLAGS_amd64) $(CFLAGS-$@) -o $(patsubst %.o,%.o.amd64,$@) -c $? +CRULE_OPT=$(shell echo "${ARCH_ppc}" | grep -q -w yes && echo "${CRULE_OPT_ppc};"; echo "${ARCH_x86}" | grep -q -w yes && echo "${CRULE_OPT_x86};"; echo "${ARCH_amd64}" | grep -q -w x86_64 && echo "${CRULE_OPT_amd64};"; echo "lipo -create ${OBJ_ppc} ${OBJ_x86} ${OBJ_amd64}-output $@") + +MODLD=$(LD) +CFLAGS=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS) + +KOPTS=-static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch + +KOPTS=-no-cpp-precomp -static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch + +KOPTS=-no-precomp -static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch + + setup: -mkdir $(KOBJ) -$(RM) $(KOBJ)/Makefile $(KOBJ)/Makefile.common $(KOBJ)/config @@ -145,12 +140,12 @@ dest_libafs: $(LIBAFSNONFS) ; ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS) $(MODLD) -r -o ${LIBAFS} ${AFSAOBJS} ${AFSNFSOBJS} -lcc_kext - + dsymutil -o ${LIBAFS}.dSYM ${LIBAFS} ${LIBAFSNONFS}: $(AFSAOBJS) $(AFSNONFSOBJS) $(MODLD) -r -o ${LIBAFSNONFS} ${AFSAOBJS} ${AFSNONFSOBJS} -lcc_kext - + dsymutil -o ${LIBAFSNONFS}.dSYM ${LIBAFSNONFS} diff --git a/src/lwp/Makefile.in b/src/lwp/Makefile.in index 2fd7d63ee..76fca8486 100644 --- a/src/lwp/Makefile.in +++ b/src/lwp/Makefile.in @@ -53,9 +53,11 @@ process.o : process.s process.i386.s process.c ${AS} -ahlns process.ss -o process.o >process.lst; \ $(RM) process.ss ;; \ *_darwin* ) \ - ppc=`echo "${ARCHFLAGS}" | grep -q -w ppc && echo yes` ; \ - i386=`echo "${ARCHFLAGS}" | grep -q -w i386 && echo yes` ; \ - if [ -z "$${ppc}" -a -z "$${i386}" ] ; then \ + $(RM) -f process.o ; \ + ppc=`echo "${ARCHFLAGS}" | grep -q -w ppc && echo process.ppc.o` ; \ + i386=`echo "${ARCHFLAGS}" | grep -q -w i386 && echo process.i386.o` ; \ + amd64=`echo "${ARCHFLAGS}" | grep -q -w x86_64 && echo process.amd64.o` ; \ + if [ -z "$${ppc}" -a -z "$${i386}" -a -z "$${amd64}" ] ; then \ if [ `arch` = ppc ] ; then \ ppc=yes ; \ else \ @@ -63,19 +65,25 @@ process.o : process.s process.i386.s process.c fi ; \ fi ; \ if [ -n "$${ppc}" ] ; then \ - $(CC) ${LWP_DBG} ${LWP_OPTMZ} -c -arch ppc -I${TOP_INCDIR} ${srcdir}/process.s -o process.ppc.o ; \ - if [ -z "$${i386}" ] ; then \ - ${MV} process.ppc.o process.o ; \ + $(CC) ${LWP_DBG} ${LWP_OPTMZ} -c -arch ppc -I${TOP_INCDIR} ${srcdir}/process.s -o "$${ppc}" ; \ + if [ -z "$${i386}" -a -z "$${amd64}" ] ; then \ + ${MV} "$${ppc}" process.o ; \ fi ; \ fi ; \ if [ -n "$${i386}" ] ; then \ - $(CC) -x assembler-with-cpp -c -arch i386 -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.i386.s -o process.i386.o ; \ - if [ -z "$${ppc}" ] ; then \ - ${MV} process.i386.o process.o ; \ + $(CC) -x assembler-with-cpp -c -arch i386 -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.i386.s -o "$${i386}" ; \ + if [ -z "$${ppc}" -a -z "$${amd64}" ] ; then \ + ${MV} "$${i386}" process.o ; \ fi ; \ fi ; \ - if [ -n "$${ppc}" -a -n "$${i386}" ] ; then \ - lipo -create process.ppc.o process.i386.o -output process.o ;\ + if [ -n "$${amd64}" ] ; then \ + $(CC) -x assembler-with-cpp -c -arch x86_64 -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.amd64.s -o "$${amd64}" ; \ + if [ -z "$${ppc}" -a -z "$${i386}" ] ; then \ + ${MV} "$${amd64}" process.o ; \ + fi ; \ + fi ; \ + if [ ! -f process.o ] ; then \ + lipo -create $${amd64} $${i386} $${ppc} -output process.o ;\ fi ;; \ i386_*bsd*) \ cp ${srcdir}/process.i386.s process.S ; \ diff --git a/src/lwp/process.amd64.s b/src/lwp/process.amd64.s index 48dd25fd0..4b1ef9643 100644 --- a/src/lwp/process.amd64.s +++ b/src/lwp/process.amd64.s @@ -83,7 +83,7 @@ ENTRY(savecontext) movq %rsi, area1(%rbp) /* i multiples of 24, so 32 it is) */ movq %rdx, newsp(%rbp) /* and copy them there. */ - movq PRE_Block@GOTPCREL(%rip), %rax + movq _C_LABEL(PRE_Block)@GOTPCREL(%rip), %rax movl $1,(%rax) /* Do not allow any interrupts */ pushq %rsp /* Push all registers onto the stack */ @@ -149,7 +149,7 @@ ENTRY(returnto) popq %rax popq %rsp /* See savecontext */ - movq PRE_Block@GOTPCREL(%rip), %rax + movq _C_LABEL(PRE_Block)@GOTPCREL(%rip), %rax movl $0,(%rax) addq $32, %rsp /* We did rsp-32 above, correct that */ popq %rbp diff --git a/src/pam/afs_auth.c b/src/pam/afs_auth.c index 7725bc6e9..8b9d6ae46 100644 --- a/src/pam/afs_auth.c +++ b/src/pam/afs_auth.c @@ -175,8 +175,8 @@ pam_sm_authenticate(pam_handle_t * pamh, int flags, int argc, /* enhanced: use "ignore_uid " to specify the largest uid * which should be ignored by this module */ -#if defined(AFS_HPUX_ENV) -#if defined(AFS_HPUX110_ENV) +#if defined(AFS_HPUX_ENV) || defined(AFS_DARWIN100_ENV) +#if defined(AFS_HPUX110_ENV) || defined(AFS_DARWIN100_ENV) i = getpwnam_r(user, &unix_pwd, upwd_buf, sizeof(upwd_buf), &upwd); #else /* AFS_HPUX110_ENV */ i = getpwnam_r(user, &unix_pwd, upwd_buf, sizeof(upwd_buf)); diff --git a/src/pam/afs_password.c b/src/pam/afs_password.c index 81e59d957..a6a67da2f 100644 --- a/src/pam/afs_password.c +++ b/src/pam/afs_password.c @@ -119,8 +119,8 @@ pam_sm_chauthtok(pam_handle_t * pamh, int flags, int argc, const char **argv) * and its uid==0, and "ignore_root" was given in pam.conf, * ignore the user. */ -#if defined(AFS_HPUX_ENV) -#if defined(AFS_HPUX110_ENV) +#if defined(AFS_HPUX_ENV) || defined(AFS_DARWIN100_ENV) +#if defined(AFS_HPUX110_ENV) || defined(AFS_DARWIN100_ENV) i = getpwnam_r(user, &unix_pwd, upwd_buf, sizeof(upwd_buf), &upwd); #else /* AFS_HPUX110_ENV */ i = getpwnam_r(user, &unix_pwd, upwd_buf, sizeof(upwd_buf)); diff --git a/src/pam/afs_setcred.c b/src/pam/afs_setcred.c index 3a2f39fc0..52e031052 100644 --- a/src/pam/afs_setcred.c +++ b/src/pam/afs_setcred.c @@ -155,8 +155,8 @@ pam_sm_setcred(pam_handle_t * pamh, int flags, int argc, const char **argv) /* enhanced: use "ignore_uid " to specify the largest uid * which should be ignored by this module */ -#if defined(AFS_HPUX_ENV) -#if defined(AFS_HPUX110_ENV) +#if defined(AFS_HPUX_ENV) || defined(AFS_DARWIN100_ENV) +#if defined(AFS_HPUX110_ENV) || defined(AFS_DARWIN100_ENV) i = getpwnam_r(user, &unix_pwd, upwd_buf, sizeof(upwd_buf), &upwd); #else /* AFS_HPUX110_ENV */ i = getpwnam_r(user, &unix_pwd, upwd_buf, sizeof(upwd_buf)); diff --git a/src/ptserver/Makefile.in b/src/ptserver/Makefile.in index 4f9935e3b..dee0528c2 100644 --- a/src/ptserver/Makefile.in +++ b/src/ptserver/Makefile.in @@ -34,7 +34,6 @@ LIBS=${TOP_LIBDIR}/libubik.a \ ${TOP_LIBDIR}/libdes.a \ ${TOP_LIBDIR}/libcmd.a \ ${TOP_LIBDIR}/libcom_err.a \ - ${TOP_LIBDIR}/util.a \ ${TOP_LIBDIR}/libsys.a \ ${TOP_LIBDIR}/libafsutil.a diff --git a/src/usd/usd_file.c b/src/usd/usd_file.c index a13881864..bfb01b599 100644 --- a/src/usd/usd_file.c +++ b/src/usd/usd_file.c @@ -26,7 +26,9 @@ #if defined(AFS_DUX40_ENV) || defined(AFS_OBSD_ENV) || defined(AFS_NBSD_ENV) #include #endif +#ifndef AFS_DARWIN100_ENV #include +#endif #endif /* AFS_AIX_ENV */ #include @@ -209,6 +211,9 @@ usd_FileIoctl(usd_handle_t usd, int req, void *arg) case USD_IOCTL_TAPEOPERATION: { +#ifdef AFS_DARWIN100_ENV + code = EOPNOTSUPP; +#else usd_tapeop_t *tapeOpp = (usd_tapeop_t *) arg; #if defined(AFS_AIX_ENV) struct stop os_tapeop; @@ -255,7 +260,7 @@ usd_FileIoctl(usd_handle_t usd, int req, void *arg) code = ioctl(fd, MTIOCTOP, &os_tapeop); #endif /* AFS_AIX_ENV */ - +#endif if (code == -1) { code = errno; } else { diff --git a/src/util/pthread_glock.c b/src/util/pthread_glock.c index e41b3bfc8..3ab164c6c 100644 --- a/src/util/pthread_glock.c +++ b/src/util/pthread_glock.c @@ -14,6 +14,7 @@ #if defined(AFS_NT40_ENV) && defined(AFS_PTHREAD_ENV) #define AFS_GRMUTEX_DECLSPEC __declspec(dllexport) #endif +#ifdef AFS_PTHREAD_ENV #include #include @@ -83,3 +84,4 @@ pthread_recursive_mutex_unlock(pthread_recursive_mutex_t * mut) } return rc; } +#endif -- 2.39.5