Adjust for microtime() ABI on all XBSD
authorBen Kaduk <kaduk@mit.edu>
Tue, 15 Oct 2013 20:00:01 +0000 (16:00 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 25 Oct 2013 23:50:46 +0000 (16:50 -0700)
On the BSDs, struct timeval is not two 32-bit integers like our
struct clock, so the ABI is quite incompatible.  Use the native type
for the function call and translate to our local type accordingly.

This lets us get rid of a workaround for the FreeBSD kernel build,
wherein particular compiler flags masked the stack corruption that
can occur due to this ABI mismatch.

Change-Id: I68f9947b0875dca7343ecd41a4c529d5c5bc3be5
Reviewed-on: http://gerrit.openafs.org/10340
Reviewed-by: Jeffrey Hutzelman <jhutz@cmu.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Antoine Verheijen <apv@ualberta.ca>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/libafs/MakefileProto.FBSD.in
src/rx/rx_clock.h

index 22fd09f..4c3c0cd 100644 (file)
@@ -8,11 +8,6 @@
 srcdir=@srcdir@
 include @TOP_OBJDIR@/src/config/Makefile.config
 
-# rx_event is miscompiled by gcc at -O0, causing panic on startup
-.if empty(${CFLAGS:M-O})
-CFLAGS+=       -O
-.endif
-
 # tell bsd.kmod.mk to build us vnode_if*
 SRCS=  vnode_if.h
 
index 648d571..e3f20a2 100644 (file)
@@ -97,7 +97,7 @@ extern void clock_UpdateTime(void);
 #if defined(AFS_SGI61_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX_64BIT_KERNEL)
 #define clock_GetTime(cv) osi_GetTime((osi_timeval_t *)cv)
 #else
-#if (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) || (defined(AFS_DARWIN100_ENV) && defined(__amd64__)) || defined(AFS_NBSD_ENV)
+#if (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) || (defined(AFS_DARWIN100_ENV) && defined(__amd64__)) || defined(AFS_XBSD_ENV)
 #define        clock_GetTime(cv)                               \
     BEGIN                                              \
        struct timeval tv;                              \