uclibc: remove unused legacy patches

This commit is contained in:
Peter Korsgaard 2008-03-27 10:23:03 +00:00
parent 9c078e173a
commit 9e0fe4b885
8 changed files with 0 additions and 19650 deletions

View File

@ -1,327 +0,0 @@
--- uClibc-0.9.28/Makefile.orig 2006-12-11 21:06:42.000000000 -0700
+++ uClibc-0.9.28/Makefile 2006-12-11 21:06:53.000000000 -0700
@@ -158,7 +158,7 @@
$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)lib
$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
-$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)lib/
- if [ "$(KERNEL_SOURCE)" == "$(DEVEL_PREFIX)" ] ; then \
+ if [ "$(KERNEL_SOURCE)" = "$(DEVEL_PREFIX)" ] ; then \
extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
else \
extra_exclude="" ; \
--- uClibc-0.9.28/extra/scripts/fix_includes.sh.orig 2006-12-13 05:44:21.000000000 -0700
+++ uClibc-0.9.28/extra/scripts/fix_includes.sh 2006-12-13 05:44:35.000000000 -0700
@@ -1,183 +1,155 @@
#!/bin/sh
-# Copyright (C) 2003 Erik Andersen <andersen@uclibc.org>
#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later
-# version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General
-# Public License along with this program; if not, write to the
-# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
-# Boston, MA 02111-1307 USA
-
-usage () {
- echo ""
- echo "usage: "`basename $0`" -k KERNEL_SOURCE_DIRECTORY -t TARGET_ARCH"
- echo ""
- echo "This utility scans the KERNEL_SOURCE_DIRECTORY directory and"
- echo "checks that it contains well formed kernel headers suitable"
- echo "for inclusion as the include/linux/ directory provided by"
- echo "uClibc."
- echo ""
- echo "If the specified kernel headers are present and already"
- echo "configured for the architecture specified by TARGET_ARCH,"
- echo "they will be used as-is."
- echo ""
- echo "If the specified kernel headers are missing entirely, this"
- echo "script will return an error."
- echo ""
- echo "If the specified kernel headers are present, but are either"
- echo "not yet configured or are configured for an architecture"
- echo "different than that specified by TARGET_ARCH, this script"
- echo "will attempt to 'fix' the kernel headers and make them"
- echo "suitable for use by uClibc. This fixing process may fail."
- echo "It is therefore best to always provide kernel headers that"
- echo "are already configured for the selected architecture."
- echo ""
- echo "Most Linux distributions provide 'kernel-headers' packages"
- echo "that are suitable for use by uClibc."
- echo ""
- echo ""
- exit 1;
+# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+usage() {
+ echo ""
+ echo "usage: "`basename $0`" -k KERNEL_SOURCE_DIRECTORY -t TARGET_ARCH"
+ echo ""
+ echo "This utility scans the KERNEL_SOURCE_DIRECTORY directory and"
+ echo "checks that it contains well formed kernel headers suitable"
+ echo "for inclusion as the include/linux/ directory provided by"
+ echo "uClibc."
+ echo ""
+ echo "If the specified kernel headers are present and already"
+ echo "configured for the architecture specified by TARGET_ARCH,"
+ echo "they will be used as-is."
+ echo ""
+ echo "If the specified kernel headers are missing entirely, this"
+ echo "script will return an error."
+ echo ""
+ echo "If the specified kernel headers are present, but are either"
+ echo "not yet configured or are configured for an architecture"
+ echo "different than that specified by TARGET_ARCH, this script"
+ echo "will attempt to 'fix' the kernel headers and make them"
+ echo "suitable for use by uClibc. This fixing process may fail."
+ echo "It is therefore best to always provide kernel headers that"
+ echo "are already configured for the selected architecture."
+ echo ""
+ echo "Most Linux distributions provide 'kernel-headers' packages"
+ echo "that are suitable for use by uClibc."
+ echo ""
+ echo ""
+ exit 1
}
-HAS_MMU="y";
+
+#
+# Parse our arguments
+#
+HAS_MMU="y"
while [ -n "$1" ]; do
- case $1 in
- -k ) shift; if [ -n "$1" ]; then KERNEL_SOURCE=$1; shift; else usage; fi; ;;
- -t ) shift; if [ -n "$1" ]; then TARGET_ARCH=$1; shift; else usage; fi; ;;
- -n ) shift; HAS_MMU="n"; ;;
- -* ) usage; ;;
- * ) usage; ;;
- esac;
-done;
+ case $1 in
+ -k ) shift; if [ -n "$1" ]; then KERNEL_SOURCE=$1; shift; else usage; fi; ;;
+ -t ) shift; if [ -n "$1" ]; then TARGET_ARCH=$1; shift; else usage; fi; ;;
+ -n ) shift; HAS_MMU="n"; ;;
+ -* ) usage; ;;
+ * ) usage; ;;
+ esac
+done
-if [ ! -f "$KERNEL_SOURCE/Makefile" -a ! -f "$KERNEL_SOURCE/include/linux/version.h" ]; then
- echo "";
- echo "";
- echo "The file $KERNEL_SOURCE/Makefile or $KERNEL_SOURCE/include/linux/version.h is missing!";
- echo "Perhaps your kernel source is broken?"
- echo "";
- echo "";
- exit 1;
-fi;
-if [ ! -d "$KERNEL_SOURCE" ]; then
- echo "";
- echo "";
- echo "$KERNEL_SOURCE is not a directory";
- echo "";
- echo "";
- exit 1;
-fi;
-
-if [ -f "$KERNEL_SOURCE/Makefile" ] ; then
-# set current VERSION, PATCHLEVEL, SUBLEVEL, EXTRAVERSION
-eval `sed -n -e 's/^\([A-Z]*\) = \([0-9]*\)$/\1=\2/p' -e 's/^\([A-Z]*\) = \(-[-a-z0-9]*\)$/\1=\2/p' $KERNEL_SOURCE/Makefile`
-else
-ver=`grep UTS_RELEASE $KERNEL_SOURCE/include/linux/version.h | cut -d '"' -f 2`
-VERSION=`echo "$ver" | cut -d '.' -f 1`
-PATCHLEVEL=`echo "$ver" | cut -d '.' -f 2`
-if echo "$ver" | grep -q '-' ; then
-SUBLEVEL=`echo "$ver" | sed "s/${VERSION}.${PATCHLEVEL}.//" | cut -d '-' -f 1`
-EXTRAVERSION=`echo "$ver" | sed "s/${VERSION}.${PATCHLEVEL}.${SUBLEVEL}-//"`
-else
-SUBLEVEL=`echo "$ver" | cut -d '.' -f 3`
-#EXTRAVERSION=
-fi
+#
+# Perform some sanity checks on our kernel sources
+#
+if [ ! -f "$KERNEL_SOURCE/Makefile" -a ! -f "$KERNEL_SOURCE/include/linux/version.h" ]; then
+ echo ""
+ echo ""
+ echo "The file $KERNEL_SOURCE/Makefile or $KERNEL_SOURCE/include/linux/version.h is missing!"
+ echo "Perhaps your kernel source is broken?"
+ echo ""
+ echo ""
+ exit 1
fi
-if [ -z "$VERSION" -o -z "$PATCHLEVEL" -o -z "$SUBLEVEL" ]
-then
- echo "Unable to determine version for kernel headers"
- echo -e "\tprovided in directory $KERNEL_SOURCE"
- exit 1
+if [ ! -d "$KERNEL_SOURCE" ]; then
+ echo ""
+ echo ""
+ echo "$KERNEL_SOURCE is not a directory"
+ echo ""
+ echo ""
+ exit 1
fi
-if [ "$MAKE_IS_SILENT" != "y" ]; then
-echo "Current kernel version is $VERSION.$PATCHLEVEL.$SUBLEVEL${EXTRAVERSION}"
-echo -e "\n"
-echo "Using kernel headers from $VERSION.$PATCHLEVEL.$SUBLEVEL${EXTRAVERSION} for architecture '$TARGET_ARCH'"
-echo -e "\tprovided in directory $KERNEL_SOURCE"
-echo -e "\n"
-fi
+#
# Create a symlink to include/asm
-
+#
rm -f include/asm*
if [ ! -d "$KERNEL_SOURCE/include/asm" ]; then
- echo "";
- echo "";
- echo "The symlink $KERNEL_SOURCE/include/asm is missing\!";
- echo "Perhaps you forgot to configure your kernel source?";
- echo "You really should configure your kernel source tree so I";
- echo "do not have to try and guess about this sort of thing.";
- echo ""
- echo "Attempting to guess a usable value....";
- echo ""
- echo "";
- sleep 1;
-
- if [ "$TARGET_ARCH" = "powerpc" ];then
- set -x;
- ln -fs $KERNEL_SOURCE/include/asm-ppc include/asm;
- set +x;
- elif [ "$TARGET_ARCH" = "mips" ];then
- set -x;
- ln -fs $KERNEL_SOURCE/include/asm-mips include/asm;
- set +x;
- elif [ "$TARGET_ARCH" = "arm" ];then
- set -x;
- ln -fs $KERNEL_SOURCE/include/asm-arm include/asm;
- set +x;
- if [ ! -L $KERNEL_SOURCE/include/asm-arm/proc ] ; then
- if [ ! -L proc ] ; then
- (cd include/asm;
- ln -fs proc-armv proc;
- ln -fs arch-ebsa285 arch);
- fi
+ echo ""
+ echo ""
+ echo "The symlink $KERNEL_SOURCE/include/asm is missing\!"
+ echo "Perhaps you forgot to configure your kernel source?"
+ echo "You really should configure your kernel source tree so I"
+ echo "do not have to try and guess about this sort of thing."
+ echo ""
+ echo "Attempting to guess a usable value...."
+ echo ""
+ echo ""
+ sleep 1
+
+ if [ "$TARGET_ARCH" = "powerpc" ]; then
+ set -x
+ ln -fs $KERNEL_SOURCE/include/asm-ppc include/asm
+ set +x
+ elif [ "$TARGET_ARCH" = "mips" ]; then
+ set -x
+ ln -fs $KERNEL_SOURCE/include/asm-mips include/asm
+ set +x
+ elif [ "$TARGET_ARCH" = "arm" ]; then
+ set -x
+ ln -fs $KERNEL_SOURCE/include/asm-arm include/asm
+ set +x
+ if [ ! -L $KERNEL_SOURCE/include/asm-arm/proc ]; then
+ if [ ! -L proc ]; then
+ (
+ cd include/asm
+ ln -fs proc-armv proc
+ ln -fs arch-ebsa285 arch
+ )
+ fi
+ fi
+ elif [ "$TARGET_ARCH" = "cris" ]; then
+ set -x
+ ln -fs $KERNEL_SOURCE/include/asm-cris include/asm
+ set +x
+ elif [ "$HAS_MMU" != "y" ]; then
+ if [ -d $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu ]; then
+ set -x
+ ln -fs $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu include/asm
+ set +x
+ else
+ set -x
+ ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm
+ set +x
+ fi
+ else
+ set -x
+ ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm
+ set +x
fi;
- elif [ "$TARGET_ARCH" = "cris" ]; then
- set -x;
- ln -fs $KERNEL_SOURCE/include/asm-cris include/asm;
- set +x;
- elif [ "$HAS_MMU" != "y" ]; then
- if [ -d $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu ] ; then
- set -x;
- ln -fs $KERNEL_SOURCE/include/asm-${TARGET_ARCH}nommu include/asm;
- set +x;
- else
- set -x;
- ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm;
- set +x;
- fi;
- else
- set -x;
- ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm;
- set +x;
- fi;
else
-# No guessing required.....
-ln -fs $KERNEL_SOURCE/include/asm include/asm
-if [ -e $KERNEL_SOURCE/include/asm-$TARGET_ARCH ] ; then
-ln -fs $KERNEL_SOURCE/include/asm-$TARGET_ARCH include/asm-$TARGET_ARCH
+ # No guessing required.....
+ for x in $KERNEL_SOURCE/include/asm* ; do
+ ln -fs ${x} include/
+ done
fi
-fi;
+#
# Annoyingly, 2.6.x kernel headers also need an include/asm-generic/ directory
-if [ $VERSION -eq 2 ] && [ $PATCHLEVEL -ge 6 ] ; then
- ln -fs $KERNEL_SOURCE/include/asm-generic include/asm-generic
-fi;
+#
+if [ -e $KERNEL_SOURCE/include/asm-generic ]; then
+ rm -f include/asm-generic
+ ln -fs $KERNEL_SOURCE/include/asm-generic include/asm-generic
+fi
+#
# Create the include/linux symlink.
+#
rm -f include/linux
ln -fs $KERNEL_SOURCE/include/linux include/linux
-

View File

@ -1,635 +0,0 @@
This patch supports cross-development for embedded systems by allowing the
host version of ldconfig (ldconfig.host) to build ld.so.cache for the target.
Changes include:
1) LDSO_CACHE_SUPPORT is defined for the host build.
2) A little-endian host can create a big-endian ld.so.cache, and vice versa.
3) Can use -r option without chroot(), so no need to run as superuser.
Dan Howell <dahowell@directv.com>
diff -urN uClibc-orig/utils/chroot_realpath.c uClibc-20050502/utils/chroot_realpath.c
--- uClibc-orig/utils/chroot_realpath.c 1969-12-31 16:00:00.000000000 -0800
+++ uClibc-20050502/utils/chroot_realpath.c 2005-09-12 18:30:29.000000000 -0700
@@ -0,0 +1,163 @@
+/*
+ * chroot_realpath.c -- reslove pathname as if inside chroot
+ * Based on realpath.c Copyright (C) 1993 Rick Sladkey <jrs@world.std.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library Public License for more details.
+ *
+ * 2005/09/12: Dan Howell (modified from realpath.c to emulate chroot)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <sys/types.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <strings.h>
+#include <limits.h> /* for PATH_MAX */
+#include <sys/param.h> /* for MAXPATHLEN */
+#include <errno.h>
+#ifndef __set_errno
+#define __set_errno(val) ((errno) = (val))
+#endif
+
+#include <sys/stat.h> /* for S_IFLNK */
+
+#ifndef PATH_MAX
+#define PATH_MAX _POSIX_PATH_MAX
+#endif
+
+#define MAX_READLINKS 32
+
+char *chroot_realpath(const char *chroot, const char *path, char resolved_path[])
+{
+ char copy_path[PATH_MAX];
+ char link_path[PATH_MAX];
+ char got_path[PATH_MAX];
+ char *got_path_root = got_path;
+ char *new_path = got_path;
+ char *max_path;
+ int readlinks = 0;
+ int n;
+ int chroot_len;
+
+ /* Trivial case. */
+ if (chroot == NULL || *chroot == '\0' ||
+ (*chroot == '/' && chroot[1] == '\0')) {
+ strcpy(resolved_path, path);
+ return resolved_path;
+ }
+
+ chroot_len = strlen(chroot);
+
+ if (chroot_len + strlen(path) >= PATH_MAX - 3) {
+ __set_errno(ENAMETOOLONG);
+ return NULL;
+ }
+
+ /* Make a copy of the source path since we may need to modify it. */
+ strcpy(copy_path, path);
+ path = copy_path;
+ max_path = copy_path + PATH_MAX - chroot_len - 3;
+
+ /* Start with the chroot path. */
+ strcpy(new_path, chroot);
+ new_path += chroot_len;
+ while (*new_path == '/' && new_path > got_path)
+ new_path--;
+ got_path_root = new_path;
+ *new_path++ = '/';
+
+ /* Expand each slash-separated pathname component. */
+ while (*path != '\0') {
+ /* Ignore stray "/". */
+ if (*path == '/') {
+ path++;
+ continue;
+ }
+ if (*path == '.') {
+ /* Ignore ".". */
+ if (path[1] == '\0' || path[1] == '/') {
+ path++;
+ continue;
+ }
+ if (path[1] == '.') {
+ if (path[2] == '\0' || path[2] == '/') {
+ path += 2;
+ /* Ignore ".." at root. */
+ if (new_path == got_path_root + 1)
+ continue;
+ /* Handle ".." by backing up. */
+ while ((--new_path)[-1] != '/');
+ continue;
+ }
+ }
+ }
+ /* Safely copy the next pathname component. */
+ while (*path != '\0' && *path != '/') {
+ if (path > max_path) {
+ __set_errno(ENAMETOOLONG);
+ return NULL;
+ }
+ *new_path++ = *path++;
+ }
+ if (*path == '\0')
+ /* Don't follow symlink for last pathname component. */
+ break;
+#ifdef S_IFLNK
+ /* Protect against infinite loops. */
+ if (readlinks++ > MAX_READLINKS) {
+ __set_errno(ELOOP);
+ return NULL;
+ }
+ /* See if latest pathname component is a symlink. */
+ *new_path = '\0';
+ n = readlink(got_path, link_path, PATH_MAX - 1);
+ if (n < 0) {
+ /* EINVAL means the file exists but isn't a symlink. */
+ if (errno != EINVAL) {
+ /* Make sure it's null terminated. */
+ *new_path = '\0';
+ strcpy(resolved_path, got_path);
+ return NULL;
+ }
+ } else {
+ /* Note: readlink doesn't add the null byte. */
+ link_path[n] = '\0';
+ if (*link_path == '/')
+ /* Start over for an absolute symlink. */
+ new_path = got_path_root;
+ else
+ /* Otherwise back up over this component. */
+ while (*(--new_path) != '/');
+ /* Safe sex check. */
+ if (strlen(path) + n >= PATH_MAX - 2) {
+ __set_errno(ENAMETOOLONG);
+ return NULL;
+ }
+ /* Insert symlink contents into path. */
+ strcat(link_path, path);
+ strcpy(copy_path, link_path);
+ path = copy_path;
+ }
+#endif /* S_IFLNK */
+ *new_path++ = '/';
+ }
+ /* Delete trailing slash but don't whomp a lone slash. */
+ if (new_path != got_path + 1 && new_path[-1] == '/')
+ new_path--;
+ /* Make sure it's null terminated. */
+ *new_path = '\0';
+ strcpy(resolved_path, got_path);
+ return resolved_path;
+}
diff -urN uClibc-orig/utils/ldconfig.c uClibc-20050502/utils/ldconfig.c
--- uClibc-orig/utils/ldconfig.c 2005-05-01 23:10:12.000000000 -0700
+++ uClibc-20050502/utils/ldconfig.c 2005-09-16 19:26:33.000000000 -0700
@@ -22,6 +22,8 @@
*
* This program may be used for any purpose as long as this
* copyright notice is kept.
+ *
+ * 2005/09/16: Dan Howell (modified for cross-development)
*/
#include <stdio.h>
@@ -37,6 +39,7 @@
#include <errno.h>
#include <sys/stat.h>
#include <sys/mman.h>
+#include "bswap.h"
#include "dl-defs.h"
#define BUFFER_SIZE 4096
@@ -56,6 +59,7 @@
#if !defined (N_MAGIC)
#define N_MAGIC(exec) ((exec).a_info & 0xffff)
#endif
+#define N_MAGIC_SWAP(exec) (bswap_32((exec).a_info) & 0xffff)
/* Code indicating object file or impure executable. */
#define OMAGIC 0407
/* Code indicating pure executable. */
@@ -97,6 +101,8 @@
char *conffile = LDSO_CONF; /* default conf file */
char *cachefile = LDSO_CACHE; /* default cache file */
#endif
+char *chroot_dir = NULL;
+int byteswap = 0;
struct needed_tab
{
@@ -117,6 +123,8 @@
{ NULL, LIB_ELF }
};
+extern char *chroot_realpath(const char *chroot, const char *path, char resolved_path[]);
+
/* These two are used internally -- you shouldn't need to use them */
static void verror_msg(const char *s, va_list p)
@@ -242,6 +250,8 @@
ElfW(Ehdr) *elf_hdr;
struct stat statbuf;
char buff[BUFFER_SIZE];
+ char real[BUFFER_SIZE];
+ static int byteswapflag = -1; /* start with byte-order unknown */
/* see if name is of the form *.so* */
if (name[strlen(name)-1] != '~' && (cp = strstr(name, ".so")))
@@ -256,8 +266,12 @@
sprintf(buff, "%s%s%s", dir, (*dir && strcmp(dir, "/")) ?
"/" : "", name);
+ /* get real path in case of chroot */
+ if (!chroot_realpath(chroot_dir, buff, real))
+ warn("can't resolve %s in chroot %s", buff, chroot_dir);
+
/* first, make sure it's a regular file */
- if (lstat(buff, &statbuf))
+ if (lstat(real, &statbuf))
warn("skipping %s", buff);
else if (!S_ISREG(statbuf.st_mode) && !S_ISLNK(statbuf.st_mode))
warnx("%s is not a regular file or symlink, skipping", buff);
@@ -267,14 +281,15 @@
*islink = S_ISLNK(statbuf.st_mode);
/* then try opening it */
- if (!(file = fopen(buff, "rb")))
+ if (!(file = fopen(real, "rb")))
warn("skipping %s", buff);
else
{
/* now make sure it's a shared library */
if (fread(&exec, sizeof exec, 1, file) < 1)
warnx("can't read header from %s, skipping", buff);
- else if (N_MAGIC(exec) != ZMAGIC && N_MAGIC(exec) != QMAGIC)
+ else if (N_MAGIC(exec) != ZMAGIC && N_MAGIC(exec) != QMAGIC &&
+ N_MAGIC_SWAP(exec) != ZMAGIC && N_MAGIC_SWAP(exec) != QMAGIC)
{
elf_hdr = (ElfW(Ehdr) *) &exec;
if (elf_hdr->e_ident[0] != 0x7f ||
@@ -294,6 +309,9 @@
*type = LIB_ELF;
good = readsoname(buff, file, expected_type, type,
elf_hdr->e_ident[EI_CLASS]);
+ if (byteswapflag == -1)
+ /* byte-order detected */
+ byteswapflag = byteswap;
if (good == NULL || *islink)
{
if (good != NULL)
@@ -313,6 +331,12 @@
}
else
{
+ /* Determine byte-order */
+ byteswap = (N_MAGIC(exec) == ZMAGIC || N_MAGIC(exec) == QMAGIC) ? 0 : 1;
+ if (byteswapflag == -1)
+ /* byte-order detected */
+ byteswapflag = byteswap;
+
if (*islink)
good = xstrdup(name);
else
@@ -330,6 +354,14 @@
*type = LIB_DLL;
}
fclose(file);
+
+ if (byteswapflag >= 0 && byteswap != byteswapflag)
+ {
+ byteswapflag = -2;
+ warnx("mixed byte-order detected, using host byte-order...");
+ }
+ if (byteswapflag == -2)
+ byteswap = 0;
}
}
}
@@ -343,18 +375,24 @@
int change = 1;
char libname[BUFFER_SIZE];
char linkname[BUFFER_SIZE];
+ char reallibname[BUFFER_SIZE];
+ char reallinkname[BUFFER_SIZE];
struct stat libstat;
struct stat linkstat;
/* construct the full path names */
sprintf(libname, "%s/%s", dir, file);
sprintf(linkname, "%s/%s", dir, so);
+ if (!chroot_realpath(chroot_dir, libname, reallibname))
+ warn("can't resolve %s in chroot %s", libname, chroot_dir);
+ if (!chroot_realpath(chroot_dir, linkname, reallinkname))
+ warn("can't resolve %s in chroot %s", linkname, chroot_dir);
/* see if a link already exists */
- if (!stat(linkname, &linkstat))
+ if (!stat(reallinkname, &linkstat))
{
/* now see if it's the one we want */
- if (stat(libname, &libstat))
+ if (stat(reallibname, &libstat))
warn("can't stat %s", libname);
else if (libstat.st_dev == linkstat.st_dev &&
libstat.st_ino == linkstat.st_ino)
@@ -364,14 +402,14 @@
/* then update the link, if required */
if (change > 0 && !nolinks)
{
- if (!lstat(linkname, &linkstat))
+ if (!lstat(reallinkname, &linkstat))
{
if (!S_ISLNK(linkstat.st_mode))
{
warnx("%s is not a symlink", linkname);
change = -1;
}
- else if (remove(linkname))
+ else if (remove(reallinkname))
{
warn("can't unlink %s", linkname);
change = -1;
@@ -379,7 +417,7 @@
}
if (change > 0)
{
- if (symlink(file, linkname))
+ if (symlink(file, reallinkname))
{
warn("can't link %s to %s", linkname, file);
change = -1;
@@ -441,6 +479,7 @@
char *so, *path, *path_n;
struct lib *lp, *libs = NULL;
int i, libtype, islink, expected_type = LIB_ANY;
+ char realname[BUFFER_SIZE];
/* We need a writable copy of this string */
path = strdup(rawname);
@@ -500,8 +539,12 @@
if (verbose > 0)
printf("%s:\n", name);
+ /* get real path in case of chroot */
+ if (!chroot_realpath(chroot_dir, name, realname))
+ warn("can't resolve %s in chroot %s", name, chroot_dir);
+
/* if we can't open it, we can't do anything */
- if ((dir = opendir(name)) == NULL)
+ if ((dir = opendir(realname)) == NULL)
{
warn("skipping %s", name);
free(path);
@@ -596,8 +639,12 @@
char *res = NULL, *cp;
FILE *file;
struct stat stat;
+ char realconffile[BUFFER_SIZE];
+
+ if (!chroot_realpath(chroot_dir, conffile, realconffile))
+ return NULL;
- if ((file = fopen(conffile, "r")) != NULL)
+ if ((file = fopen(realconffile, "r")) != NULL)
{
fstat(fileno(file), &stat);
res = xmalloc(stat.st_size + 1);
@@ -678,22 +725,38 @@
{
int cachefd;
int stroffset = 0;
+ char realcachefile[BUFFER_SIZE];
char tempfile[BUFFER_SIZE];
+ header_t swap_magic;
+ header_t *magic_ptr;
+ libentry_t swap_lib;
+ libentry_t *lib_ptr;
liblist_t *cur_lib;
if (!magic.nlibs)
return;
- sprintf(tempfile, "%s~", cachefile);
+ if (!chroot_realpath(chroot_dir, cachefile, realcachefile))
+ err(EXIT_FATAL,"can't resolve %s in chroot %s (%s)",
+ cachefile, chroot_dir, strerror(errno));
+
+ sprintf(tempfile, "%s~", realcachefile);
if (unlink(tempfile) && errno != ENOENT)
- err(EXIT_FATAL,"can't unlink %s (%s)", tempfile, strerror(errno));
+ err(EXIT_FATAL,"can't unlink %s~ (%s)", cachefile, strerror(errno));
if ((cachefd = creat(tempfile, 0644)) < 0)
- err(EXIT_FATAL,"can't create %s (%s)", tempfile, strerror(errno));
+ err(EXIT_FATAL,"can't create %s~ (%s)", cachefile, strerror(errno));
- if (write(cachefd, &magic, sizeof (header_t)) != sizeof (header_t))
- err(EXIT_FATAL,"can't write %s (%s)", tempfile, strerror(errno));
+ if (byteswap) {
+ swap_magic = magic;
+ swap_magic.nlibs = bswap_32(swap_magic.nlibs);
+ magic_ptr = &swap_magic;
+ } else {
+ magic_ptr = &magic;
+ }
+ if (write(cachefd, magic_ptr, sizeof (header_t)) != sizeof (header_t))
+ err(EXIT_FATAL,"can't write %s~ (%s)", cachefile, strerror(errno));
for (cur_lib = lib_head; cur_lib != NULL; cur_lib = cur_lib->next)
{
@@ -701,29 +764,37 @@
stroffset += strlen(cur_lib->soname) + 1;
cur_lib->liboffset = stroffset;
stroffset += strlen(cur_lib->libname) + 1;
- if (write(cachefd, cur_lib, sizeof (libentry_t)) !=
- sizeof (libentry_t))
- err(EXIT_FATAL,"can't write %s (%s)", tempfile, strerror(errno));
+ if (byteswap) {
+ swap_lib.flags = bswap_32(cur_lib->flags);
+ swap_lib.sooffset = bswap_32(cur_lib->sooffset);
+ swap_lib.liboffset = bswap_32(cur_lib->liboffset);
+ lib_ptr = &swap_lib;
+ } else {
+ lib_ptr = (libentry_t *)cur_lib;
+ }
+ if (write(cachefd, lib_ptr, sizeof (libentry_t)) !=
+ sizeof (libentry_t))
+ err(EXIT_FATAL,"can't write %s~ (%s)", cachefile, strerror(errno));
}
for (cur_lib = lib_head; cur_lib != NULL; cur_lib = cur_lib->next)
{
if (write(cachefd, cur_lib->soname, strlen(cur_lib->soname) + 1)
!= strlen(cur_lib->soname) + 1)
- err(EXIT_FATAL,"can't write %s (%s)", tempfile, strerror(errno));
+ err(EXIT_FATAL,"can't write %s~ (%s)", cachefile, strerror(errno));
if (write(cachefd, cur_lib->libname, strlen(cur_lib->libname) + 1)
!= strlen(cur_lib->libname) + 1)
- err(EXIT_FATAL,"can't write %s (%s)", tempfile, strerror(errno));
+ err(EXIT_FATAL,"can't write %s~ (%s)", cachefile, strerror(errno));
}
if (close(cachefd))
- err(EXIT_FATAL,"can't close %s (%s)", tempfile, strerror(errno));
+ err(EXIT_FATAL,"can't close %s~ (%s)", cachefile, strerror(errno));
if (chmod(tempfile, 0644))
- err(EXIT_FATAL,"can't chmod %s (%s)", tempfile, strerror(errno));
+ err(EXIT_FATAL,"can't chmod %s~ (%s)", cachefile, strerror(errno));
- if (rename(tempfile, cachefile))
- err(EXIT_FATAL,"can't rename %s (%s)", tempfile, strerror(errno));
+ if (rename(tempfile, realcachefile))
+ err(EXIT_FATAL,"can't rename %s~ (%s)", cachefile, strerror(errno));
}
void cache_print(void)
@@ -734,8 +805,13 @@
char *strs;
header_t *header;
libentry_t *libent;
+ char realcachefile[BUFFER_SIZE];
+
+ if (!chroot_realpath(chroot_dir, cachefile, realcachefile))
+ err(EXIT_FATAL,"can't resolve %s in chroot %s (%s)",
+ cachefile, chroot_dir, strerror(errno));
- if (stat(cachefile, &st) || (fd = open(cachefile, O_RDONLY))<0)
+ if (stat(realcachefile, &st) || (fd = open(realcachefile, O_RDONLY))<0)
err(EXIT_FATAL,"can't read %s (%s)", cachefile, strerror(errno));
if ((c = mmap(0,st.st_size, PROT_READ, MAP_SHARED ,fd, 0)) == (caddr_t)-1)
err(EXIT_FATAL,"can't map %s (%s)", cachefile, strerror(errno));
@@ -828,7 +904,6 @@
int nodefault = 0;
char *cp, *dir, *so;
int libtype, islink;
- char *chroot_dir = NULL;
int printcache = 0;
#ifdef __LDSO_CACHE_SUPPORT__
char *extpath;
@@ -891,10 +966,16 @@
}
if (chroot_dir && *chroot_dir) {
- if (chroot(chroot_dir) < 0)
- err(EXIT_FATAL,"couldn't chroot to %s (%s)", chroot_dir, strerror(errno));
- if (chdir("/") < 0)
- err(EXIT_FATAL,"couldn't chdir to / (%s)", strerror(errno));
+ if (chroot(chroot_dir) < 0) {
+ if (chdir(chroot_dir) < 0)
+ err(EXIT_FATAL,"couldn't chroot to %s (%s)", chroot_dir, strerror(errno));
+ }
+ else
+ {
+ if (chdir("/") < 0)
+ err(EXIT_FATAL,"couldn't chdir to / (%s)", strerror(errno));
+ chroot_dir = NULL;
+ }
}
/* allow me to introduce myself, hi, my name is ... */
diff -urN uClibc-orig/utils/Makefile uClibc-20050502/utils/Makefile
--- uClibc-orig/utils/Makefile 2005-05-01 23:10:12.000000000 -0700
+++ uClibc-20050502/utils/Makefile 2005-09-16 19:28:55.000000000 -0700
@@ -29,6 +29,12 @@
TARGET_ICONV =
endif
+ifeq ($(strip $(LDSO_CACHE_SUPPORT)),y)
+HOST_LDSO_CACHE_FLAG = -D__LDSO_CACHE_SUPPORT__=1
+else
+HOST_LDSO_CACHE_FLAG =
+endif
+
# NOTE: We build the utils AFTER we have a uClibc-targeted toolchain.
ifeq ($(strip $(HAVE_SHARED)),y)
@@ -51,7 +57,7 @@
else
LDCONFIG_CFLAGS := $(PIEFLAG) $(LDPIEFLAG)
endif
-ldconfig: ldconfig.c
+ldconfig: ldconfig.c chroot_realpath.c
$(CC) $(CFLAGS) $(LDCONFIG_CFLAGS) \
-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
-DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
@@ -79,13 +85,13 @@
ldd.host: ldd.c
$(HOSTCC) $(HOSTCFLAGS) -Wl,-s \
- -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
+ -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" $(HOST_LDSO_CACHE_FLAG) \
-DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
$^ -o $@
-ldconfig.host: ldconfig.c
+ldconfig.host: ldconfig.c chroot_realpath.c
$(HOSTCC) $(HOSTCFLAGS) -Wl,-s \
- -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
+ -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" $(HOST_LDSO_CACHE_FLAG) \
-DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
$^ -o $@
diff -urN uClibc-orig/utils/readsoname2.c uClibc-20050502/utils/readsoname2.c
--- uClibc-orig/utils/readsoname2.c 2005-05-01 23:10:12.000000000 -0700
+++ uClibc-20050502/utils/readsoname2.c 2005-09-16 17:48:59.000000000 -0700
@@ -26,7 +26,7 @@
if (fstat(fileno(infile), &st))
return NULL;
- header = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fileno(infile), 0);
+ header = mmap(0, st.st_size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fileno(infile), 0);
if (header == (caddr_t)-1)
return NULL;
@@ -34,6 +34,19 @@
if ((char *)(epnt+1) > (char *)(header + st.st_size))
goto skip;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ byteswap = (epnt->e_ident[5] == ELFDATA2MSB) ? 1 : 0;
+#elif __BYTE_ORDER == __BIG_ENDIAN
+ byteswap = (epnt->e_ident[5] == ELFDATA2LSB) ? 1 : 0;
+#else
+#error Unknown host byte order!
+#endif
+ /* Be very lazy, and only byteswap the stuff we use */
+ if (byteswap==1) {
+ epnt->e_phoff=bswap_32(epnt->e_phoff);
+ epnt->e_phnum=bswap_16(epnt->e_phnum);
+ }
+
ppnt = (ElfW(Phdr) *)&header[epnt->e_phoff];
if ((char *)ppnt < (char *)header ||
(char *)(ppnt+epnt->e_phnum) > (char *)(header + st.st_size))
@@ -41,6 +54,14 @@
for(i = 0; i < epnt->e_phnum; i++)
{
+ /* Be very lazy, and only byteswap the stuff we use */
+ if (byteswap==1) {
+ ppnt->p_type=bswap_32(ppnt->p_type);
+ ppnt->p_vaddr=bswap_32(ppnt->p_vaddr);
+ ppnt->p_offset=bswap_32(ppnt->p_offset);
+ ppnt->p_filesz=bswap_32(ppnt->p_filesz);
+ }
+
if (loadaddr == -1 && ppnt->p_type == PT_LOAD)
loadaddr = (ppnt->p_vaddr & ~(page_size-1)) -
(ppnt->p_offset & ~(page_size-1));
@@ -58,11 +79,20 @@
(char *)(dpnt+dynamic_size) > (char *)(header + st.st_size))
goto skip;
+ if (byteswap==1) {
+ dpnt->d_tag=bswap_32(dpnt->d_tag);
+ dpnt->d_un.d_val=bswap_32(dpnt->d_un.d_val);
+ }
+
while (dpnt->d_tag != DT_NULL)
{
if (dpnt->d_tag == DT_STRTAB)
strtab_val = dpnt->d_un.d_val;
dpnt++;
+ if (byteswap==1) {
+ dpnt->d_tag=bswap_32(dpnt->d_tag);
+ dpnt->d_un.d_val=bswap_32(dpnt->d_un.d_val);
+ }
};
if (!strtab_val)

File diff suppressed because it is too large Load Diff

View File

@ -1,247 +0,0 @@
Index: uclibc/libm/fp_private.h
===================================================================
--- uclibc/libm/fp_private.h (revision 12879)
+++ uclibc/libm/fp_private.h (working copy)
@@ -70,10 +70,11 @@
*******************************************************************************/
#include <stdint.h>
+#include <endian.h>
typedef struct /* Hex representation of a double. */
{
-#if defined(__BIG_ENDIAN__)
+#if (__BYTE_ORDER == __BIG_ENDIAN)
uint32_t high;
uint32_t low;
#else
Index: uclibc/libm/powerpc/s_ceil.c
===================================================================
--- uclibc/libm/powerpc/s_ceil.c (revision 12879)
+++ uclibc/libm/powerpc/s_ceil.c (working copy)
@@ -21,13 +21,15 @@
* *
*******************************************************************************/
+#include <endian.h>
+
static const double twoTo52 = 4503599627370496.0;
static const unsigned long signMask = 0x80000000ul;
typedef union
{
struct {
-#if defined(__BIG_ENDIAN__)
+#if (__BYTE_ORDER == __BIG_ENDIAN)
unsigned long int hi;
unsigned long int lo;
#else
Index: uclibc/libm/powerpc/s_ldexp.c
===================================================================
--- uclibc/libm/powerpc/s_ldexp.c (revision 12879)
+++ uclibc/libm/powerpc/s_ldexp.c (working copy)
@@ -21,11 +21,12 @@
#include <limits.h>
#include <math.h>
+#include <endian.h>
typedef union
{
struct {
-#if defined(__BIG_ENDIAN__)
+#if (__BYTE_ORDER == __BIG_ENDIAN)
unsigned long int hi;
unsigned long int lo;
#else
Index: uclibc/libm/powerpc/s_rint.c
===================================================================
--- uclibc/libm/powerpc/s_rint.c (revision 12879)
+++ uclibc/libm/powerpc/s_rint.c (working copy)
@@ -46,13 +46,14 @@
#include <limits.h>
#include <math.h>
+#include <endian.h>
#define SET_INVALID 0x01000000UL
typedef union
{
struct {
-#if defined(__BIG_ENDIAN__)
+#if (__BYTE_ORDER == __BIG_ENDIAN)
unsigned long int hi;
unsigned long int lo;
#else
Index: uclibc/libm/powerpc/s_floor.c
===================================================================
--- uclibc/libm/powerpc/s_floor.c (revision 12879)
+++ uclibc/libm/powerpc/s_floor.c (working copy)
@@ -21,13 +21,15 @@
* *
*******************************************************************************/
+#include <endian.h>
+
static const double twoTo52 = 4503599627370496.0;
static const unsigned long signMask = 0x80000000ul;
typedef union
{
struct {
-#if defined(__BIG_ENDIAN__)
+#if (__BYTE_ORDER == __BIG_ENDIAN)
unsigned long int hi;
unsigned long int lo;
#else
Index: uclibc/libm/powerpc/s_logb.c
===================================================================
--- uclibc/libm/powerpc/s_logb.c (revision 12879)
+++ uclibc/libm/powerpc/s_logb.c (working copy)
@@ -32,10 +32,12 @@
* Standard 754. *
*******************************************************************************/
+#include <endian.h>
+
typedef union
{
struct {
-#if defined(__BIG_ENDIAN__)
+#if (__BYTE_ORDER == __BIG_ENDIAN)
unsigned long int hi;
unsigned long int lo;
#else
Index: uclibc/libm/powerpc/s_frexp.c
===================================================================
--- uclibc/libm/powerpc/s_frexp.c (revision 12879)
+++ uclibc/libm/powerpc/s_frexp.c (working copy)
@@ -21,13 +21,14 @@
#include <limits.h>
#include <math.h>
+#include <endian.h>
static const double two54 = 1.80143985094819840000e+16; /* 0x43500000, 0x00000000 */
typedef union
{
struct {
-#if defined(__BIG_ENDIAN__)
+#if (__BYTE_ORDER == __BIG_ENDIAN)
unsigned long int hi;
unsigned long int lo;
#else
Index: uclibc/libm/powerpc/s_modf.c
===================================================================
--- uclibc/libm/powerpc/s_modf.c (revision 12879)
+++ uclibc/libm/powerpc/s_modf.c (working copy)
@@ -45,13 +45,14 @@
#include <limits.h>
#include <math.h>
+#include <endian.h>
#define SET_INVALID 0x01000000UL
typedef union
{
struct {
-#if defined(__BIG_ENDIAN__)
+#if (__BYTE_ORDER == __BIG_ENDIAN)
unsigned long int hi;
unsigned long int lo;
#else
Index: uclibc/libm/powerpc/w_scalb.c
===================================================================
--- uclibc/libm/powerpc/w_scalb.c (revision 12879)
+++ uclibc/libm/powerpc/w_scalb.c (working copy)
@@ -19,10 +19,12 @@
**
***********************************************************************/
+#include <endian.h>
+
typedef union
{
struct {
-#if defined(__BIG_ENDIAN__)
+#if (__BYTE_ORDER == __BIG_ENDIAN)
unsigned long int hi;
unsigned long int lo;
#else
Index: uclibc/libc/string/sh64/strcpy.S
===================================================================
--- uclibc/libc/string/sh64/strcpy.S (revision 12879)
+++ uclibc/libc/string/sh64/strcpy.S (working copy)
@@ -6,7 +6,9 @@
!
! SH5 code Copyright 2002 SuperH Ltd.
-#ifdef __LITTLE_ENDIAN__
+#include <endian.h>
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
#define SHHI shlld
#define SHLO shlrd
#else
@@ -67,7 +69,7 @@
add r5, r63, r4
addi r0, 8, r0
shortstring:
-#ifndef __LITTLE_ENDIAN__
+#if __BYTE_ORDER != __LITTLE_ENDIAN
pta/l shortstring2,tr1
byterev r4,r4
#endif
Index: uclibc/libc/string/sh64/memset.S
===================================================================
--- uclibc/libc/string/sh64/memset.S (revision 12879)
+++ uclibc/libc/string/sh64/memset.S (working copy)
@@ -9,7 +9,9 @@
! Copyright 2002 SuperH Ltd.
!
-#ifdef __LITTLE_ENDIAN__
+#include <endian.h>
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
#define SHHI shlld
#define SHLO shlrd
#else
Index: uclibc/libc/sysdeps/linux/sh/bits/kernel_stat.h
===================================================================
--- uclibc/libc/sysdeps/linux/sh/bits/kernel_stat.h (revision 12879)
+++ uclibc/libc/sysdeps/linux/sh/bits/kernel_stat.h (working copy)
@@ -30,10 +30,10 @@
};
struct kernel_stat64 {
-#if defined(__BIG_ENDIAN__)
+#if (__BYTE_ORDER == __BIG_ENDIAN)
unsigned char __pad0b[6];
unsigned short st_dev;
-#elif defined(__LITTLE_ENDIAN__)
+#elif (__BYTE_ORDER == __LITTLE_ENDIAN)
unsigned short st_dev;
unsigned char __pad0b[6];
#else
@@ -48,7 +48,7 @@
unsigned long st_uid;
unsigned long st_gid;
-#if defined(__BIG_ENDIAN__)
+#if (__BYTE_ORDER == __BIG_ENDIAN)
unsigned char __pad3b[6];
unsigned short st_rdev;
#else /* Must be little */
@@ -60,7 +60,7 @@
long long st_size;
unsigned long st_blksize;
-#if defined(__BIG_ENDIAN__)
+#if (__BYTE_ORDER == __BIG_ENDIAN)
unsigned long __pad4; /* Future possible st_blocks hi bits */
unsigned long st_blocks; /* Number 512-byte blocks allocated. */
#else /* Must be little */

File diff suppressed because it is too large Load Diff

View File

@ -1,101 +0,0 @@
--- uClibc/libc/misc/time/time.c (revision 16488)
+++ uClibc/libc/misc/time/time.c (working copy)
@@ -157,6 +157,22 @@
#define TZNAME_MAX _POSIX_TZNAME_MAX
#endif
+#if defined (L_tzset) || defined (L_localtime_r) || defined(L_strftime) || \
+ defined(L__time_mktime) || defined(L__time_mktime_tzi) || \
+ ((defined(L_strftime) || defined(L_strftime_l)) && \
+ defined(__UCLIBC_HAS_XLOCALE__))
+
+void _time_tzset (int);
+
+#ifndef L__time_mktime
+
+ /* Jan 1, 2007 Z - tm = 0,0,0,1,0,107,1,0,0 */
+
+const static time_t new_rule_starts = 1167609600;
+
+#endif
+#endif
+
/**********************************************************************/
/* The era code is currently unfinished. */
/* #define ENABLE_ERA_CODE */
@@ -532,7 +548,7 @@
{
__UCLIBC_MUTEX_LOCK(_time_tzlock);
- tzset();
+ _time_tzset(*timer < new_rule_starts);
__time_localtime_tzi(timer, result, _time_tzinfo);
@@ -956,7 +972,8 @@
unsigned char mod;
unsigned char code;
- tzset(); /* We'll, let's get this out of the way. */
+ /* We'll, let's get this out of the way. */
+ _time_tzset(_time_mktime((struct tm *) timeptr, 0) < new_rule_starts);
lvl = 0;
p = format;
@@ -1644,7 +1661,9 @@
6, 0, 0, /* Note: overloaded for non-M non-J case... */
0, 1, 0, /* J */
',', 'M', '4', '.', '1', '.', '0',
- ',', 'M', '1', '0', '.', '5', '.', '0', 0
+ ',', 'M', '1', '0', '.', '5', '.', '0', 0,
+ ',', 'M', '3', '.', '2', '.', '0',
+ ',', 'M', '1', '1', '.', '1', '.', '0', 0
};
#define TZ vals
@@ -1652,6 +1671,7 @@
#define RANGE (vals + 7)
#define RULE (vals + 11 - 1)
#define DEFAULT_RULES (vals + 22)
+#define DEFAULT_2007_RULES (vals + 38)
/* Initialize to UTC. */
int daylight = 0;
@@ -1774,6 +1794,11 @@
void tzset(void)
{
+ _time_tzset((time(NULL)) < new_rule_starts);
+}
+
+void _time_tzset(int use_old_rules)
+{
register const char *e;
register char *s;
long off;
@@ -1896,7 +1921,15 @@
} else { /* OK, we have dst, so get some rules. */
count = 0;
if (!*e) { /* No rules so default to US rules. */
- e = DEFAULT_RULES;
+ e = use_old_rules ? DEFAULT_RULES : DEFAULT_2007_RULES;
+#ifdef DEBUG_TZSET
+ if (e == DEFAULT_RULES)
+ printf("tzset: Using old rules.\n");
+ else if (e == DEFAULT_2007_RULES)
+ printf("tzset: Using new rules\n");
+ else
+ printf("tzset: Using undefined rules\n");
+#endif /* DEBUG_TZSET */
}
do {
@@ -2230,6 +2263,8 @@
--d;
}
+ _time_tzset (x.tm_year < 2007); /* tm_year was expanded above */
+
#ifdef __BCC__
d = p[5] - 1;
days = -719163L + ((long)d)*365 + ((d/4) - (d/100) + (d/400) + p[3] + p[7]);

View File

@ -1,86 +0,0 @@
diff -urN uClibc-0.9.29-0rig/include/assert.h uClibc-0.9.29/include/assert.h
--- uClibc-0.9.29-0rig/include/assert.h 2005-11-03 23:42:46.000000000 +0100
+++ uClibc-0.9.29/include/assert.h 2007-08-13 19:10:57.000000000 +0200
@@ -31,7 +31,7 @@
#define _ASSERT_H 1
#include <features.h>
-#if defined __cplusplus && __GNUC_PREREQ (2,95)
+#if defined __cplusplus && __GNUC_PREREQ(2,95)
# define __ASSERT_VOID_CAST static_cast<void>
#else
# define __ASSERT_VOID_CAST (void)
@@ -59,13 +59,17 @@
(__ASSERT_VOID_CAST ((expr) ? 0 : \
(__assert (__STRING(expr), __FILE__, __LINE__, \
__ASSERT_FUNCTION), 0)))
-
+
+/* Define some temporaries to workaround tinyx makedepend bug */
+#define __GNUC_PREREQ_2_6 __GNUC_PREREQ(2, 6)
+#define __GNUC_PREREQ_2_4 __GNUC_PREREQ(2, 4)
/* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
which contains the name of the function currently being defined.
This is broken in G++ before version 2.6.
C9x has a similar variable called __func__, but prefer the GCC one since
it demangles C++ function names. */
-# if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4)
+
+# if defined __cplusplus ? __GNUC_PREREQ_2_6 : __GNUC_PREREQ_2_4
# define __ASSERT_FUNCTION __PRETTY_FUNCTION__
# else
# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
diff -urN uClibc-0.9.29-0rig/include/complex.h uClibc-0.9.29/include/complex.h
--- uClibc-0.9.29-0rig/include/complex.h 2002-05-09 10:15:21.000000000 +0200
+++ uClibc-0.9.29/include/complex.h 2007-08-13 17:55:29.000000000 +0200
@@ -33,7 +33,7 @@
/* We might need to add support for more compilers here. But since ISO
C99 is out hopefully all maintained compilers will soon provide the data
types `float complex' and `double complex'. */
-#if __GNUC_PREREQ (2, 7) && !__GNUC_PREREQ (2, 97)
+#if __GNUC_PREREQ(2, 7) && !__GNUC_PREREQ(2, 97)
# define _Complex __complex__
#endif
diff -urN uClibc-0.9.29-0rig/include/features.h uClibc-0.9.29/include/features.h
--- uClibc-0.9.29-0rig/include/features.h 2006-11-29 22:10:04.000000000 +0100
+++ uClibc-0.9.29/include/features.h 2007-08-13 17:55:51.000000000 +0200
@@ -143,7 +143,7 @@
/* Convenience macros to test the versions of glibc and gcc.
Use them like this:
- #if __GNUC_PREREQ (2,8)
+ #if __GNUC_PREREQ(2,8)
... code requiring gcc 2.8 or later ...
#endif
Note - they won't work for gcc1 or glibc1, since the _MINOR macros
@@ -297,7 +297,7 @@
/* uClibc does not support _FORTIFY_SOURCE */
#undef _FORTIFY_SOURCE
#if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
- && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
+ && __GNUC_PREREQ(4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
# if _FORTIFY_SOURCE > 1
# define __USE_FORTIFY_LEVEL 2
# else
@@ -366,7 +366,7 @@
#endif /* !ASSEMBLER */
/* Decide whether we can define 'extern inline' functions in headers. */
-#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
+#if __GNUC_PREREQ(2, 7) && defined __OPTIMIZE__ \
&& !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__
# define __USE_EXTERN_INLINES 1
#endif
diff -urN uClibc-0.9.29-0rig/include/tgmath.h uClibc-0.9.29/include/tgmath.h
--- uClibc-0.9.29-0rig/include/tgmath.h 2002-05-09 10:15:21.000000000 +0200
+++ uClibc-0.9.29/include/tgmath.h 2007-08-13 17:56:17.000000000 +0200
@@ -34,7 +34,7 @@
do not try this for now and instead concentrate only on GNU CC. Once
we have more information support for other compilers might follow. */
-#if __GNUC_PREREQ (2, 7)
+#if __GNUC_PREREQ(2, 7)
# ifdef __NO_LONG_DOUBLE_MATH
# define __tgml(fct) fct

File diff suppressed because it is too large Load Diff