2003/09/08 01:45:11
[org.ibex.core.git] / upstream / darwin-linker / patches / cctools.patch
index 03fd00c..0ce718b 100644 (file)
@@ -937,9 +937,1197 @@ diff -rub ./misc/Makefile ./misc/Makefile
  
  shlib_clean:
        -rm -f \
---- ld/fake-mach.c     Sat Sep  6 21:32:56 2003
-+++ ld/fake-mach.c     Tue Aug 26 11:40:24 2003
-@@ -0,0 +1,160 @@
+--- ld/makeUser.c      Sat Sep  6 21:52:24 2003
++++ ld/makeUser.c      Mon Aug 25 22:54:46 2003
+@@ -0,0 +1,305 @@
++/*
++ * IDENTIFICATION:
++ * stub generated Mon Aug 25 15:06:30 2003
++ * with a MiG generated Tue Nov 5 01:17:50 PST 2002 by root@brixen
++ * OPTIONS: 
++ */
++#include "make.h"
++
++
++#ifndef       mig_internal
++#define       mig_internal    static
++#endif        /* mig_internal */
++
++#ifndef       mig_external
++#define mig_external
++#endif        /* mig_external */
++
++#ifndef       TypeCheck
++#define       TypeCheck 0
++#endif        /* TypeCheck */
++
++#ifndef       LimitCheck
++#define       LimitCheck 0
++#endif        /* LimitCheck */
++
++#ifndef       min
++#define       min(a,b)  ( ((a) < (b))? (a): (b) )
++#endif        /* min */
++
++#ifndef       UseStaticTemplates
++#define       UseStaticTemplates      0
++#endif        /* UseStaticTemplates */
++
++#define _WALIGN_(x) (((x) + 3) & ~3)
++#define _WALIGNSZ_(x) _WALIGN_(sizeof(x))
++#ifndef       __MachMsgErrorWithTimeout
++#define       __MachMsgErrorWithTimeout(_R_) { \
++      switch (_R_) { \
++      case MACH_SEND_INVALID_REPLY: \
++      case MACH_RCV_INVALID_NAME: \
++      case MACH_RCV_PORT_DIED: \
++      case MACH_RCV_PORT_CHANGED: \
++      case MACH_RCV_TIMED_OUT: \
++              mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
++              break; \
++      default: \
++              mig_put_reply_port(InP->Head.msgh_reply_port); \
++      } \
++}
++#endif        /* __MachMsgErrorWithTimeout */
++
++#ifndef       __MachMsgErrorWithoutTimeout
++#define       __MachMsgErrorWithoutTimeout(_R_) { \
++      switch (_R_) { \
++      case MACH_SEND_INVALID_REPLY: \
++      case MACH_RCV_INVALID_NAME: \
++      case MACH_RCV_PORT_DIED: \
++      case MACH_RCV_PORT_CHANGED: \
++              mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
++              break; \
++      default: \
++              mig_put_reply_port(InP->Head.msgh_reply_port); \
++      } \
++}
++#endif        /* __MachMsgErrorWithoutTimeout */
++
++#ifndef       __DeclareSendRpc
++#define       __DeclareSendRpc(_NUM_, _NAME_)
++#endif        /* __DeclareSendRpc */
++
++#ifndef       __BeforeSendRpc
++#define       __BeforeSendRpc(_NUM_, _NAME_)
++#endif        /* __BeforeSendRpc */
++
++#ifndef       __AfterSendRpc
++#define       __AfterSendRpc(_NUM_, _NAME_)
++#endif        /* __AfterSendRpc */
++
++#ifndef       __DeclareSendSimple
++#define       __DeclareSendSimple(_NUM_, _NAME_)
++#endif        /* __DeclareSendSimple */
++
++#ifndef       __BeforeSendSimple
++#define       __BeforeSendSimple(_NUM_, _NAME_)
++#endif        /* __BeforeSendSimple */
++
++#ifndef       __AfterSendSimple
++#define       __AfterSendSimple(_NUM_, _NAME_)
++#endif        /* __AfterSendSimple */
++
++#define msgh_request_port     msgh_remote_port
++#define msgh_reply_port               msgh_local_port
++
++
++
++/* SimpleRoutine alert_old */
++mig_external kern_return_t make_alert_old
++(
++      mach_port_t makePort,
++      int eventType,
++      make_string_t functionName,
++      mach_msg_type_number_t functionNameCnt,
++      make_string_t fileName,
++      mach_msg_type_number_t fileNameCnt,
++      int line,
++      make_string_t message,
++      mach_msg_type_number_t messageCnt
++)
++{
++    {
++      typedef struct {
++              mach_msg_header_t Head;
++              NDR_record_t NDR;
++              int eventType;
++              mach_msg_type_number_t functionNameCnt;
++              char functionName[1024];
++              mach_msg_type_number_t fileNameCnt;
++              char fileName[1024];
++              int line;
++              mach_msg_type_number_t messageCnt;
++              char message[1024];
++      } Request;
++
++      /*
++       * typedef struct {
++       *      mach_msg_header_t Head;
++       *      NDR_record_t NDR;
++       *      kern_return_t RetCode;
++       * } mig_reply_error_t;
++       */
++
++      union {
++              Request In;
++      } Mess;
++
++      register Request *InP = &Mess.In;
++
++      mach_msg_return_t msg_result;
++      unsigned int msgh_size;
++      unsigned int msgh_size_delta;
++      __DeclareSendSimple(100, "alert_old")
++
++      InP->NDR = NDR_record;
++
++      InP->eventType = eventType;
++
++      if (functionNameCnt > 1024) {
++              { return MIG_ARRAY_TOO_LARGE; }
++      }
++      (void)memcpy((char *) InP->functionName, (const char *) functionName, functionNameCnt);
++
++      InP->functionNameCnt = functionNameCnt;
++
++      msgh_size_delta = _WALIGN_(functionNameCnt);
++      msgh_size = (sizeof(Request) - 3072) + msgh_size_delta;
++      InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
++
++      if (fileNameCnt > 1024) {
++              { return MIG_ARRAY_TOO_LARGE; }
++      }
++      (void)memcpy((char *) InP->fileName, (const char *) fileName, fileNameCnt);
++
++      InP->fileNameCnt = fileNameCnt;
++
++      msgh_size_delta = _WALIGN_(fileNameCnt);
++      msgh_size += msgh_size_delta;
++      InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
++
++      InP->line = line;
++
++      if (messageCnt > 1024) {
++              { return MIG_ARRAY_TOO_LARGE; }
++      }
++      (void)memcpy((char *) InP->message, (const char *) message, messageCnt);
++
++      InP->messageCnt = messageCnt;
++
++      msgh_size += _WALIGN_(messageCnt);
++      InP = &Mess.In;
++      InP->Head.msgh_bits =
++              MACH_MSGH_BITS(19, 0);
++      /* msgh_size passed as argument */
++      InP->Head.msgh_request_port = makePort;
++      InP->Head.msgh_reply_port = MACH_PORT_NULL;
++      InP->Head.msgh_id = 100;
++
++      __BeforeSendSimple(100, "alert_old")
++      msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, msgh_size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
++      __AfterSendSimple(100, "alert_old")
++              return msg_result;
++    }
++}
++
++/* SimpleRoutine alert */
++mig_external kern_return_t make_alert
++(
++      mach_port_t makePort,
++      int eventType,
++      make_string_t functionName,
++      mach_msg_type_number_t functionNameCnt,
++      make_string_t fileName,
++      mach_msg_type_number_t fileNameCnt,
++      make_string_t directory,
++      mach_msg_type_number_t directoryCnt,
++      int line,
++      make_string_t message,
++      mach_msg_type_number_t messageCnt
++)
++{
++    {
++      typedef struct {
++              mach_msg_header_t Head;
++              NDR_record_t NDR;
++              int eventType;
++              mach_msg_type_number_t functionNameCnt;
++              char functionName[1024];
++              mach_msg_type_number_t fileNameCnt;
++              char fileName[1024];
++              mach_msg_type_number_t directoryCnt;
++              char directory[1024];
++              int line;
++              mach_msg_type_number_t messageCnt;
++              char message[1024];
++      } Request;
++
++      /*
++       * typedef struct {
++       *      mach_msg_header_t Head;
++       *      NDR_record_t NDR;
++       *      kern_return_t RetCode;
++       * } mig_reply_error_t;
++       */
++
++      union {
++              Request In;
++      } Mess;
++
++      register Request *InP = &Mess.In;
++
++      mach_msg_return_t msg_result;
++      unsigned int msgh_size;
++      unsigned int msgh_size_delta;
++      __DeclareSendSimple(101, "alert")
++
++      InP->NDR = NDR_record;
++
++      InP->eventType = eventType;
++
++      if (functionNameCnt > 1024) {
++              { return MIG_ARRAY_TOO_LARGE; }
++      }
++      (void)memcpy((char *) InP->functionName, (const char *) functionName, functionNameCnt);
++
++      InP->functionNameCnt = functionNameCnt;
++
++      msgh_size_delta = _WALIGN_(functionNameCnt);
++      msgh_size = (sizeof(Request) - 4096) + msgh_size_delta;
++      InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
++
++      if (fileNameCnt > 1024) {
++              { return MIG_ARRAY_TOO_LARGE; }
++      }
++      (void)memcpy((char *) InP->fileName, (const char *) fileName, fileNameCnt);
++
++      InP->fileNameCnt = fileNameCnt;
++
++      msgh_size_delta = _WALIGN_(fileNameCnt);
++      msgh_size += msgh_size_delta;
++      InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
++
++      if (directoryCnt > 1024) {
++              { return MIG_ARRAY_TOO_LARGE; }
++      }
++      (void)memcpy((char *) InP->directory, (const char *) directory, directoryCnt);
++
++      InP->directoryCnt = directoryCnt;
++
++      msgh_size_delta = _WALIGN_(directoryCnt);
++      msgh_size += msgh_size_delta;
++      InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
++
++      InP->line = line;
++
++      if (messageCnt > 1024) {
++              { return MIG_ARRAY_TOO_LARGE; }
++      }
++      (void)memcpy((char *) InP->message, (const char *) message, messageCnt);
++
++      InP->messageCnt = messageCnt;
++
++      msgh_size += _WALIGN_(messageCnt);
++      InP = &Mess.In;
++      InP->Head.msgh_bits =
++              MACH_MSGH_BITS(19, 0);
++      /* msgh_size passed as argument */
++      InP->Head.msgh_request_port = makePort;
++      InP->Head.msgh_reply_port = MACH_PORT_NULL;
++      InP->Head.msgh_id = 101;
++
++      __BeforeSendSimple(101, "alert")
++      msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, msgh_size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
++      __AfterSendSimple(101, "alert")
++              return msg_result;
++    }
++}
+diff -bur ./Makefile /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/Makefile
+--- as/Makefile        Fri Sep  6 18:27:10 2002
++++ as/Makefile        Sat Sep  6 23:52:22 2003
+@@ -2,7 +2,7 @@
+ export USE_APPLE_PB_SUPPORT = all
+ OFLAG = -O
+ ifeq "macos" "$(RC_OS)"
+-  X_CFLAGS := $(shell if [ "$(RC_RELEASE)" != "Beaker" ] &&    \
++  X_CFLAGS := $(shell if [ `uname` != "Linux" ] && [ "$(RC_RELEASE)" != "Beaker" ] &&    \
+                        [ "$(RC_RELEASE)" != "Bunsen" ] &&    \
+                        [ "$(RC_RELEASE)" != "Gonzo"  ] &&    \
+                        [ "$(RC_RELEASE)" != "Kodiak" ]; then \
+@@ -11,10 +11,14 @@
+ endif
+ ifneq "mwccppc" "$(notdir $(CC))"
++  ifeq "Linux" "$(shell uname)"
++    GCC_FLAGS = -Wall $(X_CFLAGS) -D__LITTLE_ENDIAN__ -U__BIG_ENDIAN__  -D__ppc__ -I/usr/include -I../../../macosx-include
++  else
+   GCC_FLAGS = -Wall -Wno-precomp $(X_CFLAGS)
++  endif
+ endif
+-USE_DEPENDENCY_FILE := $(shell if [ "$(notdir $(CC))" != "mwccppc" ]; then \
++USE_DEPENDENCY_FILE := $(shell if [ `uname` != "Linux" ] && [ "$(notdir $(CC))" != "mwccppc" ]; then \
+            echo YES ; else echo NO ; \
+            fi; )
+diff -bur ./app.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/app.h
+--- as/app.h   Tue Apr 30 00:37:17 2002
++++ as/app.h   Sat Sep  6 23:49:28 2003
+@@ -1,4 +1,4 @@
+-#import <stdio.h>
++#include <stdio.h>
+ extern FILE *scrub_file;
+ extern char *scrub_string;
+diff -bur ./as.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/as.h
+--- as/as.h    Tue Apr 30 00:37:17 2002
++++ as/as.h    Sat Sep  6 23:49:28 2003
+@@ -43,10 +43,10 @@
+  */
+ #undef SUSPECT
+-/* These #imports are for type definitions etc. */
+-#import <stdio.h>
+-#import <assert.h>
+-#import <mach/machine.h>
++/* These #includes are for type definitions etc. */
++#include <stdio.h>
++#include <assert.h>
++#include <mach/machine.h>
+ /* These defines are potentially useful */
+ #undef FALSE
+Only in /home/megacz/xwt/upstream/darwin-linker/src/cctools/as: asparc_dir
+diff -bur ./atof-ieee.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/atof-ieee.h
+--- as/atof-ieee.h     Tue Apr 30 00:37:17 2002
++++ as/atof-ieee.h     Sat Sep  6 23:49:28 2003
+@@ -1,4 +1,4 @@
+-#import "flonum.h"
++#include "flonum.h"
+ extern char *atof_ieee(
+     char *str,
+diff -bur ./bignum.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/bignum.h
+--- as/bignum.h        Tue Apr 30 00:37:17 2002
++++ as/bignum.h        Sat Sep  6 23:53:27 2003
+@@ -28,6 +28,8 @@
+ *     Bignums are >= 0.                                               *
+ *                                                                     *
+ \***********************************************************************/
++#ifndef __BIGNUM_H__
++#define __BIGNUM_H__
+ #define       LITTLENUM_NUMBER_OF_BITS        (16)
+ #define       LITTLENUM_RADIX                 (1 << LITTLENUM_NUMBER_OF_BITS)
+@@ -44,3 +46,4 @@
+ /* JF truncated this to get around a problem with GCC */
+ #define       LOG_TO_BASE_2_OF_10     (3.3219280948873623478703194294893901758651)
+ /* WARNING: I haven't checked that the trailing digits are correct! */
++#endif
+diff -bur ./expr.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/expr.h
+--- as/expr.h  Fri Sep  6 18:27:10 2002
++++ as/expr.h  Sat Sep  6 23:49:28 2003
+@@ -19,9 +19,9 @@
+ along with GAS; see the file COPYING.  If not, write to
+ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+-#import "struc-symbol.h"
+-#import "bignum.h"
+-#import "flonum.h"
++#include "struc-symbol.h"
++#include "bignum.h"
++#include "flonum.h"
+ /*
+  * This table describes the use of segments as EXPRESSION types.
+diff -bur ./flonum.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/flonum.h
+--- as/flonum.h        Fri Sep  6 18:27:10 2002
++++ as/flonum.h        Sat Sep  6 23:49:28 2003
+@@ -32,7 +32,7 @@
+ *                                                                     *
+ \***********************************************************************/
+-#import "bignum.h"
++#include "bignum.h"
+ /***********************************************************************\
+ *                                                                     *
+diff -bur ./frags.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/frags.h
+--- as/frags.h Tue Jan 14 23:35:18 2003
++++ as/frags.h Sat Sep  6 23:49:28 2003
+@@ -19,8 +19,8 @@
+ along with GAS; see the file COPYING.  If not, write to
+ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+-#import "relax.h"
+-#import "struc-symbol.h"
++#include "relax.h"
++#include "struc-symbol.h"
+ /*
+  * A code fragment (frag) is some known number of chars, followed by some
+diff -bur ./md.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/md.h
+--- as/md.h    Tue Apr 30 00:37:17 2002
++++ as/md.h    Sat Sep  6 23:49:29 2003
+@@ -19,13 +19,13 @@
+ in a file named COPYING.  Among other things, the copyright
+ notice and this notice must be preserved on all copies.  */
+-#import <mach/machine.h>
+-#import "stuff/bytesex.h"
+-#import "frags.h"
+-#import "relax.h"
+-#import "struc-symbol.h"
+-#import "fixes.h"
+-#import "read.h"
++#include <mach/machine.h>
++#include "stuff/bytesex.h"
++#include "frags.h"
++#include "relax.h"
++#include "struc-symbol.h"
++#include "fixes.h"
++#include "read.h"
+ /* These are the default cputype and cpusubtype for this target MACHINE */
+ extern const cpu_type_t md_cputype;
+diff -bur ./read.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/read.h
+--- as/read.h  Fri Sep  6 18:27:13 2002
++++ as/read.h  Sat Sep  6 23:49:29 2003
+@@ -19,7 +19,7 @@
+ along with GAS; see the file COPYING.  If not, write to
+ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+-#import "expr.h"
++#include "expr.h"
+ #define PERMIT_WHITESPACE     /* Define to make whitespace be allowed in */
+                               /* many syntactically unnecessary places. */
+diff -bur ./relax.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/relax.h
+--- as/relax.h Tue Apr 30 00:37:17 2002
++++ as/relax.h Sat Sep  6 23:53:35 2003
+@@ -1,3 +1,5 @@
++#ifndef __RELAX_H__
++#define __RELAX_H__
+ /* The type used for a target address */
+ typedef unsigned long relax_addressT;
+@@ -42,3 +44,4 @@
+     relax_substateT rlx_more;   /* Next longer relax-state. */
+                                 /* 0 means there is no 'next' relax-state. */
+ } relax_typeS;
++#endif
+diff -bur ./sections.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/sections.h
+--- as/sections.h      Tue Apr 30 00:37:17 2002
++++ as/sections.h      Sat Sep  6 23:49:29 2003
+@@ -17,8 +17,8 @@
+ along with GAS; see the file COPYING.  If not, write to
+ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+-#import <mach-o/loader.h>
+-#import "struc-symbol.h"
++#include <mach-o/loader.h>
++#include "struc-symbol.h"
+ /*
+  * For every section the user mentions in the assembley program, we make one
+diff -bur ./struc-symbol.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/struc-symbol.h
+--- as/struc-symbol.h  Fri Sep  6 18:27:14 2002
++++ as/struc-symbol.h  Sat Sep  6 23:49:29 2003
+@@ -20,7 +20,7 @@
+ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+ #ifdef NeXT_MOD
+-#import <mach-o/nlist.h>
++#include <mach-o/nlist.h>
+ #else /* !defined(NeXT_MOD) */
+ #ifndef               VMS
+ #include "a.out.h"            /* Needed to define struct nlist. Sigh. */
+diff -bur ./symbols.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/symbols.h
+--- as/symbols.h       Tue Apr 30 00:37:17 2002
++++ as/symbols.h       Sat Sep  6 23:49:29 2003
+@@ -17,8 +17,8 @@
+ along with GAS; see the file COPYING.  If not, write to
+ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+-#import "struc-symbol.h"
+-#import "hash.h"
++#include "struc-symbol.h"
++#include "hash.h"
+ extern struct hash_control *sy_hash;
+ extern struct obstack notes;
+--- as/make.h  Sun Sep  7 00:01:26 2003
++++ as/make.h  Sat Sep  6 23:55:11 2003
+@@ -0,0 +1,161 @@
++#ifndef       _make_user_
++#define       _make_user_
++
++/* Module make */
++
++#include <string.h>
++#include <mach/ndr.h>
++#include <mach/boolean.h>
++#include <mach/kern_return.h>
++#include <mach/notify.h>
++#include <mach/mach_types.h>
++#include <mach/message.h>
++#include <mach/mig_errors.h>
++#include <mach/port.h>
++
++#ifdef AUTOTEST
++#ifndef FUNCTION_PTR_T
++#define FUNCTION_PTR_T
++typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
++typedef struct {
++        char            *name;
++        function_ptr_t  function;
++} function_table_entry;
++typedef function_table_entry  *function_table_t;
++#endif /* FUNCTION_PTR_T */
++#endif /* AUTOTEST */
++
++#ifndef       make_MSG_COUNT
++#define       make_MSG_COUNT  2
++#endif        /* make_MSG_COUNT */
++
++#include <mach/std_types.h>
++#include <mach/mig.h>
++#include "make_defs.h"
++
++#ifdef __BeforeMigUserHeader
++__BeforeMigUserHeader
++#endif /* __BeforeMigUserHeader */
++
++
++/* SimpleRoutine alert_old */
++#ifdef        mig_external
++mig_external
++#else
++extern
++#endif        /* mig_external */
++kern_return_t make_alert_old
++(
++      mach_port_t makePort,
++      int eventType,
++      make_string_t functionName,
++      mach_msg_type_number_t functionNameCnt,
++      make_string_t fileName,
++      mach_msg_type_number_t fileNameCnt,
++      int line,
++      make_string_t message,
++      mach_msg_type_number_t messageCnt
++);
++
++/* SimpleRoutine alert */
++#ifdef        mig_external
++mig_external
++#else
++extern
++#endif        /* mig_external */
++kern_return_t make_alert
++(
++      mach_port_t makePort,
++      int eventType,
++      make_string_t functionName,
++      mach_msg_type_number_t functionNameCnt,
++      make_string_t fileName,
++      mach_msg_type_number_t fileNameCnt,
++      make_string_t directory,
++      mach_msg_type_number_t directoryCnt,
++      int line,
++      make_string_t message,
++      mach_msg_type_number_t messageCnt
++);
++/* typedefs for all requests */
++
++#ifndef __Request__make_subsystem__defined
++#define __Request__make_subsystem__defined
++      typedef struct {
++              mach_msg_header_t Head;
++              NDR_record_t NDR;
++              int eventType;
++              mach_msg_type_number_t functionNameCnt;
++              char functionName[1024];
++              mach_msg_type_number_t fileNameCnt;
++              char fileName[1024];
++              int line;
++              mach_msg_type_number_t messageCnt;
++              char message[1024];
++      } __Request__alert_old_t;
++
++      typedef struct {
++              mach_msg_header_t Head;
++              NDR_record_t NDR;
++              int eventType;
++              mach_msg_type_number_t functionNameCnt;
++              char functionName[1024];
++              mach_msg_type_number_t fileNameCnt;
++              char fileName[1024];
++              mach_msg_type_number_t directoryCnt;
++              char directory[1024];
++              int line;
++              mach_msg_type_number_t messageCnt;
++              char message[1024];
++      } __Request__alert_t;
++
++#endif /* !__Request__make_subsystem__defined */
++
++/* union of all requests */
++
++#ifndef __RequestUnion__make_make_subsystem__defined
++#define __RequestUnion__make_make_subsystem__defined
++union __RequestUnion__make_make_subsystem {
++      __Request__alert_old_t Request_make_alert_old;
++      __Request__alert_t Request_make_alert;
++};
++#endif /* !__RequestUnion__make_make_subsystem__defined */
++/* typedefs for all replies */
++
++#ifndef __Reply__make_subsystem__defined
++#define __Reply__make_subsystem__defined
++      typedef struct {
++              mach_msg_header_t Head;
++              NDR_record_t NDR;
++              kern_return_t RetCode;
++      } __Reply__alert_old_t;
++
++      typedef struct {
++              mach_msg_header_t Head;
++              NDR_record_t NDR;
++              kern_return_t RetCode;
++      } __Reply__alert_t;
++
++#endif /* !__Reply__make_subsystem__defined */
++
++/* union of all replies */
++
++#ifndef __ReplyUnion__make_make_subsystem__defined
++#define __ReplyUnion__make_make_subsystem__defined
++union __ReplyUnion__make_make_subsystem {
++      __Reply__alert_old_t Reply_make_alert_old;
++      __Reply__alert_t Reply_make_alert;
++};
++#endif /* !__RequestUnion__make_make_subsystem__defined */
++
++#ifndef subsystem_to_name_map_make
++#define subsystem_to_name_map_make \
++    { "alert_old", 100 },\
++    { "alert", 101 }
++#endif
++
++#ifdef __AfterMigUserHeader
++__AfterMigUserHeader
++#endif /* __AfterMigUserHeader */
++
++#endif         /* _make_user_ */
+--- as/makeUser.c      Sun Sep  7 00:01:26 2003
++++ as/makeUser.c      Sat Sep  6 23:55:11 2003
+@@ -0,0 +1,305 @@
++/*
++ * IDENTIFICATION:
++ * stub generated Sat Sep  6 23:50:34 2003
++ * with a MiG generated Tue Nov 5 01:17:50 PST 2002 by root@brixen
++ * OPTIONS: 
++ */
++#include "make.h"
++
++
++#ifndef       mig_internal
++#define       mig_internal    static
++#endif        /* mig_internal */
++
++#ifndef       mig_external
++#define mig_external
++#endif        /* mig_external */
++
++#ifndef       TypeCheck
++#define       TypeCheck 0
++#endif        /* TypeCheck */
++
++#ifndef       LimitCheck
++#define       LimitCheck 0
++#endif        /* LimitCheck */
++
++#ifndef       min
++#define       min(a,b)  ( ((a) < (b))? (a): (b) )
++#endif        /* min */
++
++#ifndef       UseStaticTemplates
++#define       UseStaticTemplates      0
++#endif        /* UseStaticTemplates */
++
++#define _WALIGN_(x) (((x) + 3) & ~3)
++#define _WALIGNSZ_(x) _WALIGN_(sizeof(x))
++#ifndef       __MachMsgErrorWithTimeout
++#define       __MachMsgErrorWithTimeout(_R_) { \
++      switch (_R_) { \
++      case MACH_SEND_INVALID_REPLY: \
++      case MACH_RCV_INVALID_NAME: \
++      case MACH_RCV_PORT_DIED: \
++      case MACH_RCV_PORT_CHANGED: \
++      case MACH_RCV_TIMED_OUT: \
++              mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
++              break; \
++      default: \
++              mig_put_reply_port(InP->Head.msgh_reply_port); \
++      } \
++}
++#endif        /* __MachMsgErrorWithTimeout */
++
++#ifndef       __MachMsgErrorWithoutTimeout
++#define       __MachMsgErrorWithoutTimeout(_R_) { \
++      switch (_R_) { \
++      case MACH_SEND_INVALID_REPLY: \
++      case MACH_RCV_INVALID_NAME: \
++      case MACH_RCV_PORT_DIED: \
++      case MACH_RCV_PORT_CHANGED: \
++              mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
++              break; \
++      default: \
++              mig_put_reply_port(InP->Head.msgh_reply_port); \
++      } \
++}
++#endif        /* __MachMsgErrorWithoutTimeout */
++
++#ifndef       __DeclareSendRpc
++#define       __DeclareSendRpc(_NUM_, _NAME_)
++#endif        /* __DeclareSendRpc */
++
++#ifndef       __BeforeSendRpc
++#define       __BeforeSendRpc(_NUM_, _NAME_)
++#endif        /* __BeforeSendRpc */
++
++#ifndef       __AfterSendRpc
++#define       __AfterSendRpc(_NUM_, _NAME_)
++#endif        /* __AfterSendRpc */
++
++#ifndef       __DeclareSendSimple
++#define       __DeclareSendSimple(_NUM_, _NAME_)
++#endif        /* __DeclareSendSimple */
++
++#ifndef       __BeforeSendSimple
++#define       __BeforeSendSimple(_NUM_, _NAME_)
++#endif        /* __BeforeSendSimple */
++
++#ifndef       __AfterSendSimple
++#define       __AfterSendSimple(_NUM_, _NAME_)
++#endif        /* __AfterSendSimple */
++
++#define msgh_request_port     msgh_remote_port
++#define msgh_reply_port               msgh_local_port
++
++
++
++/* SimpleRoutine alert_old */
++mig_external kern_return_t make_alert_old
++(
++      mach_port_t makePort,
++      int eventType,
++      make_string_t functionName,
++      mach_msg_type_number_t functionNameCnt,
++      make_string_t fileName,
++      mach_msg_type_number_t fileNameCnt,
++      int line,
++      make_string_t message,
++      mach_msg_type_number_t messageCnt
++)
++{
++    {
++      typedef struct {
++              mach_msg_header_t Head;
++              NDR_record_t NDR;
++              int eventType;
++              mach_msg_type_number_t functionNameCnt;
++              char functionName[1024];
++              mach_msg_type_number_t fileNameCnt;
++              char fileName[1024];
++              int line;
++              mach_msg_type_number_t messageCnt;
++              char message[1024];
++      } Request;
++
++      /*
++       * typedef struct {
++       *      mach_msg_header_t Head;
++       *      NDR_record_t NDR;
++       *      kern_return_t RetCode;
++       * } mig_reply_error_t;
++       */
++
++      union {
++              Request In;
++      } Mess;
++
++      register Request *InP = &Mess.In;
++
++      mach_msg_return_t msg_result;
++      unsigned int msgh_size;
++      unsigned int msgh_size_delta;
++      __DeclareSendSimple(100, "alert_old")
++
++      InP->NDR = NDR_record;
++
++      InP->eventType = eventType;
++
++      if (functionNameCnt > 1024) {
++              { return MIG_ARRAY_TOO_LARGE; }
++      }
++      (void)memcpy((char *) InP->functionName, (const char *) functionName, functionNameCnt);
++
++      InP->functionNameCnt = functionNameCnt;
++
++      msgh_size_delta = _WALIGN_(functionNameCnt);
++      msgh_size = (sizeof(Request) - 3072) + msgh_size_delta;
++      InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
++
++      if (fileNameCnt > 1024) {
++              { return MIG_ARRAY_TOO_LARGE; }
++      }
++      (void)memcpy((char *) InP->fileName, (const char *) fileName, fileNameCnt);
++
++      InP->fileNameCnt = fileNameCnt;
++
++      msgh_size_delta = _WALIGN_(fileNameCnt);
++      msgh_size += msgh_size_delta;
++      InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
++
++      InP->line = line;
++
++      if (messageCnt > 1024) {
++              { return MIG_ARRAY_TOO_LARGE; }
++      }
++      (void)memcpy((char *) InP->message, (const char *) message, messageCnt);
++
++      InP->messageCnt = messageCnt;
++
++      msgh_size += _WALIGN_(messageCnt);
++      InP = &Mess.In;
++      InP->Head.msgh_bits =
++              MACH_MSGH_BITS(19, 0);
++      /* msgh_size passed as argument */
++      InP->Head.msgh_request_port = makePort;
++      InP->Head.msgh_reply_port = MACH_PORT_NULL;
++      InP->Head.msgh_id = 100;
++
++      __BeforeSendSimple(100, "alert_old")
++      msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, msgh_size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
++      __AfterSendSimple(100, "alert_old")
++              return msg_result;
++    }
++}
++
++/* SimpleRoutine alert */
++mig_external kern_return_t make_alert
++(
++      mach_port_t makePort,
++      int eventType,
++      make_string_t functionName,
++      mach_msg_type_number_t functionNameCnt,
++      make_string_t fileName,
++      mach_msg_type_number_t fileNameCnt,
++      make_string_t directory,
++      mach_msg_type_number_t directoryCnt,
++      int line,
++      make_string_t message,
++      mach_msg_type_number_t messageCnt
++)
++{
++    {
++      typedef struct {
++              mach_msg_header_t Head;
++              NDR_record_t NDR;
++              int eventType;
++              mach_msg_type_number_t functionNameCnt;
++              char functionName[1024];
++              mach_msg_type_number_t fileNameCnt;
++              char fileName[1024];
++              mach_msg_type_number_t directoryCnt;
++              char directory[1024];
++              int line;
++              mach_msg_type_number_t messageCnt;
++              char message[1024];
++      } Request;
++
++      /*
++       * typedef struct {
++       *      mach_msg_header_t Head;
++       *      NDR_record_t NDR;
++       *      kern_return_t RetCode;
++       * } mig_reply_error_t;
++       */
++
++      union {
++              Request In;
++      } Mess;
++
++      register Request *InP = &Mess.In;
++
++      mach_msg_return_t msg_result;
++      unsigned int msgh_size;
++      unsigned int msgh_size_delta;
++      __DeclareSendSimple(101, "alert")
++
++      InP->NDR = NDR_record;
++
++      InP->eventType = eventType;
++
++      if (functionNameCnt > 1024) {
++              { return MIG_ARRAY_TOO_LARGE; }
++      }
++      (void)memcpy((char *) InP->functionName, (const char *) functionName, functionNameCnt);
++
++      InP->functionNameCnt = functionNameCnt;
++
++      msgh_size_delta = _WALIGN_(functionNameCnt);
++      msgh_size = (sizeof(Request) - 4096) + msgh_size_delta;
++      InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
++
++      if (fileNameCnt > 1024) {
++              { return MIG_ARRAY_TOO_LARGE; }
++      }
++      (void)memcpy((char *) InP->fileName, (const char *) fileName, fileNameCnt);
++
++      InP->fileNameCnt = fileNameCnt;
++
++      msgh_size_delta = _WALIGN_(fileNameCnt);
++      msgh_size += msgh_size_delta;
++      InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
++
++      if (directoryCnt > 1024) {
++              { return MIG_ARRAY_TOO_LARGE; }
++      }
++      (void)memcpy((char *) InP->directory, (const char *) directory, directoryCnt);
++
++      InP->directoryCnt = directoryCnt;
++
++      msgh_size_delta = _WALIGN_(directoryCnt);
++      msgh_size += msgh_size_delta;
++      InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024);
++
++      InP->line = line;
++
++      if (messageCnt > 1024) {
++              { return MIG_ARRAY_TOO_LARGE; }
++      }
++      (void)memcpy((char *) InP->message, (const char *) message, messageCnt);
++
++      InP->messageCnt = messageCnt;
++
++      msgh_size += _WALIGN_(messageCnt);
++      InP = &Mess.In;
++      InP->Head.msgh_bits =
++              MACH_MSGH_BITS(19, 0);
++      /* msgh_size passed as argument */
++      InP->Head.msgh_request_port = makePort;
++      InP->Head.msgh_reply_port = MACH_PORT_NULL;
++      InP->Head.msgh_id = 101;
++
++      __BeforeSendSimple(101, "alert")
++      msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, msgh_size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
++      __AfterSendSimple(101, "alert")
++              return msg_result;
++    }
++}
+--- ar/contents.c      30 Apr 2002 07:37:17 -0000      1.1.1.1
++++ ar/contents.c      7 Sep 2003 08:55:11 -0000
+@@ -76,7 +76,6 @@
+ #include <fcntl.h>
+ #include <stdio.h>
+ #include <string.h>
+-#include <tzfile.h>
+ #include <unistd.h>
+ #include "archive.h"
+@@ -103,12 +102,14 @@
+               else if (!(file = files(argv)))
+                       goto next;
+               if (options & AR_V) {
++/*
+                       (void)strmode(chdr.mode, buf);
+                       (void)printf("%s %6d/%-6d %8qd ",
+                           buf + 1, chdr.uid, chdr.gid, chdr.size);
+                       tp = localtime(&chdr.date);
+                       (void)strftime(buf, sizeof(buf), "%b %e %H:%M %Y", tp);
+                       (void)printf("%s %s\n", buf, file);
++*/
+               } else
+                       (void)printf("%s\n", file);
+               if (!all && !*argv)
+--- ar/misc.c  30 Apr 2002 07:37:17 -0000      1.1.1.1
++++ ar/misc.c  7 Sep 2003 08:55:11 -0000
+@@ -68,6 +68,7 @@
+ #endif /* not lint */
+ #include <sys/param.h>
++#define EFTYPE          79              /* Inappropriate file type or format */
+ #include <dirent.h>
+ #include <err.h>
+--- ar/vers_string     Sun Sep  7 01:55:10 2003
++++ ar/vers_string     Sun Sep  7 01:53:23 2003
+@@ -0,0 +1,125 @@
++#!/bin/sh
++##
++# Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
++#
++# @APPLE_LICENSE_HEADER_START@
++# 
++# "Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
++# Reserved.  This file contains Original Code and/or Modifications of
++# Original Code as defined in and that are subject to the Apple Public
++# Source License Version 1.0 (the 'License').  You may not use this file
++# except in compliance with the License.  Please obtain a copy of the
++# License at http://www.apple.com/publicsource and read it before using
++# this file.
++# 
++# The Original Code and all software distributed under the License are
++# distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
++# EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
++# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
++# FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
++# License for the specific language governing rights and limitations
++# under the License."
++# 
++# @APPLE_LICENSE_HEADER_END@
++##
++#
++# vers_string PROGRAM [STAMPED_NAME]
++#
++# Output a string suitable for use as a version identifier
++#
++
++##
++# Usage
++##
++
++program=$(basename $0);
++
++usage ()
++{
++    echo "Usage: ${program} [<options>] <program> [<stamped_name>]";
++    echo "    <program>: ???";
++    echo "    <stamped_name>: ???";
++    echo "Options: ???";
++}
++
++##
++# Handle command line
++##
++
++  Date=$(date);
++Format=''\''PROGRAM:'\''"${Program}"'\''  PROJECT:'\''"${Version}"'\''  DEVELOPER:'\''"${USER}"'\''  BUILT:'\''"${Date}"'\'''\''';
++
++if ! args=$(getopt cflBn $*); then usage; fi;
++set -- ${args};
++for option; do
++    case "${option}" in
++      -c)
++        Format=''\''#include <sys/cdefs.h>
++#ifndef __IDSTRING
++#define __IDSTRING(name,string) \
++     static const char name[] __attribute__((__unused__)) = string
++#endif
++__IDSTRING(SGS_VERS,"@(#)PROGRAM:'\''"${Program}"'\''  PROJECT:'\''"${Version}"'\''  DEVELOPER:'\''"${USER}"'\''  BUILT:'\''"${Date}"'\''\n");
++__IDSTRING(VERS_NUM,"'\''${Revision}'\''");'\''';
++      shift;
++      ;;
++      -f)
++        Format='"${Program}"'\''-'\''"${Revision}"';
++      shift;
++      ;;
++      -l)
++        Format=''\''#include <sys/cdefs.h>
++#ifndef __IDSTRING
++#define __IDSTRING(name,string) \
++      const char name[] __attribute__((__unused__)) = string
++#endif
++__IDSTRING(SGS_VERS,"@(#)LIBRARY:'\''"${Program}"'\''  PROJECT:'\''"${Version}"'\''  DEVELOPER:'\''"${USER}"'\''  BUILT:'\''"${Date}"'\''\n");'\''';
++      shift;
++      ;;
++      -B)
++        date="NO DATE SET (-B used)";
++      shift;
++      ;;
++      -n)
++        Format='"${Revision}"';
++      shift;
++      ;;
++      --)
++      shift;
++      break;
++      ;;
++    esac;
++done;
++
++Program=$1; if [ $# != 0 ]; then shift; fi;
++Version=$1; if [ $# != 0 ]; then shift; fi;
++
++if [ $# != 0 ]; then usage; fi;
++
++if [ -z "${Program}" ]; then Program="Unknown"; fi;
++
++if [ -n "${Version}" ]; then
++    if ! Revision=$(expr "${Version}" : '.*-\(.*\)'); then
++      echo "${program}: No hyphen in project root ${Version}" >&2
++      exit 1;
++    fi;
++else
++    CurrentDir=$(/bin/pwd);
++       Version=$(basename "${CurrentDir}");
++    while [ "${Version}" != "${CurrentDir}" ]; do
++      if Revision=$(expr "${Version}" : '.*-\(.*\)'); then break; fi;
++      CurrentDir=$(dirname  "${CurrentDir}");
++         Version=$(basename "${CurrentDir}");
++    done;
++    if [ "${Version}" = "${CurrentDir}" ]; then
++      CurrentDir=$(/bin/pwd);
++      echo "${program}: No hyphen in project root ${CurrentDir}" >&2
++      echo "${program}: Could not determine version" >&2
++       Version="Unknown";
++      Revision="";
++    fi;
++fi;
++
++if [ -z "${USER}" ]; then USER=$(whoami); fi;
++
++echo "$(eval echo "${Format}")";
+--- ar/Makefile        7 Sep 2002 01:27:09 -0000       1.1.1.2
++++ ar/Makefile        7 Sep 2003 09:03:52 -0000
+@@ -2,12 +2,16 @@
+ ifeq "mwccppc" "$(notdir $(CC))"
+   CFLAGS = -g $(OFLAG) -I$(SRCROOT)/../include
+ else
+-  CFLAGS = -g $(OFLAG) -Wall -Wno-precomp -I$(SRCROOT)/../include
++  ifeq "Linux" "$(shell uname)"
++    CFLAGS = -Wall $(X_CFLAGS) -D__LITTLE_ENDIAN__ -U__BIG_ENDIAN__  -D__ppc__ -I/usr/include -I../../macosx-include -I../include
++  else
++    CFLAGS = -g $(OFLAG) -Wall -Wno-precomp -I$(SRCROOT)/../include
++  endif
+ endif
+ LIBSTUFF = -L$(SYMROOT)/../libstuff -lstuff
+-USE_DEPENDENCY_FILE := $(shell if [ "$(notdir $(CC))" != "mwccppc" ]; then \
++USE_DEPENDENCY_FILE := $(shell if [ `uname` != "Linux" ] && [ "$(notdir $(CC))" != "mwccppc" ]; then \
+            echo YES ; else echo NO ; \
+            fi; )
+@@ -43,7 +47,8 @@
+       $(CC) $(CFLAGS) $(RC_CFLAGS) -o $(SYMROOT)/$@ $(OBJS) $(LIBSTUFF)
+ vers.c:
+-      vers_string -c $(VERS_STRING_FLAGS) $(PRODUCT) > $(OFILE_DIR)/$@
++      chmod +x vers_string
++      ./vers_string -c $(VERS_STRING_FLAGS) $(PRODUCT) > $(OFILE_DIR)/$@
+ ifeq "NO" "$(USE_DEPENDENCY_FILE)"
+ .c.o:
+--- ld/fake-mach.c     Sun Sep  7 14:13:57 2003
++++ ld/fake-mach.c     Sun Sep  7 14:13:50 2003
+@@ -0,0 +1,163 @@
 +/** fake-mach.c - A half baked implementation of mach kernel functions using the POSIX UNIX API.
 +*
 +* This was used to port Apple's Darwin linker (ld) to Linux. This allows Mac OS X applications to
@@ -975,20 +2163,22 @@ diff -rub ./misc/Makefile ./misc/Makefile
 +kern_return_t map_fd( int fd, vm_offset_t offset, vm_offset_t *va, boolean_t findspace, vm_size_t size)
 +{
 +      void* space = NULL;
++      int bytes = 0;
 +
 +      assert( fd > 0 );
 +      assert( offset == 0 );
 +      //~ assert( *va == 0 );
 +      assert( findspace == TRUE );
 +      
-+      //~ // Allocate memory
-+      //~ space = malloc( size );
-+      //~ assert( space != NULL );
-+      
-+      //~ // Read file into space
-+      //~ bytes = read( fd, space, size );
-+      //~ assert( bytes == size );
++      // Allocate memory
++      space = malloc( size );
++      assert( space != NULL );
 +      
++      // Read file into space
++      while(bytes < size) bytes += read( fd, ((char*)space) + bytes, size - bytes);
++      assert( bytes == size );
++
++      /*
 +      space = mmap( (void*) offset, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 );
 +      // No permission: try to make it read only
 +      if ( space == (void*) -1 && errno == EACCES )
@@ -996,7 +2186,8 @@ diff -rub ./misc/Makefile ./misc/Makefile
 +              space = mmap( (void*) offset, size, PROT_READ, MAP_SHARED, fd, 0 );
 +      }
 +      assert( space != NULL && space != (void*) -1 );
-+      
++      */
++
 +      // Copy back the pointer
 +      *va = (vm_offset_t) space;
 +      
@@ -1100,4 +2291,54 @@ diff -rub ./misc/Makefile ./misc/Makefile
 +      //~ assert( 0 );
 +      return KERN_SUCCESS;
 +}
-\ No newline at end of file
+--- ar/archive.c       30 Apr 2002 07:37:17 -0000      1.1.1.1
++++ ar/archive.c       8 Sep 2003 00:44:40 -0000
+@@ -69,6 +69,7 @@
+ #include <sys/param.h>
+ #include <sys/stat.h>
++#include <stuff/ofile.h>
+ #include <ar.h>
+ #include <dirent.h>
+@@ -262,27 +263,37 @@
+                */
+               lname = strlen(name);
+               if (options & AR_TR) {
++                char buf[16];
++                int i;
++                for(i=0; i<15; i++) buf[i] = ' ';
++                buf[15] = '\0';
+                       if (lname > OLDARMAXNAME) {
+                               (void)fflush(stdout);
+                               warnx("warning: %s truncated to %.*s",
+                                   name, OLDARMAXNAME, name);
+                               (void)fflush(stderr);
+                       }
+-                      (void)sprintf(hb, HDR3, name, (long int)sb->st_mtimespec.tv_sec,
++                strncpy(buf, name, 15);
++                      (void)sprintf(hb, HDR3, buf, (long int)sb->st_mtime,
+                           (unsigned int)(u_short)sb->st_uid,
+                           (unsigned int)(u_short)sb->st_gid,
+                           sb->st_mode, sb->st_size, ARFMAG);
+                       lname = 0;
+               } else if (lname > sizeof(hdr->ar_name) || strchr(name, ' '))
+                       (void)sprintf(hb, HDR1, AR_EFMT1, (lname + 3) & ~3,
+-                          (long int)sb->st_mtimespec.tv_sec,
++                          (long int)sb->st_mtime,
+                           (unsigned int)(u_short)sb->st_uid,
+                           (unsigned int)(u_short)sb->st_gid,
+                           sb->st_mode, sb->st_size + ((lname + 3) & ~3),
+                           ARFMAG);
+               else {
++                char buf[17];
++                int i;
++                for(i=0; i<16; i++) buf[i] = ' ';
++                buf[16] = '\0';
++                strncpy(buf, name, 16);
+                       lname = 0;
+-                      (void)sprintf(hb, HDR2, name, (long int)sb->st_mtimespec.tv_sec,
++                      (void)sprintf(hb, HDR2, buf, (long int)sb->st_mtime,
+                           (unsigned int)(u_short)sb->st_uid,
+                           (unsigned int)(u_short)sb->st_gid,
+                           sb->st_mode, sb->st_size, ARFMAG);