2003/09/07 10:04:15
[org.ibex.core.git] / upstream / darwin-linker / patches / cctools.patch
index 3c3fb20..498a051 100644 (file)
@@ -2095,3 +2095,232 @@ diff -bur ./symbols.h /home/megacz/xwt/upstream/darwin-linker/src/cctools/as/sym
 +              return msg_result;
 +    }
 +}
 +              return msg_result;
 +    }
 +}
+--- ar/archive.c       30 Apr 2002 07:37:17 -0000      1.1.1.1
++++ ar/archive.c       7 Sep 2003 08:55:11 -0000
+@@ -69,6 +69,7 @@
+ #include <sys/param.h>
+ #include <sys/stat.h>
++#include <stuff/ofile.h>
+ #include <ar.h>
+ #include <dirent.h>
+@@ -268,21 +269,21 @@
+                                   name, OLDARMAXNAME, name);
+                               (void)fflush(stderr);
+                       }
+-                      (void)sprintf(hb, HDR3, name, (long int)sb->st_mtimespec.tv_sec,
++                      (void)sprintf(hb, HDR3, name, (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 {
+                       lname = 0;
+-                      (void)sprintf(hb, HDR2, name, (long int)sb->st_mtimespec.tv_sec,
++                      (void)sprintf(hb, HDR2, name, (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);
+--- 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: