Article View: gnu.gcc.help
Article #52441A batch of patches for GNU libc 1.04.
From: Ronald F. Guilmette
Date: Wed, 23 Sep 1992 09:26
Date: Wed, 23 Sep 1992 09:26
1205 lines
37303 bytes
37303 bytes
I have seen numerous people report a variety of problems trying to
bring up GNU libc 1.04 on Sparcs (and other platforms) and believe
me when I say that I am sympathetic. I have had *all* of these
same problems myself.
The patches below seem to correct all of the build and installation
problems I experienced, however I am still experiencing a problem
with the start.c file for sparcs. In a nutshell, it doesn't seem
to work worth diddly. Programs linked with it seem to crash
mysteriously immediatly after the _start label. I haven't yet
had time to investigate further.
Many of these patches were gleened from the <bug-glibc@prep.ai.mit.edu>
mailing list, but many others are my own solutions to the innumerable
annoying and confusing problems I have encountered while trying to
just build this library.
I'm making them available in the hopes that I can save some other people
from the same agony that I went through to get this far.
One big problem appears to have been that Rolang McGrath must have been
using an unreleased pre-GCC-2.3 snapshot version of the GNU C compiler
when *he* built the library. Unfortunately, the va-sparc.h file in the
development versions of GCC leading up to the 2.3 release are *not*
the same as the release 2.2.2 version of this particular file (which is
a part of the GCC distribution). The patches below include a pre-release
(pre 2.3) copy of the va-sparc.h file which will work ok with GCC 2.2.2
*and* with glibc 1.04. Normal application of these patches will cause
this additional file to be put in the right place in the glibc tree
so that it will be included in other compilations when appropriate.
** IMPORTANT **
You must *manually* copy the new va-sparc.h file into your glibc
installation include/ directory after you do the "install" step for
glibc.
Also, it appears that Roland must be using some pre-release version of
his GNU Make program. I say that only because *my* copy of make 3.62
doesn't seem to handle newlines in quite the same way as the author
of the glibc 1.04 makefiles expected they would be handled. This fact
caused me countless problems.
If anybody gets the sparc `start.c' problem fixed, please send me a
patch for the solution. Thanks.
P.S. When applying these patches, you must supply the -p1 option to
the patch program. Don't woory if the line numbers of some of the patches
are offset by a few lines.
// Ron Guilmette
diff -prc2 1.04-/Makeconfig 1.04+/Makeconfig
*** 1.04-/Makeconfig Tue Sep 1 14:32:44 1992
--- 1.04+/Makeconfig Mon Sep 21 01:26:50 1992
*************** endif
*** 40,45 ****
# Directory for object files and libc.a. If this is not defined, the
# object files live in the subdirectories where their sources live, and
! # libc.a lives in the parent directory (this probably doesn't work any
! # more).
ifdef ARCH
ifeq ($(filter /%,$(ARCH)),)
--- 40,44 ----
# Directory for object files and libc.a. If this is not defined, the
# object files live in the subdirectories where their sources live, and
! # libc.a and start.o live in the parent directory.
ifdef ARCH
ifeq ($(filter /%,$(ARCH)),)
*************** common-objpfx = $(..)
*** 62,66 ****
common-objdir = ..
else
! common-objpfx = sysdeps/.. # This is a kludge. make wizards might grok.
endif
endif
--- 61,65 ----
common-objdir = ..
else
! common-objpfx = sysdeps/../
endif
endif
*************** endif
*** 67,70 ****
--- 66,70 ----
libc.a = $(common-objpfx)libc.a
+ start.o = $(common-objpfx)start.o
*************** endif
*** 149,153 ****
# pathname, it is relative to $(datadir)/zoneinfo.
ifndef localtime-file
! localtime-file = /etc/localtime
endif
--- 149,153 ----
# pathname, it is relative to $(datadir)/zoneinfo.
ifndef localtime-file
! localtime-file = localtime
endif
*************** ifndef default_cflags
*** 206,213 ****
endif
! # Command for linking programs with the C library.
! ifndef +link
! +link = $(CC) -nostdlib -o $@ $(objpfx)start.o $(^:lib=$(objpfx)libc.a) \
! -lgcc $(objpfx)libc.a
endif
--- 206,234 ----
endif
! # Command for compiling programs used to help build and/or install
! # the GNU C library. These programs must be executed on the host
! # (not on the target) so we should avoid using the GNU include files
! # when linking them (prefering instead to compile with whatever system
! # header files are already installed in the normal place on the host).
! ifndef +host-compile
! +host-compile = $(CC) -c $^
! endif
!
! # Command for linking programs used to help build and/or install
! # the GNU C library. These programs must be executed on the host
! # (not on the target) so we should avoid using the GNU C library when
! # linking them (prefering instead to link with whatever library
! # is already installed in the normal place on the host).
! ifndef +host-link
! +host-link = $(CC) -o $@ $^
! endif
!
! # Command for linking test programs. These programs must be run on
! # the target (not on the host) so we must avoid using the native C
! # library when linking them (prefering instead to link with the
! # newly consuructed GNU C library).
! ifndef +target-link
! +target-link = $(CC) -nostdlib -o $@ $(objpfx)start.o $(^:lib=$(objpfx)libc.a) \
! -lgcc $(objpfx)libc.a
endif
diff -prc2 1.04-/Makefile 1.04+/Makefile
*** 1.04-/Makefile Wed Sep 2 19:42:01 1992
--- 1.04+/Makefile Sun Sep 20 11:32:35 1992
*************** else
*** 75,81 ****
endif
! aux := sysdep $(+init) version start
-
# What to install.
install-lib = libc.a crt0.o Mcrt1.o
--- 81,86 ----
endif
! routines := sysdep $(+init) version start
# What to install.
install-lib = libc.a crt0.o Mcrt1.o
*************** install: subdir_install
*** 98,111 ****
lib: subdir_lib
$(objpfx)sysd-dirs: $(+sysdir_pfx)sysdirs
! (echo define sysdep-subdirs; \
for dir in `cat $<`; do \
if [ -r $(sysdep_dir)/$$dir/Subdirs ]; then \
! cat $(sysdep_dir)/$$dir/Subdirs; \
else true; \
fi; \
done; \
! echo endef) > $@-tmp
mv $@-tmp $@
--- 103,125 ----
lib: subdir_lib
+ # For the top-level directory, start.o must have a start.dep file built
+ # for it, and then must be built just like any other .o file we are going
+ # to put into the library, but it must not actually go into the library.
+ # Unfortunately, to get start.o built normally, we have to include it in
+ # the $(routines) list (see above) and doing that will also cause it to
+ # be added to the library (unless we prevent it). Here we define a variable
+ # which will prevent start.o from being added to the library.
+
+ dont_add := start.o
$(objpfx)sysd-dirs: $(+sysdir_pfx)sysdirs
! (echo -n sysdep-subdirs=; \
for dir in `cat $<`; do \
if [ -r $(sysdep_dir)/$$dir/Subdirs ]; then \
! echo -n `cat $(sysdep_dir)/$$dir/Subdirs`; \
else true; \
fi; \
done; \
! echo) > $@-tmp
mv $@-tmp $@
*************** doc:
*** 117,122 ****
# This makes all the subdirectory targets.
.PHONY: $(+subdir_targets)
! $(+subdir_targets):
! @lose=nil; \
for dir in $(subdirs); do \
$(+cmdecho) $(MAKE) -C $$dir $@;\
--- 131,136 ----
# This makes all the subdirectory targets.
.PHONY: $(+subdir_targets)
! $(+subdir_targets): $(start.o)
! lose=nil; \
for dir in $(subdirs); do \
$(+cmdecho) $(MAKE) -C $$dir $@;\
diff -prc2 1.04-/Makerules 1.04+/Makerules
*** 1.04-/Makerules Wed Sep 2 16:02:50 1992
--- 1.04+/Makerules Sun Sep 20 14:43:20 1992
*************** sysdirs := $(subst $(\n), ,$(sysdirs))
*** 74,80 ****
endif
$(+sysdir_pfx)sysdirs: $(+sysdir_pfx)Sysnames $(..)find-sysdirs
! (echo define sysdirs; \
! $(dir $(word 2,$^))$(notdir $(word 2,$^)) < $<; \
! echo endef) > $@
$(+sysdir_pfx)Sysnames:
@(echo The GNU C Library has not been configured! ;\
--- 74,80 ----
endif
$(+sysdir_pfx)sysdirs: $(+sysdir_pfx)Sysnames $(..)find-sysdirs
! (echo -n sysdirs=; \
! echo -n `$(dir $(word 2,$^))$(notdir $(word 2,$^)) < $<`; \
! echo) > $@
$(+sysdir_pfx)Sysnames:
@(echo The GNU C Library has not been configured! ;\
*************** ifdef objdir
*** 222,226 ****
cd $(objdir); $(AR) ru$(verbose) libc.a $(patsubst $(objpfx)%,%,$^)
else
! $(AR) ru$(verbose) $(..)libc.a $^
endif
# $(+libc_lock_close)
--- 223,227 ----
cd $(objdir); $(AR) ru$(verbose) libc.a $(patsubst $(objpfx)%,%,$^)
else
! $(AR) ru$(verbose) $(..)libc.a $(filter-out $(dont_add),$^)
endif
# $(+libc_lock_close)
*************** objects objs: $(objects)
*** 234,242 ****
# Installation.
! # install-lib are installed from the object directory into libdir.
! # install-data are installed as they are into datadir. headers are
! # installed from the object directory header directories into includedir.
! # install-others are absolute path names of files to install; rules to
! # install them are defined elsewhere.
do-install = $(INSTALL_DATA) $< $@
--- 235,242 ----
# Installation.
! # install-lib are installed from the object directory into $(libdir).
! # install-data are installed as they are into $(datadir). headers are
! # installed as they are in $(includedir). install-others are absolute path
! # names of files to install; rules to install them are defined elsewhere.
do-install = $(INSTALL_DATA) $< $@
*************** endif # headers
*** 264,269 ****
+install := $(filter-out $(addprefix %/,$(no-install)),$(+install))
.PHONY: install
! install: $(dir $(+install)) $(+install)
define +make-deps
--- 264,273 ----
+install := $(filter-out $(addprefix %/,$(no-install)),$(+install))
+ +install-dirs := $(dir $(+install))
+ # Get two levels of directories so $(datadir)/zoneinfo wins.
+ +install-dirs := $(+install-dirs) $(filter-out ./,$(dir $(+install-dirs)))
+
.PHONY: install
! install: $(+install-dirs) $(+install)
define +make-deps
*************** echo-headers:
*** 309,313 ****
ifdef gpl2lgpl
! ifneq (,$(wildcard /home/gd/gnu/lib/ChangeLog)
# Snarf from the master source and frob the copying notice.
$(gpl2lgpl): %: $(..)gpl2lgpl.sed /home/gd/gnu/lib/%
--- 313,317 ----
ifdef gpl2lgpl
! ifneq (,$(wildcard /home/gd/gnu/lib/ChangeLog))
# Snarf from the master source and frob the copying notice.
$(gpl2lgpl): %: $(..)gpl2lgpl.sed /home/gd/gnu/lib/%
diff -prc2 1.04-/Rules 1.04+/Rules
*** 1.04-/Rules Thu Aug 6 17:31:41 1992
--- 1.04+/Rules Mon Sep 21 01:31:20 1992
*************** others: $(addprefix $(objpfx),$(others))
*** 57,63 ****
tests: $(tests:%=$(objpfx)%.out)
! ifneq "$(strip $(others) $(tests))" ""
! $(addprefix $(objpfx),$(others) $(tests)): %: %.o $(libc.a)
! $(+link)
endif
--- 62,68 ----
tests: $(tests:%=$(objpfx)%.out)
! ifneq "$(strip $(tests))" ""
! $(addprefix $(objpfx),$(tests)): %: %.o $(libc.a) $(start.o)
! $(+target-link)
endif
diff -prc2 1.04-/misc/getttyent.c 1.04+/misc/getttyent.c
*** 1.04-/misc/getttyent.c Wed May 13 00:20:47 1992
--- 1.04+/misc/getttyent.c Sat Sep 19 17:31:13 1992
*************** getttynam(tty)
*** 58,61 ****
--- 58,63 ----
}
+ static char *skip(), *value();
+
struct ttyent *
getttyent()
*************** getttyent()
*** 66,70 ****
#define MAXLINELENGTH 100
static char line[MAXLINELENGTH];
- static char *skip(), *value();
if (!tf && !setttyent())
--- 68,71 ----
diff -prc2 1.04-/misc/sys/cdefs.h 1.04+/misc/sys/cdefs.h
*** 1.04-/misc/sys/cdefs.h Sat May 23 21:07:42 1992
--- 1.04+/misc/sys/cdefs.h Sun Sep 20 17:02:10 1992
*************** typedef double __long_double_t;
*** 78,83 ****
--- 78,86 ----
#ifdef __USE_BSD
+ #undef const
#define const __const
+ #undef signed
#define signed __signed
+ #undef volatile
#define volatile __volatile
#endif
diff -prc2 1.04-/string/string.h 1.04+/string/string.h
*** 1.04-/string/string.h Thu Sep 3 14:53:07 1992
--- 1.04+/string/string.h Fri Sep 18 17:42:53 1992
*************** extern int ffs __P ((int __i));
*** 145,149 ****
#if defined(__GNUC__) && defined(__OPTIMIZE__)
! #define ffs() __builtin_ffs()
#endif /* GCC and optimizing. */
--- 145,149 ----
#if defined(__GNUC__) && defined(__OPTIMIZE__)
! #define ffs(x) __builtin_ffs(x)
#endif /* GCC and optimizing. */
diff -prc2 1.04-/sysdeps/posix/Makefile 1.04+/sysdeps/posix/Makefile
*** 1.04-/sysdeps/posix/Makefile Mon Jul 6 16:57:09 1992
--- 1.04+/sysdeps/posix/Makefile Fri Sep 18 16:22:49 1992
*************** ifdef subdir
*** 26,30 ****
objdir-CPPFLAGS = $(CPPFLAGS) # Already has appropriate `..'s.
else
! objdir-CPPFLAGS = $(patsubst -I%,-I../%,$(patsubst -I/%,-I//%))
endif
# The point of this is to not use -W options to gcc.
--- 26,30 ----
objdir-CPPFLAGS = $(CPPFLAGS) # Already has appropriate `..'s.
else
! objdir-CPPFLAGS = $(patsubst -I%,-I../%,$(patsubst -I/%,-I//%,$(CPPFLAGS)))
endif
# The point of this is to not use -W options to gcc.
diff -prc2 1.04-/sysdeps/unix/bsd/sun/sparc/start.c 1.04+/sysdeps/unix/bsd/sun/sparc/start.c
*** 1.04-/sysdeps/unix/bsd/sun/sparc/start.c Thu Jun 11 12:47:07 1992
--- 1.04+/sysdeps/unix/bsd/sun/sparc/start.c Fri Sep 18 16:15:37 1992
*************** void
*** 60,65 ****
DEFUN_VOID(_start)
{
! int argc;
! char **argv, **envp;
/* Unwind the frame built when we entered the function. */
--- 60,65 ----
DEFUN_VOID(_start)
{
! register int argc;
! register char **argv, **envp;
/* Unwind the frame built when we entered the function. */
*************** DEFUN_VOID(_start)
*** 66,69 ****
--- 66,72 ----
asm("restore");
+ /* And clear the frame pointer. */
+ fp = 0;
+
/* The argument info starts after one register
window (64 bytes) past the SP. */
*************** DEFUN_VOID(_start)
*** 78,85 ****
sp -= 24;
__libc_init (argc, argv, envp);
-
- /* Clear the frame pointer down here, since the compiler's going to
- refer to %fp when using ARGC, ARGV, and ENVP above. */
- fp = 0;
exit (main (argc, argv, envp));
--- 81,84 ----
diff -prc2 1.04-/sysdeps/unix/siglist.c 1.04+/sysdeps/unix/siglist.c
*** 1.04-/sysdeps/unix/siglist.c Mon Oct 1 13:47:23 1990
--- 1.04+/sysdeps/unix/siglist.c Sat Sep 19 16:28:13 1992
***************
*** 1,5 ****
! #include <ansidecl.h>
#include <stddef.h>
/* This is a list of all known signal numbers. */
--- 1,8 ----
! #include "ansidecl.h"
#include <stddef.h>
+ #ifndef HAVE_GNU_LD
+ #define _sys_siglist sys_siglist
+ #endif
/* This is a list of all known signal numbers. */
*************** CONST char *CONST _sys_siglist[] =
*** 13,19 ****
"Illegal instruction",
"Trace/BPT trap",
! "IOT trap",
! "EMT trap",
! "Floating point exception",
"Killed",
"Bus error",
--- 16,22 ----
"Illegal instruction",
"Trace/BPT trap",
! "Abort",
! "Emulator trap",
! "Arithmetic exception",
"Killed",
"Bus error",
diff -prc2 1.04-/time/Makefile 1.04+/time/Makefile
*** 1.04-/time/Makefile Wed Sep 2 19:41:52 1992
--- 1.04+/time/Makefile Mon Sep 21 01:32:35 1992
*************** routines := offtime asctime clock ctime
*** 33,38 ****
aux := syms-time
! others := ap zdump zic
! tests := test_time
tzfiles := africa antarctica asia australasia europe northamerica \
--- 33,38 ----
aux := syms-time
! others := zic
! tests := test_time ap zdump
tzfiles := africa antarctica asia australasia europe northamerica \
*************** tzfiles := africa antarctica asia austra
*** 42,46 ****
distribute := $(distribute) $(tzfiles) leapseconds pacificnew
! install := zic zdump
define nl
--- 42,46 ----
distribute := $(distribute) $(tzfiles) leapseconds pacificnew
! install := # zic zdump
define nl
*************** include ../Rules
*** 59,75 ****
$(tzfiles:%=zones-%): zones-%: %
! (echo 'define $*-zones' ;\
! awk '$$1 == "Zone" { print $$2 } $$1 == "Link" { print $$3 }' $^;\
! echo 'endef' ;\
! echo '$*-zones := $$(subst $$(nl), ,$$($*-zones))' ;\
echo 'ifdef $*-zones' ;\
! echo '$$(addprefix zoneinfo/%/,$$($*-zones)): \' ;\
echo '$< $$(objpfx)zic leapseconds zoneinfo/' ;\
echo ' $$(tzcompile)' ;\
echo 'endif' ;\
! echo 'define zonenames' ;\
! echo '$$($*-zones)' ;\
! echo 'endef' ;\
! echo 'zonenames := $$(subst $$(nl), ,$$(zonenames))' ;\
) > $@
zonenames: Makefile
--- 59,69 ----
$(tzfiles:%=zones-%): zones-%: %
! (echo '$*-zones='`awk '$$1 == "Zone" { print $$2 } $$1 == "Link" { print $$3 }' $^`;\
echo 'ifdef $*-zones' ;\
! echo '$$(addprefix zoneinfo/,$$($*-zones)): \' ;\
echo '$< $$(objpfx)zic leapseconds zoneinfo/' ;\
echo ' $$(tzcompile)' ;\
echo 'endif' ;\
! echo 'zonenames=$$($*-zones)' ;\
) > $@
zonenames: Makefile
*************** endif
*** 109,121 ****
! $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o $(objpfx)emkdir.o
$(objpfx)tzfile.o: tzfile.c; $(tz-cc)
$(objpfx)zic.o: zic.c; $(tz-cc)
! define tz-cc
! $(COMPILE.c) $(+gcc-nowarn) \
! -DTZDIR='"$(datadir)/zoneinfo"' \
! -DTZDEFAULT='"$(localtime-file)"' \
! -DTZDEFRULES='"$(posixrules-file)"' \
! $< $(OUTPUT_OPTION)
! endef
--- 103,126 ----
! $(objpfx)zic: $(objpfx)zic.o $(objpfx)scheck.o $(objpfx)ialloc.o $(objpfx)emkdir.o
! $(CC) -o $@ $^
$(objpfx)tzfile.o: tzfile.c; $(tz-cc)
$(objpfx)zic.o: zic.c; $(tz-cc)
! tz-cc = $(CC) -c $(+gcc-nowarn) \
! -DTZDIR='"$(datadir)/zoneinfo"' \
! -DTZDEFAULT='"$(localtime-file)"' \
! -DTZDEFRULES='"$(posixrules-file)"' \
! $< $(OUTPUT_OPTION)
!
! $(objpfx)scheck.o: scheck.c
! $(CC) -c $<
!
! $(objpfx)ialloc.o: ialloc.c
! $(CC) -c $<
!
! $(objpfx)emkdir.o: emkdir.c
! $(CC) -c $<
!
! $(objpfx)zdump.o: zdump.c
! $(CC) -c $<
diff -prc2 1.04-/time/emkdir.c 1.04+/time/emkdir.c
*** 1.04-/time/emkdir.c Sun Mar 15 12:29:23 1992
--- 1.04+/time/emkdir.c Sun Sep 20 14:09:36 1992
***************
*** 3,12 ****
#endif
- #ifndef lint
- #ifndef NOID
- static char elsieid[] = "@(#)emkdir.c 8.20";
- #endif /* !defined NOID */
- #endif /* !defined lint */
-
#ifndef emkdir
--- 3,6 ----
*************** static char elsieid[] = "@(#)emkdir.c 8.
*** 15,20 ****
--- 9,19 ----
#include "private.h"
+ extern int system P((const char *string));
+
extern char * imalloc P((int n));
extern void ifree P((char * p));
+
+ static char * quoted P ((const char *name));
+ int emkdir P((const char *name, int mode));
static char *
diff -prc2 1.04-/time/ialloc.c 1.04+/time/ialloc.c
*** 1.04-/time/ialloc.c Sun Mar 15 12:29:24 1992
--- 1.04+/time/ialloc.c Sun Sep 20 14:06:11 1992
***************
*** 3,12 ****
#endif
- #ifndef lint
- #ifndef NOID
- static char elsieid[] = "@(#)ialloc.c 8.19";
- #endif /* !defined NOID */
- #endif /* !defined lint */
-
/*LINTLIBRARY*/
--- 3,6 ----
*************** static char elsieid[] = "@(#)ialloc.c 8.
*** 21,24 ****
--- 15,20 ----
#define nonzero(n) (((n) == 0) ? 1 : (n))
+ extern void free P((void *));
+
char * icalloc P((int nelem, int elsize));
char * icatalloc P((char * old, const char * new));
*************** char * imalloc P((int n));
*** 27,30 ****
--- 23,27 ----
char * irealloc P((char * pointer, int size));
void ifree P((char * pointer));
+ void icfree P((char * pointer));
char *
diff -prc2 1.04-/time/private.h 1.04+/time/private.h
*** 1.04-/time/private.h Sun Mar 15 11:28:14 1992
--- 1.04+/time/private.h Mon Sep 21 00:12:11 1992
***************
*** 12,25 ****
/*
- ** ID
- */
-
- #ifndef lint
- #ifndef NOID
- static char privatehid[] = "@(#)private.h 7.1";
- #endif /* !defined NOID */
- #endif /* !defined lint */
-
- /*
** const
*/
--- 12,15 ----
*************** typedef char * genericptr_t;
*** 68,78 ****
#endif /* !defined __STDC__ */
! #include "sys/types.h" /* for time_t */
! #include "stdio.h"
! #include "ctype.h"
! #include "errno.h"
! #include "string.h"
#ifndef _TIME_
! #include "time.h"
#endif /* !defined _TIME_ */
--- 58,68 ----
#endif /* !defined __STDC__ */
! #include <sys/types.h> /* for time_t */
! #include <stdio.h>
! #include <ctype.h>
! #include <errno.h>
! #include <string.h>
#ifndef _TIME_
! #include <time.h>
#endif /* !defined _TIME_ */
*************** extern int unlink P((const char * filena
*** 86,90 ****
#ifndef MAXPATHLEN
#ifdef unix
! #include "sys/param.h"
#endif /* defined unix */
#endif /* !defined MAXPATHLEN */
--- 76,80 ----
#ifndef MAXPATHLEN
#ifdef unix
! #include <sys/param.h>
#endif /* defined unix */
#endif /* !defined MAXPATHLEN */
diff -prc2 1.04-/time/scheck.c 1.04+/time/scheck.c
*** 1.04-/time/scheck.c Sun Mar 15 12:29:25 1992
--- 1.04+/time/scheck.c Sun Sep 20 14:04:19 1992
***************
*** 3,12 ****
#endif
- #ifndef lint
- #ifndef NOID
- static char elsieid[] = "@(#)scheck.c 8.10";
- #endif /* !defined lint */
- #endif /* !defined NOID */
-
/*LINTLIBRARY*/
--- 3,6 ----
*************** static char elsieid[] = "@(#)scheck.c 8.
*** 15,18 ****
--- 9,13 ----
extern char * imalloc P((int n));
extern void ifree P((char * p));
+ char * scheck P((const char *string, const char *format));
char *
*************** const char * const format;
*** 27,32 ****
register char * result;
char dummy;
! result = "";
if (string == NULL || format == NULL)
return result;
--- 22,28 ----
register char * result;
char dummy;
+ static char empty[] = "";
! result = empty;
if (string == NULL || format == NULL)
return result;
diff -prc2 1.04-/time/time.h 1.04+/time/time.h
*** 1.04-/time/time.h Fri May 22 02:04:09 1992
--- 1.04+/time/time.h Sun Sep 20 17:00:37 1992
*************** __BEGIN_DECLS
*** 56,60 ****
--- 56,62 ----
/* Returned by `clock'. */
+ #ifndef __sys_stdtypes_h
typedef long int clock_t;
+ #endif
#endif /* clock_t not defined and <time.h> or need clock_t. */
*************** typedef long int clock_t;
*** 68,72 ****
--- 70,76 ----
/* Returned by `time'. */
+ #ifndef __sys_stdtypes_h
typedef __time_t time_t;
+ #endif
#endif /* time_t not defined and <time.h> or need time_t. */
diff -prc2 1.04-/time/tzfile.h 1.04+/time/tzfile.h
*** 1.04-/time/tzfile.h Sun Mar 15 12:16:07 1992
--- 1.04+/time/tzfile.h Sun Sep 20 12:59:08 1992
***************
*** 12,25 ****
/*
- ** ID
- */
-
- #ifndef lint
- #ifndef NOID
- static char tzfilehid[] = "@(#)tzfile.h 7.1";
- #endif /* !defined NOID */
- #endif /* !defined lint */
-
- /*
** Information about time zone files.
*/
--- 12,15 ----
*************** struct tzhead {
*** 142,146 ****
*/
! #define isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0)
#ifndef USG
--- 132,136 ----
*/
! #define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
#ifndef USG
diff -prc2 1.04-/time/zdump.c 1.04+/time/zdump.c
*** 1.04-/time/zdump.c Thu Mar 5 13:38:03 1992
--- 1.04+/time/zdump.c Sun Sep 20 14:16:55 1992
***************
*** 3,12 ****
#endif
- #ifndef lint
- #ifndef NOID
- static char elsieid[] = "@(#)zdump.c 7.2";
- #endif /* !defined NOID */
- #endif /* !defined lint */
-
/*
** This code has been made independent of the rest of the time
--- 3,6 ----
*************** static char elsieid[] = "@(#)zdump.c 7.2
*** 19,22 ****
--- 13,17 ----
#include <sys/types.h> /* for time_t */
#include <time.h> /* for struct tm */
+ #include "private.h"
#ifndef MAX_STRING_LENGTH
*************** static char elsieid[] = "@(#)zdump.c 7.2
*** 60,82 ****
#endif /* !defined DAYSPERNYEAR */
extern char ** environ;
- extern int getopt();
extern char * optarg;
extern int optind;
- extern time_t time();
extern char * tzname[2];
- extern void tzset();
-
- #ifdef USG
- extern void exit();
- extern void perror();
- #endif /* defined USG */
! static char * abbr();
! static long delta();
! static void hunt();
static int longest;
static char * progname;
- static void show();
int
--- 55,74 ----
#endif /* !defined DAYSPERNYEAR */
+ extern int getopt P((int argc, char *const *argv, const char *shortopts));
+ extern time_t time P((time_t *));
+ extern void tzset P((void));
+ extern int atoi P((const char *));
extern char ** environ;
extern char * optarg;
extern int optind;
extern char * tzname[2];
! int main P((int argc, char *argv[]));
! static char * abbr P((struct tm *tmp));
! static long delta P((struct tm *newp, struct tm *oldp));
! static void hunt P((char *name, time_t lot, time_t hit));
! static void show P((char *zone, time_t t, int v));
static int longest;
static char * progname;
int
*************** int v;
*** 252,256 ****
{
struct tm * tmp;
- extern struct tm * localtime();
(void) printf("%-*s ", longest, zone);
--- 244,247 ----
*************** struct tm * tmp;
*** 275,281 ****
{
register char * result;
if (tmp->tm_isdst != 0 && tmp->tm_isdst != 1)
! return "";
result = tzname[tmp->tm_isdst];
return (result == NULL) ? "" : result;
--- 266,273 ----
{
register char * result;
+ static char empty[] = "";
if (tmp->tm_isdst != 0 && tmp->tm_isdst != 1)
! return empty;
result = tzname[tmp->tm_isdst];
return (result == NULL) ? "" : result;
diff -prc2 1.04-/time/zic.c 1.04+/time/zic.c
*** 1.04-/time/zic.c Sun Mar 15 11:28:38 1992
--- 1.04+/time/zic.c Mon Sep 21 01:28:23 1992
***************
*** 1,2 ****
--- 1,8 ----
+ /* zic - zoneinfo compiler
+
+ usage - zic [-s] [-v] [-l localtime] [-p posixrules] [-d directory]
+ [-L leapseconds] [filename ...]
+ */
+
#ifdef LIBC
#include <ansidecl.h>
***************
*** 3,12 ****
#endif
- #ifndef lint
- #ifndef NOID
- static char elsieid[] = "@(#)zic.c 7.1";
- #endif /* !defined NOID */
- #endif /* !defined lint */
-
#include "private.h"
#include "tzfile.h"
--- 9,12 ----
*************** struct zone {
*** 63,66 ****
--- 63,71 ----
};
+ extern mode_t umask P((mode_t cmask));
+ extern int access P((const char *path, int amode));
+ extern void qsort P((void *base, size_t nmemb, size_t size,
+ int (compar) (const void *, const void *)));
+ extern int system P((const char *string));
extern int emkdir P((const char * name, int mode));
extern int getopt P((int argc, char * argv[], const char * options));
*************** static long oadd P((long t1, long t2));
*** 108,112 ****
static void outzone P((const struct zone * zp, int ntzones));
static void puttzcode P((long code, FILE * fp));
! static int rcomp P((const genericptr_t leftp, const genericptr_t rightp));
static time_t rpytime P((const struct rule * rp, int wantedy));
static void rulesub P((struct rule * rp,
--- 113,117 ----
static void outzone P((const struct zone * zp, int ntzones));
static void puttzcode P((long code, FILE * fp));
! static int rcomp P((const void *leftp, const void *rightp));
static time_t rpytime P((const struct rule * rp, int wantedy));
static void rulesub P((struct rule * rp,
*************** static void writezone P((const char * na
*** 120,123 ****
--- 125,130 ----
static int yearistype P((int year, const char * type));
+ int main P((int argc, char *argv[]));
+
static int charcnt;
static int errors;
*************** usage()
*** 394,399 ****
{
(void) fprintf(stderr,
! "%s: usage is %s [ -s ] [ -v ] [ -l localtime ] [ -p posixrules ] [ -d directory ]\n\
! \t[ -L leapseconds ] [ filename ... ]\n",
progname, progname);
(void) exit(EXIT_FAILURE);
--- 401,406 ----
{
(void) fprintf(stderr,
! "%s: usage is %s [-s] [-v] [-l localtime] [-p posixrules] [-d directory]\n\
! \t\t[-L leapseconds] [filename ...]\n",
progname, progname);
(void) exit(EXIT_FAILURE);
*************** char * argv[];
*** 417,421 ****
(void) umask(umask(022) | 022);
#endif /* defined unix */
! progname = argv[0];
while ((c = getopt(argc, argv, "d:l:p:L:vs")) != EOF)
switch (c) {
--- 424,429 ----
(void) umask(umask(022) | 022);
#endif /* defined unix */
! progname = strrchr (argv[0], '/');
! progname = progname ? progname+1 : argv[0];
while ((c = getopt(argc, argv, "d:l:p:L:vs")) != EOF)
switch (c) {
*************** char * argv[];
*** 469,472 ****
--- 477,482 ----
break;
}
+ if (optind == argc && psxrules == NULL && lcltime == NULL)
+ usage(); /* usage message by request */
if (optind == argc - 1 && strcmp(argv[optind], "=") == 0)
usage(); /* usage message by request */
*************** const char * const name;
*** 589,594 ****
static int
rcomp(cp1, cp2)
! const genericptr_t cp1;
! const genericptr_t cp2;
{
return strcmp(((struct rule *) cp1)->r_name,
--- 599,604 ----
static int
rcomp(cp1, cp2)
! const void *cp1;
! const void *cp2;
{
return strcmp(((struct rule *) cp1)->r_name,
*************** const char * name;
*** 681,686 ****
nfields = 0;
while (fields[nfields] != NULL) {
if (ciequal(fields[nfields], "-"))
! fields[nfields] = "";
++nfields;
}
--- 691,698 ----
nfields = 0;
while (fields[nfields] != NULL) {
+ static char empty[] = "";
+
if (ciequal(fields[nfields], "-"))
! fields[nfields] = empty;
++nfields;
}
*************** const int iscont;
*** 904,907 ****
--- 916,925 ----
hasuntil = nfields > i_untilyear;
if (hasuntil) {
+ static char only[] = "only";
+ static char empty[] = "";
+ static char jan[] = "Jan";
+ static char one[] = "1";
+ static char zero[] = "0";
+
z.z_untilrule.r_filename = filename;
z.z_untilrule.r_linenum = linenum;
*************** const int iscont;
*** 908,916 ****
rulesub(&z.z_untilrule,
fields[i_untilyear],
! "only",
! "",
! (nfields > i_untilmonth) ? fields[i_untilmonth] : "Jan",
! (nfields > i_untilday) ? fields[i_untilday] : "1",
! (nfields > i_untiltime) ? fields[i_untiltime] : "0");
z.z_untiltime = rpytime(&z.z_untilrule, z.z_untilrule.r_loyear);
if (iscont && nzones > 0 && z.z_untiltime < max_time &&
--- 926,934 ----
rulesub(&z.z_untilrule,
fields[i_untilyear],
! only,
! empty,
! (nfields > i_untilmonth) ? fields[i_untilmonth] : jan,
! (nfields > i_untilday) ? fields[i_untilday] : one,
! (nfields > i_untiltime) ? fields[i_untiltime] : zero);
z.z_untiltime = rpytime(&z.z_untilrule, z.z_untilrule.r_loyear);
if (iscont && nzones > 0 && z.z_untiltime < max_time &&
*************** static void
*** 1043,1052 ****
rulesub(rp, loyearp, hiyearp, typep, monthp, dayp, timep)
register struct rule * const rp;
! char * const loyearp;
! char * const hiyearp;
! char * const typep;
! char * const monthp;
! char * const dayp;
! char * const timep;
{
register struct lookup const * lp;
--- 1061,1070 ----
rulesub(rp, loyearp, hiyearp, typep, monthp, dayp, timep)
register struct rule * const rp;
! char * loyearp;
! char * hiyearp;
! char * typep;
! char * monthp;
! char * dayp;
! char * timep;
{
register struct lookup const * lp;
*************** const int ttisstd;
*** 1478,1482 ****
for (i = 0; i < typecnt; ++i) {
if (gmtoff == gmtoffs[i] && isdst == isdsts[i] &&
! strcmp(abbr, &chars[abbrinds[i]]) == 0 &&
ttisstd == ttisstds[i])
return i;
--- 1496,1500 ----
for (i = 0; i < typecnt; ++i) {
if (gmtoff == gmtoffs[i] && isdst == isdsts[i] &&
! strcmp(abbr, &chars[(int)abbrinds[i]]) == 0 &&
ttisstd == ttisstds[i])
return i;
*************** const long t2;
*** 1681,1685 ****
t = t1 + t2;
! if (t2 > 0 && t <= t1 || t2 < 0 && t >= t1) {
error("time overflow");
(void) exit(EXIT_FAILURE);
--- 1699,1703 ----
t = t1 + t2;
! if ((t2 > 0 && t <= t1) || (t2 < 0 && t >= t1)) {
error("time overflow");
(void) exit(EXIT_FAILURE);
*************** const long t2;
*** 1700,1704 ****
return min_time;
t = t1 + t2;
! if (t2 > 0 && t <= t1 || t2 < 0 && t >= t1) {
error("time overflow");
(void) exit(EXIT_FAILURE);
--- 1718,1722 ----
return min_time;
t = t1 + t2;
! if ((t2 > 0 && t <= t1) || (t2 < 0 && t >= t1)) {
error("time overflow");
(void) exit(EXIT_FAILURE);
*************** const int i;
*** 1862,1866 ****
l = i;
! if (i < 0 && l >= 0 || i == 0 && l != 0 || i > 0 && l <= 0) {
(void) fprintf(stderr, "%s: %d did not sign extend correctly\n",
progname, i);
--- 1880,1884 ----
l = i;
! if ((i < 0 && l >= 0) || (i == 0 && l != 0) || (i > 0 && l <= 0)) {
(void) fprintf(stderr, "%s: %d did not sign extend correctly\n",
progname, i);
diff -prc2 1.04-/va-sparc.h 1.04+/va-sparc.h
*** 1.04-/va-sparc.h Sat Sep 19 21:32:55 1992
--- 1.04+/va-sparc.h Sat Sep 19 21:15:41 1992
***************
*** 0 ****
--- 1,78 ----
+ /* This is just like the default gvarargs.h
+ except for differences described below. */
+
+ /* Define __gnuc_va_list. */
+
+ #ifndef __GNUC_VA_LIST
+ #define __GNUC_VA_LIST
+
+ #ifndef __svr4__
+ /* This has to be a char * to be compatible with Sun.
+ i.e., we have to pass a `va_list' to vsprintf. */
+ typedef char * __gnuc_va_list;
+ #else
+ /* This has to be a void * to be compatible with Sun svr4.
+ i.e., we have to pass a `va_list' to vsprintf. */
+ typedef void * __gnuc_va_list;
+ #endif
+ #endif /* not __GNUC_VA_LIST */
+
+ /* If this is for internal libc use, don't define anything but
+ __gnuc_va_list. */
+ #if defined (_STDARG_H) || defined (_VARARGS_H)
+
+ /* In GCC version 2, we want an ellipsis at the end of the declaration
+ of the argument list. GCC version 1 can't parse it. */
+
+ #if __GNUC__ > 1
+ #define __va_ellipsis ...
+ #else
+ #define __va_ellipsis
+ #endif
+
+ #ifdef _STDARG_H
+ #define va_start(AP, LASTARG) \
+ (__builtin_saveregs (), AP = ((char *) __builtin_next_arg ()))
+ #else
+ #define va_alist __builtin_va_alist
+ /* The ... causes current_function_varargs to be set in cc1. */
+ #define va_dcl int __builtin_va_alist; __va_ellipsis
+
+ #define va_start(AP) \
+ (__builtin_saveregs (), (AP) = ((char *) &__builtin_va_alist))
+ #endif
+
+ void va_end (__gnuc_va_list); /* Defined in libgcc.a */
+ #define va_end(pvar)
+
+ #define __va_rounded_size(TYPE) \
+ (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
+
+ /* Avoid errors if compiling GCC v2 with GCC v1. */
+ #if __GNUC__ == 1
+ #define __extension__
+ #endif
+
+ /* RECORD_TYPE args passed using the C calling convention are
+ passed by invisible reference. ??? RECORD_TYPE args passed
+ in the stack are made to be word-aligned; for an aggregate that is
+ not word-aligned, we advance the pointer to the first non-reg slot. */
+ /* We don't declare the union member `d' to have type TYPE
+ because that would lose in C++ if TYPE has a constructor. */
+ #define va_arg(pvar,TYPE) \
+ __extension__ \
+ ({ TYPE __va_temp; \
+ ((__builtin_classify_type (__va_temp) >= 12) \
+ ? ((pvar) += __va_rounded_size (TYPE *), \
+ **(TYPE **) ((pvar) - __va_rounded_size (TYPE *))) \
+ : __va_rounded_size (TYPE) == 8 \
+ ? ({ union {char __d[sizeof (TYPE)]; int __i[2];} __u; \
+ __u.__i[0] = ((int *) (pvar))[0]; \
+ __u.__i[1] = ((int *) (pvar))[1]; \
+ (pvar) += 8; \
+ *(TYPE *)__u.__d; }) \
+ : ((pvar) += __va_rounded_size (TYPE), \
+ *((TYPE *) ((pvar) - __va_rounded_size (TYPE)))));})
+
+ #endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
+
Technical Details
Message-ID:
<rd8n39p.rfg@netcom.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!usc!wupost!csus.edu!netcom.com!rfgShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,ac237e28c471fe5d,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1992-09-22 22:18:36 PST Newsgroups: gnu.gcc.help Path: arc1-ca.pugleaf.net!sparky!uunet!usc!wupost!csus.edu!netcom.com!rfg From: rfg@netcom.com (Ronald F. Guilmette) Subject: A batch of patches for GNU libc 1.04. Message-ID: <rd8n39p.rfg@netcom.com> Date: Wed, 23 Sep 92 09:26:48 GMT Organization: Netcom - Online Communication Services (408 241-9760 guest) Reply-To: rfg@netcom.com Distribution: gnu Lines: 1205