diff -Naur gcc-2.95.3.old/configure.in gcc-2.95.3/configure.in --- gcc-2.95.3.old/configure.in Thu Jan 4 21:07:37 2001 +++ gcc-2.95.3/configure.in Mon May 27 07:05:27 2002 @@ -637,6 +637,7 @@ ;; *-*-linux*) # linux has rx in libc + noconfigdirs="$noconfigdirs target-libstdc++ target-libio target-libiberty target-libf2c target-libobjc target-libchill" skipdirs="$skipdirs target-librx" ;; i[3456]86-*-mingw32*) diff -Naur gcc-2.95.3.old/gcc/Makefile.in gcc-2.95.3/gcc/Makefile.in --- gcc-2.95.3.old/gcc/Makefile.in Mon Dec 18 18:01:42 2000 +++ gcc-2.95.3/gcc/Makefile.in Mon May 27 07:05:27 2002 @@ -223,7 +223,7 @@ STMP_FIXPROTO = stmp-fixproto # Test to see whether exists in the system header files. -LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ] +LIMITS_H_TEST = true # There may be a premade insn-attrtab.c for this machine. # (You could rebuild it with genattrtab as usual, but it takes a long time.) @@ -486,6 +486,8 @@ GCC_CROSS_NAME = `t='$(program_transform_cross_name)'; echo gcc | sed -e $$t` PROTOIZE_CROSS_NAME = `t='$(program_transform_cross_name)'; echo protoize | sed -e $$t` UNPROTOIZE_CROSS_NAME = `t='$(program_transform_cross_name)'; echo unprotoize | sed -e $$t` +GCOV_CROSS_NAME = `t='$(program_transform_cross_name)'; echo gcov | sed -e $$t` +CPP_CROSS_NAME = `t='$(program_transform_cross_name)'; echo cpp | sed -e $$t` # Choose the real default target. ALL=all.internal @@ -883,20 +885,22 @@ # We call this executable `xgcc' rather than `gcc' # to avoid confusion if the current directory is in the path # and CC is `gcc'. It is renamed to `gcc' when it is installed. -xgcc$(exeext): gcc.o gccspec.o version.o intl.o prefix.o \ - version.o $(LIBDEPS) $(EXTRA_GCC_OBJS) +xgcc$(exeext): gcc.o gccspec.o version.o intl.o prefix.o find_cross.o \ + cross_update_cpu.o version.o $(LIBDEPS) $(EXTRA_GCC_OBJS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o gccspec.o intl.o \ - prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS) + prefix.o version.o find_cross.o cross_update_cpu.o \ + $(EXTRA_GCC_OBJS) $(LIBS) # We call this executable `xcpp' rather than `cpp' # since the real preprocessor is named `cpp'. It too is renamed # when it is installed. # The only difference from xgcc is that it's linked with cppspec.o # instead of gccspec.o. -cpp$(exeext): gcc.o cppspec.o version.o intl.o prefix.o \ - version.o $(LIBDEPS) $(EXTRA_GCC_OBJS) +cpp$(exeext): gcc.o cppspec.o version.o intl.o prefix.o find_cross.o \ + version.o cross_update_cpu.o $(LIBDEPS) $(EXTRA_GCC_OBJS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o cppspec.o intl.o \ - prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS) + prefix.o version.o find_cross.o cross_update_cpu.o \ + $(EXTRA_GCC_OBJS) $(LIBS) # Dump a specs file to make -B./ read these specs over installed ones. specs: xgcc$(exeext) @@ -1448,6 +1452,13 @@ -DPREFIX=\"$(prefix)\" \ -c `echo $(srcdir)/prefix.c | sed 's,^\./,,'` +find_cross.o: find_cross.c Makefile + $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + -DPREFIX=\"$(prefix)\" \ + -c `echo $(srcdir)/find_cross.c | sed 's,^\./,,'` + +cross_update_cpu.o: cross_update_cpu.c + convert.o: convert.c $(CONFIG_H) $(TREE_H) flags.h convert.h toplev.h tree.o : tree.c $(CONFIG_H) system.h $(TREE_H) flags.h function.h toplev.h except.h @@ -1956,7 +1967,8 @@ cpp0$(exeext): $(CCCP)$(exeext) -rm -f cpp0$(exeext) $(LN) $(CCCP)$(exeext) cpp0$(exeext) -CCCP_OBJS = cccp.o cexp.o intl.o prefix.o version.o @extra_cpp_objs@ mbchar.o +CCCP_OBJS = cccp.o cexp.o intl.o prefix.o version.o @extra_cpp_objs@ mbchar.o \ + find_cross.o cccp$(exeext): $(CCCP_OBJS) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(CCCP_OBJS) $(LIBS) cexp.o: $(srcdir)/cexp.c $(CONFIG_H) system.h @@ -2015,7 +2027,7 @@ proto: config.status protoize$(exeext) unprotoize$(exeext) SYSCALLS.c.X -PROTO_OBJS = getpwd.o intl.o version.o +PROTO_OBJS = getpwd.o intl.o version.o find_cross.o protoize$(exeext): protoize.o $(PROTO_OBJS) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ protoize.o $(PROTO_OBJS) $(LIBS) @@ -2084,7 +2096,7 @@ # Only one of 'gcov' or 'gcov.exe' is actually built, depending # upon whether $(exeext) is empty or not. -GCOV_OBJS = gcov.o intl.o +GCOV_OBJS = gcov.o intl.o gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@ # @@ -2449,12 +2461,21 @@ # Handle cpp installation. install-cpp: cpp$(exeext) - -rm -f $(bindir)/$(CPP_INSTALL_NAME)$(exeext) - $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(bindir)/$(CPP_INSTALL_NAME)$(exeext) - if [ x$(cpp_install_dir) != x ]; then \ - rm -f $(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \ - $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \ - else true; fi + -if [ -f gcc-cross$(exeext) ] ; then \ + rm -f $(bindir)/$(CPP_CROSS_NAME)$(exeext); \ + $(INSTALL_PROGRAM) cpp$(exeext) $(bindir)/$(CPP_CROSS_NAME)$(exeext); \ + if [ -d $(gcc_tooldir)/bin/. ] ; then \ + rm -f $(gcc_tooldir)/bin/cpp$(exeext); \ + ln -s ../../bin/$(CPP_CROSS_NAME)$(exeext) $(gcc_tooldir)/bin/cpp$(exeext); \ + else true; fi; \ + else \ + rm -f $(bindir)/$(CPP_INSTALL_NAME)$(exeext); \ + $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(bindir)/$(CPP_INSTALL_NAME)$(exeext); \ + if [ x$(cpp_install_dir) != x ]; then \ + rm -f $(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \ + $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \ + else true; fi; \ + fi uninstall-cpp: -rm -f $(bindir)/cpp @@ -2489,6 +2510,7 @@ -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; chmod a+rx $(bindir) ; fi -if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; chmod a+rx $(includedir) ; fi -if [ -d $(gcc_tooldir) ] ; then true ; else mkdir $(gcc_tooldir) ; chmod a+rx $(gcc_tooldir) ; fi + -if [ -d $(gcc_tooldir)/bin ] ; then true ; else mkdir $(gcc_tooldir)/bin ; chmod a+rx $(gcc_tooldir)/bin ; fi -if [ -d $(assertdir) ] ; then true ; else mkdir $(assertdir) ; chmod a+rx $(assertdir) ; fi -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; chmod a+rx $(infodir) ; fi # We don't use mkdir -p to create the parents of man1dir, @@ -2532,8 +2554,12 @@ if [ -f gcc-cross$(exeext) ] ; then \ rm -f $(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \ $(INSTALL_PROGRAM) protoize$(exeext) $(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \ + rm -f $(gcc_tooldir)/bin/protoize$(exeext); \ + ln -s ../../bin/$(PROTOIZE_CROSS_NAME)$(exeext) $(gcc_tooldir)/bin/protoize$(exeext); \ rm -f $(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \ $(INSTALL_PROGRAM) unprotoize$(exeext) $(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \ + rm -f $(gcc_tooldir)/bin/unprotoize$(exeext); \ + ln -s ../../bin/$(UNPROTOIZE_CROSS_NAME)$(exeext) $(gcc_tooldir)/bin/unprotoize$(exeext); \ else \ rm -f $(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \ $(INSTALL_PROGRAM) protoize$(exeext) $(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \ @@ -2561,7 +2587,7 @@ $(INSTALL_PROGRAM) gcc-cross$(exeext) $(bindir)/$(GCC_CROSS_NAME)$(exeext); \ if [ -d $(gcc_tooldir)/bin/. ] ; then \ rm -f $(gcc_tooldir)/bin/gcc$(exeext); \ - $(INSTALL_PROGRAM) gcc-cross$(exeext) $(gcc_tooldir)/bin/gcc$(exeext); \ + ln -s ../../bin/$(GCC_CROSS_NAME)$(exeext) $(gcc_tooldir)/bin/gcc$(exeext); \ else true; fi; \ else \ rm -f $(bindir)/$(GCC_INSTALL_NAME)$(exeext); \ @@ -2944,7 +2970,7 @@ # To prevent `make install' from compiling alloca.o and then relinking cc1 # because alloca.o is newer, we permit these recursive makes to compile # alloca.o. Then cc1 is newer, so it won't have to be relinked. - $(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)" + $(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/ -I/home/mari/YDL/ppc/82xx/usr/include -B/home/mari/YDL/ppc/82xx/lib/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)" $(MAKE) stage2 -if test $@ = bootstrap-lean; then rm -rf stage1; else true; fi $(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CFLAGS="$(WARN_CFLAGS) $(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)" diff -Naur gcc-2.95.3.old/gcc/cccp.c gcc-2.95.3/gcc/cccp.c --- gcc-2.95.3.old/gcc/cccp.c Wed Mar 8 13:22:44 2000 +++ gcc-2.95.3/gcc/cccp.c Mon May 27 07:05:27 2002 @@ -384,50 +384,7 @@ be wrapped in extern "C" when compiling C++. */ int included; /* Set if the directory is acceptable. */ -} include_defaults_array[] -#ifdef INCLUDE_DEFAULTS - = INCLUDE_DEFAULTS; -#else - = { - /* Pick up GNU C++ specific include files. */ - { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0 }, -#ifdef CROSS_COMPILE - /* This is the dir for fixincludes. Put it just before - the files that we fix. */ - { GCC_INCLUDE_DIR, "GCC", 0, 0, 0 }, - /* For cross-compilation, this dir name is generated - automatically in Makefile.in. */ - { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0 }, -#ifdef TOOL_INCLUDE_DIR - /* This is another place that the target system's headers might be. */ - { TOOL_INCLUDE_DIR, "BINUTILS", 0, 0, 0 }, -#endif -#else /* not CROSS_COMPILE */ -#ifdef LOCAL_INCLUDE_DIR - /* This should be /usr/local/include and should come before - the fixincludes-fixed header files. */ - { LOCAL_INCLUDE_DIR, 0, 0, 1, 0 }, -#endif -#ifdef TOOL_INCLUDE_DIR - /* This is here ahead of GCC_INCLUDE_DIR because assert.h goes here. - Likewise, behind LOCAL_INCLUDE_DIR, where glibc puts its assert.h. */ - { TOOL_INCLUDE_DIR, "BINUTILS", 0, 0, 0 }, -#endif - /* This is the dir for fixincludes. Put it just before - the files that we fix. */ - { GCC_INCLUDE_DIR, "GCC", 0, 0, 0 }, - /* Some systems have an extra dir of include files. */ -#ifdef SYSTEM_INCLUDE_DIR - { SYSTEM_INCLUDE_DIR, 0, 0, 0, 0 }, -#endif -#ifndef STANDARD_INCLUDE_COMPONENT -#define STANDARD_INCLUDE_COMPONENT 0 -#endif - { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0, 0 }, -#endif /* not CROSS_COMPILE */ - { 0, 0, 0, 0, 0 } - }; -#endif /* no INCLUDE_DEFAULTS */ +} include_defaults_array[10]; /* The code looks at the defaults through this pointer, rather than through the constant structure above. This pointer gets changed if an environment @@ -1018,6 +975,10 @@ static void memory_full PROTO((void)) ATTRIBUTE_NORETURN; static void print_help PROTO((void)); + +extern char *replace(char*, char*); +extern int find_family_cpu(char **); +extern char *get_std_prefix(); /* Read LEN bytes at PTR from descriptor DESC, for file FILENAME, retrying if necessary. If MAX_READ_LEN is defined, read at most @@ -1226,6 +1187,156 @@ FILE *deps_stream = 0; /* Target-name to write with the dependency information. */ char *deps_target = 0; + +#define add_to_include(_var, _fname, _component, _cplusplus, _cxx_aware, _included) \ + do { _var.fname = _fname; \ + _var.component = _component; \ + _var.cplusplus = _cplusplus; \ + _var.cxx_aware = _cxx_aware; \ + _var.included = _included; } while (0); + + + char *cross_dir; + char *family_cpu; + int ind = 0; + + + if (!find_family_cpu(&family_cpu)) { + fatal("The CROSS_COMPILE environment variable is not set"); + } + + /* Set new standard prefix to use instead of /cdt */ + find_cross_dir(argv[0], &cross_dir, 1); + if (cross_dir) + { + set_std_prefix(cross_dir, strlen(cross_dir)); + + /* Generate the include_defaults_array. It can not be initialized because + some paths can depend on values of environment variables */ + add_to_include(include_defaults_array[ind], + replace(cross_dir, GPLUSPLUS_INCLUDE_DIR), + "G++", 1, 1, 0); + ind++; +#ifdef CROSS_COMPILE + add_to_include(include_defaults_array[ind], + replace(cross_dir, GCC_INCLUDE_DIR), + "GCC", 0, 0, 0); + ind++; + add_to_include(include_defaults_array[ind], + replace(cross_dir, CROSS_INCLUDE_DIR), + "GCC", 0, 0, 0); + ind++; +#ifdef TOOL_INCLUDE_DIR + add_to_include(include_defaults_array[ind], + replace(cross_dir, TOOL_INCLUDE_DIR), + "BINUTILS", 0, 1, 0); + ind++; +#endif + { + char *target_include_dir = concat(cross_dir, "/../", family_cpu, + "/usr/include", NULL_PTR); + char * gxx_target_include_dir = concat(cross_dir, "/../", family_cpu, + "/usr/include/g++-3", NULL_PTR); + if (gxx_target_include_dir) { + add_to_include(include_defaults_array[ind], gxx_target_include_dir, + 0, 1, 1, 0); + ind++; + } + + if (target_include_dir) { + add_to_include(include_defaults_array[ind], target_include_dir, + 0, 0, 0, 0); + ind++; + } + } +#else /* not CROSS_COMPILE */ +#ifdef LOCAL_INCLUDE_DIR + add_to_include(include_defaults_array[ind], + replace(cross_dir, LOCAL_INCLUDE_DIR), 0, 0, 1, 0); + ind++; +#endif +#ifdef TOOL_INCLUDE_DIR + add_to_include(include_defaults_array[ind], + replace(cross_dir, TOOL_INCLUDE_DIR), + "BINUTILS", 0, 1, 0); + ind++; +#endif + add_to_include(include_defaults_array[ind], + replace(cross_dir, GCC_INCLUDE_DIR), + "GCC", 0, 0, 0); + ind++; +#ifdef SYSTEM_INCLUDE_DIR + add_to_include(include_defaults_array[ind], + replace(cross_dir, SYSTEM_INCLUDE_DIR), + 0, 0, 0, 0); + ind++; +#endif +#endif /* not CROSS_COMPILE */ + } + else { + /* cross_dir can not be determined */ + add_to_include(include_defaults_array[ind], + GPLUSPLUS_INCLUDE_DIR, + "G++", 1, 1, 0); + ind++; +#ifdef CROSS_COMPILE + add_to_include(include_defaults_array[ind], + GCC_INCLUDE_DIR, + "GCC", 0, 0, 0); + ind++; + add_to_include(include_defaults_array[ind], CROSS_INCLUDE_DIR, + "GCC", 0, 0, 0); + ind++; +#ifdef TOOL_INCLUDE_DIR + add_to_include(include_defaults_array[ind], TOOL_INCLUDE_DIR, + "BINUTILS", 0, 1, 0); + ind++; +#endif + { + char *target_include_dir = concat(get_std_prefix(), "/../", + family_cpu, "/usr/include", NULL_PTR); + char * gxx_target_include_dir = concat(get_std_prefix(), "/../", + family_cpu, "/usr/include/g++-3", + NULL_PTR); + if (gxx_target_include_dir) { + add_to_include(include_defaults_array[ind], gxx_target_include_dir, + 0, 1, 1, 0); + ind++; + } + + if (target_include_dir) { + add_to_include(include_defaults_array[ind], target_include_dir, + 0, 0, 0, 0); + ind++; + } + } +#else /* not CROSS_COMPILE */ +#ifdef LOCAL_INCLUDE_DIR + add_to_include(include_defaults_array[ind], LOCAL_INCLUDE_DIR, 0, 0, 1, 0); + ind++; +#endif +#ifdef TOOL_INCLUDE_DIR + add_to_include(include_defaults_array[ind], TOOL_INCLUDE_DIR, + "BINUTILS", 0, 1, 0); + ind++; +#endif + add_to_include(include_defaults_array[ind], GCC_INCLUDE_DIR, + "GCC", 0, 0, 0); + ind++; +#ifdef SYSTEM_INCLUDE_DIR + add_to_include(include_defaults_array[ind], SYSTEM_INCLUDE_DIR, + 0, 0, 0, 0); + ind++; +#endif +#endif /* not CROSS_COMPILE */ + } + +#if !defined(CROSS_COMPILE) && !defined(STANDARD_INCLUDE_COMPONENT) +#define STANDARD_INCLUDE_COMPONENT 0 +#endif + add_to_include(include_defaults_array[ind], 0, 0, 0, 0, 0 ); + +#undef add_to_include #if defined (RLIMIT_STACK) && defined (HAVE_GETRLIMIT) && defined (HAVE_SETRLIMIT) /* Get rid of any avoidable limit on stack size. */ diff -Naur gcc-2.95.3.old/gcc/config/rs6000/rs6000.c gcc-2.95.3/gcc/config/rs6000/rs6000.c --- gcc-2.95.3.old/gcc/config/rs6000/rs6000.c Fri Jan 12 02:52:53 2001 +++ gcc-2.95.3/gcc/config/rs6000/rs6000.c Mon May 27 07:05:27 2002 @@ -216,6 +216,9 @@ {"403", PROCESSOR_PPC403, MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS | MASK_STRICT_ALIGN, POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, + {"405pm", PROCESSOR_PPC403, + MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_STRICT_ALIGN, + POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, {"505", PROCESSOR_MPCCORE, MASK_POWERPC | MASK_NEW_MNEMONICS, POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, @@ -246,6 +249,9 @@ {"740", PROCESSOR_PPC750, MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, + {"7400", PROCESSOR_PPC750, + MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, + POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, {"750", PROCESSOR_PPC750, MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS, POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64}, diff -Naur gcc-2.95.3.old/gcc/config/rs6000/rs6000.h gcc-2.95.3/gcc/config/rs6000/rs6000.h --- gcc-2.95.3.old/gcc/config/rs6000/rs6000.h Thu Jan 4 21:07:38 2001 +++ gcc-2.95.3/gcc/config/rs6000/rs6000.h Mon May 27 07:05:27 2002 @@ -72,6 +72,7 @@ %{mcpu=rsc1: -D_ARCH_PWR} \ %{mcpu=401: -D_ARCH_PPC} \ %{mcpu=403: -D_ARCH_PPC} \ +%{mcpu=405pm: -D_ARCH_PPC} \ %{mcpu=505: -D_ARCH_PPC} \ %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ %{mcpu=602: -D_ARCH_PPC} \ @@ -82,6 +83,7 @@ %{mcpu=604e: -D_ARCH_PPC} \ %{mcpu=620: -D_ARCH_PPC} \ %{mcpu=740: -D_ARCH_PPC} \ +%{mcpu=7400: -D_ARCH_PPC} \ %{mcpu=750: -D_ARCH_PPC} \ %{mcpu=801: -D_ARCH_PPC} \ %{mcpu=821: -D_ARCH_PPC} \ @@ -138,6 +140,7 @@ %{mcpu=604e: -mppc} \ %{mcpu=620: -mppc} \ %{mcpu=740: -mppc} \ +%{mcpu=7400: -m7400} \ %{mcpu=750: -mppc} \ %{mcpu=801: -mppc} \ %{mcpu=821: -mppc} \ diff -Naur gcc-2.95.3.old/gcc/config/rs6000/sysv4.h gcc-2.95.3/gcc/config/rs6000/sysv4.h --- gcc-2.95.3.old/gcc/config/rs6000/sysv4.h Thu Jan 4 21:07:38 2001 +++ gcc-2.95.3/gcc/config/rs6000/sysv4.h Mon May 27 07:05:28 2002 @@ -1146,7 +1146,7 @@ %{mcall-sysv: -D_CALL_SYSV} %{mcall-nt: -D_CALL_NT} \ %{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} \ %{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %{!mcall-nt: %(cpp_sysv_default) }}}} \ -%{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT}" +%{msoft-float: -D_SOFT_FLOAT} %{mcpu=860: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT}" #undef CPP_SYSV_DEFAULT_SPEC #define CPP_SYSV_DEFAULT_SPEC "-D_CALL_SYSV" diff -Naur gcc-2.95.3.old/gcc/config/rs6000/t-ppc gcc-2.95.3/gcc/config/rs6000/t-ppc --- gcc-2.95.3.old/gcc/config/rs6000/t-ppc Thu May 20 14:51:36 1999 +++ gcc-2.95.3/gcc/config/rs6000/t-ppc Mon May 27 07:05:27 2002 @@ -4,7 +4,6 @@ # explicit little endian or big endian libraries, since it depends on the # -mbig/-mlittle switches passed to gas. The -mrelocatable support also needs # -mrelocatable passed to gas, so don't use it either. - MULTILIB_OPTIONS = msoft-float MULTILIB_DIRNAMES = nof MULTILIB_EXCEPTIONS = diff -Naur gcc-2.95.3.old/gcc/config/rs6000/t-ppcos gcc-2.95.3/gcc/config/rs6000/t-ppcos --- gcc-2.95.3.old/gcc/config/rs6000/t-ppcos Thu May 20 14:51:36 1999 +++ gcc-2.95.3/gcc/config/rs6000/t-ppcos Mon May 27 07:05:27 2002 @@ -3,10 +3,9 @@ # Build libgcc.a with different options. With gas, build pic libraries # as well no floating point -MULTILIB_OPTIONS = msoft-float fPIC -MULTILIB_DIRNAMES = nof pic +MULTILIB_OPTIONS = mcpu=403/mcpu=7400/mcpu=750/mcpu=603/mcpu=860 fPIC +MULTILIB_DIRNAMES = m403 m7400 m750 m603 m860 pic MULTILIB_EXCEPTIONS = -MULTILIB_MATCHES = ${MULTILIB_MATCHES_FLOAT} \ - fPIC=mrelocatable-lib \ +MULTILIB_MATCHES = fPIC=mrelocatable-lib \ fPIC=mrelocatable \ fPIC=fpic diff -Naur gcc-2.95.3.old/gcc/config/t-linux gcc-2.95.3/gcc/config/t-linux --- gcc-2.95.3.old/gcc/config/t-linux Thu May 20 14:51:36 1999 +++ gcc-2.95.3/gcc/config/t-linux Mon May 27 07:05:27 2002 @@ -7,7 +7,7 @@ # Compile crtbeginS.o and crtendS.o with pic. CRTSTUFF_T_CFLAGS_S = -fPIC # Compile libgcc2.a with pic. -TARGET_LIBGCC2_CFLAGS = -fPIC +TARGET_LIBGCC2_CFLAGS = -fPIC -I../../gcc/glibc-include # Do not build libgcc1. Let gcc generate those functions. The GNU/Linux # C library can handle them. diff -Naur gcc-2.95.3.old/gcc/cp/Make-lang.in gcc-2.95.3/gcc/cp/Make-lang.in --- gcc-2.95.3.old/gcc/cp/Make-lang.in Thu May 20 14:51:36 1999 +++ gcc-2.95.3/gcc/cp/Make-lang.in Mon May 27 07:05:27 2002 @@ -87,7 +87,8 @@ $$cp_srcdir/parse.c # Create the compiler driver for g++. -GXX_OBJS = gcc.o g++spec.o intl.o prefix.o version.o +GXX_OBJS = gcc.o g++spec.o intl.o prefix.o version.o find_cross.o \ + cross_update_cpu.o g++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBS) @@ -219,6 +220,10 @@ chmod a+x $(bindir)/$(GXX_CROSS_NAME)$(exeext); \ rm -f $(bindir)/$(CXX_CROSS_NAME)$(exeext); \ $(LN) $(bindir)/$(GXX_CROSS_NAME)$(exeext) $(bindir)/$(CXX_CROSS_NAME)$(exeext); \ + rm -f $(tooldir)/bin/g++$(exeext); \ + ln -s ../../bin/$(GXX_CROSS_NAME)$(exeext) $(tooldir)/bin/g++$(exeext); \ + rm -f $(tooldir)/bin/c++$(exeext); \ + ln -s ../../bin/$(CXX_CROSS_NAME)$(exeext) $(tooldir)/bin/c++$(exeext); \ else \ rm -f $(bindir)/$(GXX_INSTALL_NAME)$(exeext); \ $(INSTALL_PROGRAM) g++$(exeext) $(bindir)/$(GXX_INSTALL_NAME)$(exeext); \ diff -Naur gcc-2.95.3.old/gcc/cppinit.c gcc-2.95.3/gcc/cppinit.c --- gcc-2.95.3.old/gcc/cppinit.c Tue Jan 18 21:37:55 2000 +++ gcc-2.95.3/gcc/cppinit.c Mon May 27 07:05:27 2002 @@ -84,6 +84,12 @@ #define REGISTER_PREFIX "" #endif +extern char *cross_dir; +extern char *family_cpu; + +extern char *replace(char *, char *); + + /* Suffix for object files, and known input-file extensions. */ static char *known_suffixes[] = { @@ -121,50 +127,7 @@ be wrapped in extern "C" when compiling C++. This is not used anymore. */ } -include_defaults_array[] -#ifdef INCLUDE_DEFAULTS -= INCLUDE_DEFAULTS; -#else -= { - /* Pick up GNU C++ specific include files. */ - { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 }, -#ifdef CROSS_COMPILE - /* This is the dir for fixincludes. Put it just before - the files that we fix. */ - { GCC_INCLUDE_DIR, "GCC", 0, 0 }, - /* For cross-compilation, this dir name is generated - automatically in Makefile.in. */ - { CROSS_INCLUDE_DIR, "GCC", 0, 0 }, -#ifdef TOOL_INCLUDE_DIR - /* This is another place that the target system's headers might be. */ - { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1 }, -#endif -#else /* not CROSS_COMPILE */ -#ifdef LOCAL_INCLUDE_DIR - /* This should be /usr/local/include and should come before - the fixincludes-fixed header files. */ - { LOCAL_INCLUDE_DIR, 0, 0, 1 }, -#endif -#ifdef TOOL_INCLUDE_DIR - /* This is here ahead of GCC_INCLUDE_DIR because assert.h goes here. - Likewise, behind LOCAL_INCLUDE_DIR, where glibc puts its assert.h. */ - { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1 }, -#endif - /* This is the dir for fixincludes. Put it just before - the files that we fix. */ - { GCC_INCLUDE_DIR, "GCC", 0, 0 }, - /* Some systems have an extra dir of include files. */ -#ifdef SYSTEM_INCLUDE_DIR - { SYSTEM_INCLUDE_DIR, 0, 0, 0 }, -#endif -#ifndef STANDARD_INCLUDE_COMPONENT -#define STANDARD_INCLUDE_COMPONENT 0 -#endif - { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0 }, -#endif /* not CROSS_COMPILE */ - { 0, 0, 0, 0 } - }; -#endif /* no INCLUDE_DEFAULTS */ +include_defaults_array[10]; /* Internal structures and prototypes. */ @@ -775,7 +738,149 @@ cpp_buffer *fp; struct include_hash *ih_fake; - /* -MG doesn't select the form of output and must be specified with one of + /* Generate include_defaults array. The std_prefix was set already by + gcc.c main() function + */ +#define add_to_include(_var, _fname, _component, _cplusplus, _cxx_aware, _included) \ + do { _var.fname = _fname; \ + _var.component = _component; \ + _var.cplusplus = _cplusplus; \ + _var.cxx_aware = _cxx_aware; } while (0); + + + int index = 0; + + if (cross_dir) { + add_to_include(include_defaults_array[index], + replace(cross_dir, GPLUSPLUS_INCLUDE_DIR), + "G++", 1, 1); + index++; +#ifdef CROSS_COMPILE + add_to_include(include_defaults_array[index], + replace(cross_dir, GCC_INCLUDE_DIR), + "GCC", 0, 0); + index++; + add_to_include(include_defaults_array[index], + replace(cross_dir, CROSS_INCLUDE_DIR), + "GCC", 0, 0); + index++; + +#ifdef TOOL_INCLUDE_DIR + add_to_include(include_defaults_array[index], + replace(cross_dir, TOOL_INCLUDE_DIR), + "BINUTILS", 0, 1); + index++; +#endif + if (family_cpu && *family_cpu) + { + char * target_include_dir = concat(cross_dir, "/../", + family_cpu, "/usr/nclude", NULL_PTR); + char * gxx_target_include_dir = concat(cross_dir, "/../", + family_cpu, "/usr/include/g++-3", + NULL_PTR); + if (gxx_target_include_dir) { + add_to_include(include_defaults_array[index], gxx_target_include_dir, + 0, 1, 1); + index++; + } + if (target_include_dir) { + add_to_include(include_defaults_array[index], target_include_dir, + 0, 0, 0); + index++; + } + } +#else /* not CROSS_COMPILE */ +#ifdef LOCAL_INCLUDE_DIR + add_to_include(include_defaults_array[index], + replace(cross_dir, LOCAL_INCLUDE_DIR), 0, 0, 1); + index++; +#endif +#ifdef TOOL_INCLUDE_DIR + add_to_include(include_defaults_array[index], + replace(cross_dir, TOOL_INCLUDE_DIR), + "BINUTILS", 0, 1); + index++; +#endif + add_to_include(include_defaults_array[index], + replace(cross_dir, GCC_INCLUDE_DIR), + "GCC", 0, 0); + index++; +#ifdef SYSTEM_INCLUDE_DIR + add_to_include(include_defaults_array[index], + replace(cross_dir, SYSTEM_INCLUDE_DIR), + 0, 0, 0); + index++; +#endif +#endif /* not CROSS_COMPILE */ + } + else + { + add_to_include(include_defaults_array[index], GPLUSPLUS_INCLUDE_DIR, + "G++", 1, 1); + index++; +#ifdef CROSS_COMPILE + add_to_include(include_defaults_array[index], GCC_INCLUDE_DIR, + "GCC", 0, 0); + index++; + add_to_include(include_defaults_array[index], CROSS_INCLUDE_DIR, + "GCC", 0, 0); + index++; + +#ifdef TOOL_INCLUDE_DIR + add_to_include(include_defaults_array[index], TOOL_INCLUDE_DIR, + "BINUTILS", 0, 1); + index++; +#endif + if (family_cpu && *family_cpu) + { + char * target_include_dir = concat(get_std_prefix(), "/../", + family_cpu, "/usr/include", NULL_PTR); + char * gxx_target_include_dir = concat(get_std_prefix(), "/../", + family_cpu, "/usr/include/g++-3", + NULL_PTR); + if (gxx_target_include_dir) { + add_to_include(include_defaults_array[index], gxx_target_include_dir, + 0, 1, 1); + index++; + } + + if (target_include_dir) { + add_to_include(include_defaults_array[index], target_include_dir, + 0, 0, 0); + index++; + } + } +#else /* not CROSS_COMPILE */ +#ifdef LOCAL_INCLUDE_DIR + add_to_include(include_defaults_array[index], LOCAL_INCLUDE_DIR, + 0, 0, 1); + index++; +#endif +#ifdef TOOL_INCLUDE_DIR + add_to_include(include_defaults_array[index], TOOL_INCLUDE_DIR, + "BINUTILS", 0, 1); + index++; +#endif + add_to_include(include_defaults_array[index], GCC_INCLUDE_DIR, + "GCC", 0, 0); + index++; +#ifdef SYSTEM_INCLUDE_DIR + add_to_include(include_defaults_array[index], SYSTEM_INCLUDE_DIR, + 0, 0, 0); + index++; +#endif +#endif /* not CROSS_COMPILE */ + } + +#if !defined(CROSS_COMPILE) && !defined(STANDARD_INCLUDE_COMPONENT) +#define STANDARD_INCLUDE_COMPONENT 0 +#endif + + add_to_include(include_defaults_array[index], 0, 0, 0, 0); + +#undef add_to_include + +/* -MG doesn't select the form of output and must be specified with one of -M or -MM. -MG doesn't make sense with -MD or -MMD since they don't inhibit compilation. */ if (opts->print_deps_missing_files diff -Naur gcc-2.95.3.old/gcc/cross_update_cpu.c gcc-2.95.3/gcc/cross_update_cpu.c --- gcc-2.95.3.old/gcc/cross_update_cpu.c Thu Jan 1 03:00:00 1970 +++ gcc-2.95.3/gcc/cross_update_cpu.c Mon May 27 07:05:27 2002 @@ -0,0 +1,66 @@ +#include +#include + +/* The following structure sets matching between CROSS_COMPILE env. variable + * and --mcpu= flag values + */ + +static struct target_cpu { + char *target_arch; /* cpu specification in CROSS_COMPILE env. variable */ + char *cpu_id; /* cpu specification in the mcpu flag */ +}; + +struct target_cpu ppc_cpu_tbl[] = { + {"4xx", "403" }, + {"4xxFP","405pm"}, + {"74xx", "7400"}, + {"7xx", "750" }, + {"82xx", "603" }, + {"8xx", "860" } +}; + +void cross_update_cpu(argc, argv, family_cpu) + int *argc; + char ***argv; + char *family_cpu; +{ + int i; + char *cpu; + + if (!strncasecmp(family_cpu, "ppc_", 4)) + { + cpu = family_cpu + 4; + + for (i = 0; i < *argc; i++) + { + if (!strncmp((*argv)[i], "-mcpu=", 6)) + break; + } + if (i == *argc) + { + /* The user has not specified cpu option - add it */ + char **newargv = xmalloc((*argc + 1)*sizeof(char *)); + char *cpu_id = NULL; + + for (i = 0; i < sizeof(ppc_cpu_tbl)/sizeof(ppc_cpu_tbl[0]); i++) + { + if (! strcmp(ppc_cpu_tbl[i].target_arch, cpu)) { + cpu_id = ppc_cpu_tbl[i].cpu_id; + break; + } + } + if (cpu_id) + { + newargv[0] = (*argv)[0]; + newargv[1] = xmalloc(strlen(cpu_id) + 7); + strcpy(newargv[1], "-mcpu="); + strcat(newargv[1], cpu_id); + for (i = 2; i < *argc + 1; i++) + newargv[i] = (*argv)[i-1]; + *argv = newargv; + (*argc)++; + } + } + } +} + diff -Naur gcc-2.95.3.old/gcc/f/Make-lang.in gcc-2.95.3/gcc/f/Make-lang.in --- gcc-2.95.3.old/gcc/f/Make-lang.in Mon Jun 7 23:37:23 1999 +++ gcc-2.95.3/gcc/f/Make-lang.in Mon May 27 07:05:27 2002 @@ -80,10 +80,12 @@ # Create the compiler driver for g77. g77$(exeext): gcc.o g77spec.o g77version.o version.o prefix.o intl.o \ + find_cross.o cross_update_cpu.o \ $(LIBDEPS) $(EXTRA_GCC_OBJS) if [ -f lang-f77 ]; then \ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o g77spec.o g77version.o \ - version.o prefix.o intl.o $(EXTRA_GCC_OBJS) $(LIBS); \ + version.o prefix.o intl.o find_cross.o cross_update_cpu.o \ + $(EXTRA_GCC_OBJS) $(LIBS); \ else true; fi # Create a version of the g77 driver which calls the cross-compiler. diff -Naur gcc-2.95.3.old/gcc/find_cross.c gcc-2.95.3/gcc/find_cross.c --- gcc-2.95.3.old/gcc/find_cross.c Thu Jan 1 03:00:00 1970 +++ gcc-2.95.3/gcc/find_cross.c Mon May 27 07:05:27 2002 @@ -0,0 +1,234 @@ +/* Utility to update paths from internal to external forms. + Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC 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. + +GCC 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 GCC; see the file COPYING. If not, write to the Free +Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include +#include + +#ifndef PATH_SEPARATOR +#define PATH_SEPARATOR ':' +#endif + +#ifndef DIR_SEPARATOR +#define DIR_SEPARATOR '/' +#endif + +static void remove_relative_paths (char * path); + +/* Remove relative paths -- .. and . */ +static void +remove_relative_paths (char * path) +{ + char *p, *s; + + p = path; + while ((p = strchr (p, DIR_SEPARATOR))) + { + p++; + if (*p == '.') + { + p++; + if (*p == DIR_SEPARATOR) + { + /* Translate "/./" ==> "/" */ + strcpy (p-2, p); + } + else if (*p == '.' && *(p+1) == DIR_SEPARATOR) + { + /* Translate "//../" ==> "/" */ + s = p + 1; + p -= 3; + while ( p > path && *p != DIR_SEPARATOR) + p--; + strcpy (p, s); + } + } + } +} + +/* Find cross directory root */ +void find_cross_dir(char *progname, char **ptr, int is_cpp0) +{ + char *fullpath = (char *) xmalloc(MAXPATHLEN); + char *linkfile = (char *) xmalloc(MAXPATHLEN); + char *realpath = (char *) xmalloc(MAXPATHLEN); + struct stat file; + int ret = 0; + char *p; + int i; + + *ptr = 0; + + if (strchr (progname, '/')) + { + if (progname[0] == '/') + { + /* We have absolute path */ + strcpy (fullpath, progname); + } else { + /* We have relative path, prepend $cwd */ + getcwd (fullpath, MAXPATHLEN); + strcat (fullpath, "/"); + strcat (fullpath, progname); + } + } else { + /* Search pathlist for matching progname */ + char *path; + char *beg, *end; + + path = getenv("PATH"); + beg = path; + while (1) + { + for (end = beg; *end && *end != PATH_SEPARATOR; end++) ; + strncpy (fullpath, beg, end - beg); + fullpath[end - beg] = '\0'; + if (fullpath[end - beg - 1] == DIR_SEPARATOR) + fullpath[end - beg - 1] = '\0'; + if (strcmp (fullpath, ".") == 0) + getcwd (fullpath, MAXPATHLEN); + strcat (fullpath, "/"); + strcat (fullpath, progname); + if ((lstat (fullpath, &file) == 0) && + (S_ISREG(file.st_mode) || S_ISLNK(file.st_mode))) break; + if (*end == '\0') { + free(realpath); + goto RET; /* Not found on path */ + } + beg = end + 1; + } + } + + /* Resolve all symbolic links in the full path */ + while (fullpath[0]) + { + char *t, *s, *q; + int len, off; + + while ((ret = lstat (fullpath, &file)) == 0 && S_ISLNK(file.st_mode)) + { + /* fullpath is a link */ + linkfile[readlink (fullpath, linkfile, MAXPATHLEN)] = '\0'; + if (linkfile[0] == DIR_SEPARATOR) + { + /* Link replaces path */ + strcpy (fullpath, linkfile); + } + else + { + /* Link is relative to current directory */ + q = strrchr (fullpath, DIR_SEPARATOR); + *(q + 1) = '\0'; + strcat (fullpath, linkfile); + } + /* We might have added more relative paths -- remove them */ + remove_relative_paths (fullpath); + } + if (ret) + { + free(realpath); + goto RET; + } + /* Strip off the last segment of the path */ + if ((q = strrchr (fullpath, DIR_SEPARATOR))) + *q++ = '\0'; + else + q = fullpath; + + /* Shift realpath right to make room for new segment and slash */ + off = strlen (q) + 1; + len = strlen (realpath); + for (i = len; i >= 0; i--) + realpath [off + i] = realpath [i]; + + /* Copy new segment to realpath */ + s = q; + t = realpath + 1; + while (*s) + *t++ = *s++; + + /* Stick in separator at beginning of segment. */ + realpath[0] = DIR_SEPARATOR; + } + + /* Split executable name from path */ + p = strrchr (realpath, DIR_SEPARATOR); + *++p = '\0'; + + remove_relative_paths (realpath); + + /* Exclude trailing segments to get to the .../usr directory */ + /* cpp0 is located in the /usr/lib/gcc-lib// directory */ + /* all binaries are located in the /usr/bin */ + p = realpath; + for (i = 0; i< (is_cpp0 ? 5 : 2) ; i++) { + if (!(p = strrchr(realpath, '/'))) { + free(realpath); + goto RET; + } + *p = '\0'; + } + *ptr = realpath; + +RET: + free (fullpath); + free (linkfile); +} + +/* Replace the initial occurance of PREFIX by the specified prefix */ + +char * +replace (char *new_prefix, char *path) +{ + int len = strlen(PREFIX); + + if (strcmp(new_prefix, PREFIX) && + ! strncmp (path, PREFIX, len)) + { + char *new = (char *) xmalloc(strlen(new_prefix) + + strlen(path) - len + 1); + strcpy(new, new_prefix); + strcat(new, path + len); + return new; + } + return path; +} + +int +find_family_cpu(char **family_cpu) +{ + char *p; + int len; + + p = getenv("CROSS_COMPILE"); + if (p && *p) + { + p = basename(p); + len = strlen(p); + *family_cpu = xmalloc(len + 1); + strcpy(*family_cpu, p); + if ((*family_cpu)[len - 1] == '-') + (*family_cpu)[len - 1] = '\0'; + return 1; + } + return 0; +} diff -Naur gcc-2.95.3.old/gcc/gcc.c gcc-2.95.3/gcc/gcc.c --- gcc-2.95.3.old/gcc/gcc.c Mon Dec 18 18:01:52 2000 +++ gcc-2.95.3/gcc/gcc.c Mon May 27 07:05:27 2002 @@ -508,6 +508,12 @@ }; static struct user_specs *user_specs_head, *user_specs_tail; +char *cross_dir; +char *family_cpu; + +extern char *replace(char *, char *); +extern int find_family_cpu(char **); +static void cross_update_cpu(int *, char ***, char*); /* This defines which switch letters take arguments. */ @@ -3056,18 +3062,35 @@ (such as cpp) rather than those of the host system. */ /* Use 2 as fourth arg meaning try just the machine as a suffix, as well as trying the machine and the version. */ + if (cross_dir) + { +#ifndef OS2 + add_prefix (&exec_prefixes, + replace(cross_dir, standard_exec_prefix), + "BINUTILS", 0, 2, warn_std_ptr); + add_prefix (&exec_prefixes, + replace(cross_dir, standard_exec_prefix_1), + "BINUTILS", 0, 2, warn_std_ptr); +#endif + add_prefix (&startfile_prefixes, + replace(cross_dir, standard_exec_prefix), + "BINUTILS", 0, 1, warn_std_ptr); + add_prefix (&startfile_prefixes, + replace(cross_dir, standard_exec_prefix_1), + "BINUTILS", 0, 1, warn_std_ptr); + } + else { #ifndef OS2 - add_prefix (&exec_prefixes, standard_exec_prefix, "BINUTILS", - 0, 2, warn_std_ptr); - add_prefix (&exec_prefixes, standard_exec_prefix_1, "BINUTILS", - 0, 2, warn_std_ptr); + add_prefix (&exec_prefixes, standard_exec_prefix, "BINUTILS", + 0, 2, warn_std_ptr); + add_prefix (&exec_prefixes, standard_exec_prefix_1, "BINUTILS", + 0, 2, warn_std_ptr); #endif - add_prefix (&startfile_prefixes, standard_exec_prefix, "BINUTILS", 0, 1, warn_std_ptr); add_prefix (&startfile_prefixes, standard_exec_prefix_1, "BINUTILS", 0, 1, warn_std_ptr); - + } tooldir_prefix = concat (tooldir_base_prefix, spec_machine, dir_separator_str, NULL_PTR); @@ -3101,12 +3124,46 @@ dir_separator_str, tooldir_prefix, NULL_PTR); } - add_prefix (&exec_prefixes, - concat (tooldir_prefix, "bin", dir_separator_str, NULL_PTR), - "BINUTILS", 0, 0, NULL_PTR); - add_prefix (&startfile_prefixes, - concat (tooldir_prefix, "lib", dir_separator_str, NULL_PTR), - "BINUTILS", 0, 0, NULL_PTR); + if (cross_dir) { + add_prefix (&exec_prefixes, + concat (replace(cross_dir, tooldir_prefix), + "bin", dir_separator_str, NULL_PTR), + "BINUTILS", 0, 0, NULL_PTR); + add_prefix (&startfile_prefixes, + concat (replace(cross_dir, tooldir_prefix), + "lib", dir_separator_str, NULL_PTR), + "BINUTILS", 0, 0, NULL_PTR); + if (family_cpu && *family_cpu) + { + add_prefix (&startfile_prefixes, + concat (cross_dir, "/../", + family_cpu, "/lib/", NULL_PTR), + "BINUTILS", 0, 0, NULL_PTR); + add_prefix (&startfile_prefixes, + concat (cross_dir, "/../", + family_cpu, "/usr/lib/", NULL_PTR), + "BINUTILS", 0, 0, NULL_PTR); + } + + } else { + add_prefix (&exec_prefixes, + concat (tooldir_prefix, "bin", dir_separator_str, NULL_PTR), + "BINUTILS", 0, 0, NULL_PTR); + add_prefix (&startfile_prefixes, + concat (tooldir_prefix, "lib", dir_separator_str, NULL_PTR), + "BINUTILS", 0, 0, NULL_PTR); + if (family_cpu && *family_cpu) + { + add_prefix (&startfile_prefixes, + concat (tooldir_prefix, "/../../", + family_cpu, "/lib/", NULL_PTR), + "BINUTILS", 0, 0, NULL_PTR); + add_prefix (&startfile_prefixes, + concat (tooldir_prefix, "/../../", + family_cpu, "/usr/lib/", NULL_PTR), + "BINUTILS", 0, 0, NULL_PTR); + } + } /* More prefixes are enabled in main, after we read the specs file and determine whether this is cross-compilation or not. */ @@ -4652,6 +4709,10 @@ --p; programname = p; + if (! find_family_cpu(&family_cpu)) { + fatal("The CROSS_COMPILE environment variable is not set"); + } + #ifdef HAVE_LC_MESSAGES setlocale (LC_MESSAGES, ""); #endif @@ -4733,6 +4794,17 @@ temp_filename_length = strlen (temp_filename); #endif + /* Set new standard prefix to use instead of /cdt */ + find_cross_dir(argv[0], &cross_dir, 0); + if (cross_dir) { + set_std_prefix(cross_dir, strlen(cross_dir)); + } + /* If CROSS_COMPILE is defined and a user have not specified the + "-mcpu=..." option we must insert -mcpu= option + in the argv list + */ + cross_update_cpu(&argc, &argv, family_cpu); + /* Make a table of what switches there are (switches, n_switches). Make a table of specified input files (infiles, n_infiles). Decode switches that are handled locally. */ @@ -4922,7 +4994,10 @@ if (print_search_dirs) { - printf ("install: %s%s\n", standard_exec_prefix, machine_suffix); + if (cross_dir) + printf ("install: %s/lib/gcc-lib/%s\n", cross_dir, machine_suffix); + else + printf ("install: %s%s\n", standard_exec_prefix, machine_suffix); printf ("programs: %s\n", build_search_list (&exec_prefixes, "", 0)); printf ("libraries: %s\n", build_search_list (&startfile_prefixes, "", 0)); exit (0); diff -Naur gcc-2.95.3.old/gcc/glibc-include/bits/initspin.h gcc-2.95.3/gcc/glibc-include/bits/initspin.h --- gcc-2.95.3.old/gcc/glibc-include/bits/initspin.h Thu Jan 1 03:00:00 1970 +++ gcc-2.95.3/gcc/glibc-include/bits/initspin.h Mon May 27 07:05:27 2002 @@ -0,0 +1,28 @@ +/* Generic definitions for spinlock initializers. + Copyright (C) 2000, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library 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. + + The GNU C Library 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 the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* Initial value of a spinlock. Most platforms should use zero, + unless they only implement a "test and clear" operation instead of + the usual "test and set". */ +#define __LT_SPINLOCK_INIT 0 + +/* Macros for lock initializers, using the above definition. */ +#define __LOCK_INITIALIZER { 0, __LT_SPINLOCK_INIT } +#define __ALT_LOCK_INITIALIZER { 0, __LT_SPINLOCK_INIT } +#define __ATOMIC_INITIALIZER { 0, __LT_SPINLOCK_INIT } diff -Naur gcc-2.95.3.old/gcc/glibc-include/bits/pthreadtypes.h gcc-2.95.3/gcc/glibc-include/bits/pthreadtypes.h --- gcc-2.95.3.old/gcc/glibc-include/bits/pthreadtypes.h Thu Jan 1 03:00:00 1970 +++ gcc-2.95.3/gcc/glibc-include/bits/pthreadtypes.h Mon May 27 07:05:27 2002 @@ -0,0 +1,142 @@ +/* Linuxthreads - a simple clone()-based implementation of Posix */ +/* threads for Linux. */ +/* Copyright (C) 1996 Xavier Leroy (Xavier.Leroy@inria.fr) */ +/* */ +/* 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. */ + +#if !defined _BITS_TYPES_H && !defined _PTHREAD_H +# error "Never include directly; use instead." +#endif + +#ifndef _BITS_PTHREADTYPES_H +#define _BITS_PTHREADTYPES_H 1 + +#define __need_schedparam +#include + +/* Fast locks (not abstract because mutexes and conditions aren't abstract). */ +struct _pthread_fastlock +{ + long int __status; /* "Free" or "taken" or head of waiting list */ + int __spinlock; /* Used by compare_and_swap emulation. Also, + adaptive SMP lock stores spin count here. */ +}; + +#ifndef _PTHREAD_DESCR_DEFINED +/* Thread descriptors */ +typedef struct _pthread_descr_struct *_pthread_descr; +# define _PTHREAD_DESCR_DEFINED +#endif + + +/* Attributes for threads. */ +typedef struct __pthread_attr_s +{ + int __detachstate; + int __schedpolicy; + struct __sched_param __schedparam; + int __inheritsched; + int __scope; + size_t __guardsize; + int __stackaddr_set; + void *__stackaddr; + size_t __stacksize; +} pthread_attr_t; + + +/* Conditions (not abstract because of PTHREAD_COND_INITIALIZER */ +typedef struct +{ + struct _pthread_fastlock __c_lock; /* Protect against concurrent access */ + _pthread_descr __c_waiting; /* Threads waiting on this condition */ +} pthread_cond_t; + + +/* Attribute for conditionally variables. */ +typedef struct +{ + int __dummy; +} pthread_condattr_t; + +/* Keys for thread-specific data */ +typedef unsigned int pthread_key_t; + + +/* Mutexes (not abstract because of PTHREAD_MUTEX_INITIALIZER). */ +/* (The layout is unnatural to maintain binary compatibility + with earlier releases of LinuxThreads.) */ +typedef struct +{ + int __m_reserved; /* Reserved for future use */ + int __m_count; /* Depth of recursive locking */ + _pthread_descr __m_owner; /* Owner thread (if recursive or errcheck) */ + int __m_kind; /* Mutex kind: fast, recursive or errcheck */ + struct _pthread_fastlock __m_lock; /* Underlying fast lock */ +} pthread_mutex_t; + + +/* Attribute for mutex. */ +typedef struct +{ + int __mutexkind; +} pthread_mutexattr_t; + + +/* Once-only execution */ +typedef int pthread_once_t; + + +#ifdef __USE_UNIX98 +/* Read-write locks. */ +typedef struct _pthread_rwlock_t +{ + struct _pthread_fastlock __rw_lock; /* Lock to guarantee mutual exclusion */ + int __rw_readers; /* Number of readers */ + _pthread_descr __rw_writer; /* Identity of writer, or NULL if none */ + _pthread_descr __rw_read_waiting; /* Threads waiting for reading */ + _pthread_descr __rw_write_waiting; /* Threads waiting for writing */ + int __rw_kind; /* Reader/Writer preference selection */ + int __rw_pshared; /* Shared between processes or not */ +} pthread_rwlock_t; + + +/* Attribute for read-write locks. */ +typedef struct +{ + int __lockkind; + int __pshared; +} pthread_rwlockattr_t; +#endif + +#ifdef __USE_XOPEN2K +/* POSIX spinlock data type. */ +typedef volatile int pthread_spinlock_t; + +/* POSIX barrier. */ +typedef struct { + struct _pthread_fastlock __ba_lock; /* Lock to guarantee mutual exclusion */ + int __ba_required; /* Threads needed for completion */ + int __ba_present; /* Threads waiting */ + _pthread_descr __ba_waiting; /* Queue of waiting threads */ +} pthread_barrier_t; + +/* barrier attribute */ +typedef struct { + int __pshared; +} pthread_barrierattr_t; + +#endif + + +/* Thread identifiers */ +typedef unsigned long int pthread_t; + +#endif /* bits/pthreadtypes.h */ diff -Naur gcc-2.95.3.old/gcc/glibc-include/bits/sched.h gcc-2.95.3/gcc/glibc-include/bits/sched.h --- gcc-2.95.3.old/gcc/glibc-include/bits/sched.h Thu Jan 1 03:00:00 1970 +++ gcc-2.95.3/gcc/glibc-include/bits/sched.h Mon May 27 07:05:27 2002 @@ -0,0 +1,73 @@ +/* Definitions of constants and data structure for POSIX 1003.1b-1993 + scheduling interface. + Copyright (C) 1996, 1997, 1998, 1999, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library 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. + + The GNU C Library 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 the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef __need_schedparam + +#ifndef _SCHED_H +# error "Never include directly; use instead." +#endif + + +/* Scheduling algorithms. */ +#define SCHED_OTHER 0 +#define SCHED_FIFO 1 +#define SCHED_RR 2 + +#ifdef __USE_MISC +/* Cloning flags. */ +# define CSIGNAL 0x000000ff /* Signal mask to be sent at exit. */ +# define CLONE_VM 0x00000100 /* Set if VM shared between processes. */ +# define CLONE_FS 0x00000200 /* Set if fs info shared between processes. */ +# define CLONE_FILES 0x00000400 /* Set if open files shared between processes. */ +# define CLONE_SIGHAND 0x00000800 /* Set if signal handlers shared. */ +# define CLONE_PID 0x00001000 /* Set if pid shared. */ +# define CLONE_PTRACE 0x00002000 /* Set if tracing continues on the child. */ +# define CLONE_VFORK 0x00004000 /* Set if the parent wants the child to + wake it up on mm_release. */ +#endif + +/* The official definition. */ +struct sched_param + { + int __sched_priority; + }; + +__BEGIN_DECLS + +/* Clone current process. */ +#ifdef __USE_MISC +extern int clone (int (*__fn) (void *__arg), void *__child_stack, + int __flags, void *__arg) __THROW; +#endif + +__END_DECLS + +#endif /* need schedparam */ + +#if !defined __defined_schedparam \ + && (defined __need_schedparam || defined _SCHED_H) +# define __defined_schedparam 1 +/* Data structure to describe a process' schedulability. */ +struct __sched_param + { + int __sched_priority; + }; +# undef __need_schedparam +#endif diff -Naur gcc-2.95.3.old/gcc/glibc-include/bits/sigset.h gcc-2.95.3/gcc/glibc-include/bits/sigset.h --- gcc-2.95.3.old/gcc/glibc-include/bits/sigset.h Thu Jan 1 03:00:00 1970 +++ gcc-2.95.3/gcc/glibc-include/bits/sigset.h Mon May 27 07:05:27 2002 @@ -0,0 +1,125 @@ +/* __sig_atomic_t, __sigset_t, and related definitions. Linux version. + Copyright (C) 1991, 1992, 1994, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library 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. + + The GNU C Library 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 the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SIGSET_H_types +# define _SIGSET_H_types 1 + +typedef int __sig_atomic_t; + +/* A `sigset_t' has a bit for each signal. */ + +# define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) +typedef struct + { + unsigned long int __val[_SIGSET_NWORDS]; + } __sigset_t; + +#endif + + +/* We only want to define these functions if was actually + included; otherwise we were included just to define the types. Since we + are namespace-clean, it wouldn't hurt to define extra macros. But + trouble can be caused by functions being defined (e.g., any global + register vars declared later will cause compilation errors). */ + +#if !defined _SIGSET_H_fns && defined _SIGNAL_H +# define _SIGSET_H_fns 1 + +# ifndef _EXTERN_INLINE +# define _EXTERN_INLINE extern __inline +# endif + +/* Return a mask that includes the bit for SIG only. */ +# define __sigmask(sig) \ + (((unsigned long int) 1) << (((sig) - 1) % (8 * sizeof (unsigned long int)))) + +/* Return the word index for SIG. */ +# define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned long int))) + +# if defined __GNUC__ && __GNUC__ >= 2 +# define __sigemptyset(set) \ + (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ + sigset_t *__set = (set); \ + while (--__cnt >= 0) __set->__val[__cnt] = 0; \ + 0; })) +# define __sigfillset(set) \ + (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ + sigset_t *__set = (set); \ + while (--__cnt >= 0) __set->__val[__cnt] = ~0UL; \ + 0; })) + +# ifdef __USE_GNU +/* The POSIX does not specify for handling the whole signal set in one + command. This is often wanted and so we define three more functions + here. */ +# define __sigisemptyset(set) \ + (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ + const sigset_t *__set = (set); \ + int __ret = __set->__val[--__cnt]; \ + while (!__ret && --__cnt >= 0) \ + __ret = __set->__val[__cnt]; \ + __ret == 0; })) +# define __sigandset(dest, left, right) \ + (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ + sigset_t *__dest = (dest); \ + const sigset_t *__left = (left); \ + const sigset_t *__right = (right); \ + while (--__cnt >= 0) \ + __dest->__val[__cnt] = (__left->__val[__cnt] \ + & __right->__val[__cnt]); \ + 0; })) +# define __sigorset(dest, left, right) \ + (__extension__ ({ int __cnt = _SIGSET_NWORDS; \ + sigset_t *__dest = (dest); \ + const sigset_t *__left = (left); \ + const sigset_t *__right = (right); \ + while (--__cnt >= 0) \ + __dest->__val[__cnt] = (__left->__val[__cnt] \ + | __right->__val[__cnt]); \ + 0; })) +# endif +# endif + +/* These functions needn't check for a bogus signal number -- error + checking is done in the non __ versions. */ + +extern int __sigismember (__const __sigset_t *, int); +extern int __sigaddset (__sigset_t *, int); +extern int __sigdelset (__sigset_t *, int); + +# ifdef __USE_EXTERN_INLINES +# define __SIGSETFN(NAME, BODY, CONST) \ + _EXTERN_INLINE int \ + NAME (CONST __sigset_t *__set, int __sig) \ + { \ + unsigned long int __mask = __sigmask (__sig); \ + unsigned long int __word = __sigword (__sig); \ + return BODY; \ + } + +__SIGSETFN (__sigismember, (__set->__val[__word] & __mask) ? 1 : 0, __const) +__SIGSETFN (__sigaddset, ((__set->__val[__word] |= __mask), 0), ) +__SIGSETFN (__sigdelset, ((__set->__val[__word] &= ~__mask), 0), ) + +# undef __SIGSETFN +# endif + + +#endif /* ! _SIGSET_H_fns. */ diff -Naur gcc-2.95.3.old/gcc/glibc-include/bits/sigthread.h gcc-2.95.3/gcc/glibc-include/bits/sigthread.h --- gcc-2.95.3.old/gcc/glibc-include/bits/sigthread.h Thu Jan 1 03:00:00 1970 +++ gcc-2.95.3/gcc/glibc-include/bits/sigthread.h Mon May 27 07:05:27 2002 @@ -0,0 +1,38 @@ +/* Signal handling function for threaded programs. + Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library 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. + + The GNU C Library 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 the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _BITS_SIGTHREAD_H +#define _BITS_SIGTHREAD_H 1 + +#if !defined _SIGNAL_H && !defined _PTHREAD_H +# error "Never include this file directly. Use instead" +#endif + +/* Functions for handling signals. */ + +/* Modify the signal mask for the calling thread. The arguments have + the same meaning as for sigprocmask(2). */ +extern int pthread_sigmask (int __how, + __const __sigset_t *__restrict __newmask, + __sigset_t *__restrict __oldmask)__THROW; + +/* Send signal SIGNO to the given thread. */ +extern int pthread_kill (pthread_t __thread, int __signo) __THROW; + +#endif /* bits/sigthread.h */ diff -Naur gcc-2.95.3.old/gcc/glibc-include/bits/time.h gcc-2.95.3/gcc/glibc-include/bits/time.h --- gcc-2.95.3.old/gcc/glibc-include/bits/time.h Thu Jan 1 03:00:00 1970 +++ gcc-2.95.3/gcc/glibc-include/bits/time.h Mon May 27 07:05:27 2002 @@ -0,0 +1,73 @@ +/* System-dependent timing definitions. Linux/x86 version. + Copyright (C) 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library 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. + + The GNU C Library 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 the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef __need_timeval +# ifndef _BITS_TIME_H +# define _BITS_TIME_H 1 + +/* ISO/IEC 9899:1990 7.12.1: + The macro `CLOCKS_PER_SEC' is the number per second of the value + returned by the `clock' function. */ +/* CAE XSH, Issue 4, Version 2: + The value of CLOCKS_PER_SEC is required to be 1 million on all + XSI-conformant systems. */ +# define CLOCKS_PER_SEC 1000000l + +# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K +/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK + presents the real value for clock ticks per second for the system. */ +# include +extern long int __sysconf (int); +# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */ +# endif + +# ifdef __USE_POSIX199309 +/* Identifier for system-wide realtime clock. */ +# define CLOCK_REALTIME 0 +/* High-resolution timer from the CPU. */ +# define CLOCK_PROCESS_CPUTIME_ID 2 +/* Thread-specific CPU-time clock. */ +# define CLOCK_THREAD_CPUTIME_ID 3 + +/* Flag to indicate time is absolute. */ +# define TIMER_ABSTIME 1 +# endif + +# endif /* bits/time.h */ +#endif + +#ifdef __need_timeval +# undef __need_timeval +# ifndef _STRUCT_TIMEVAL +# define _STRUCT_TIMEVAL 1 +# include + +/* A time value that is accurate to the nearest + microsecond but also has a range of years. */ +struct timeval + { + __time_t tv_sec; /* Seconds. */ + __suseconds_t tv_usec; /* Microseconds. */ + }; +# endif /* struct timeval */ +#endif /* need timeval */ diff -Naur gcc-2.95.3.old/gcc/glibc-include/bits/types.h gcc-2.95.3/gcc/glibc-include/bits/types.h --- gcc-2.95.3.old/gcc/glibc-include/bits/types.h Thu Jan 1 03:00:00 1970 +++ gcc-2.95.3/gcc/glibc-include/bits/types.h Mon May 27 07:05:27 2002 @@ -0,0 +1,146 @@ +/* Copyright (C) 1991,92,1994-1999,2000,2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library 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. + + The GNU C Library 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 the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef _BITS_TYPES_H +#define _BITS_TYPES_H 1 + +#include + +#define __need_size_t +#include + +/* Convenience types. */ +typedef unsigned char __u_char; +typedef unsigned short __u_short; +typedef unsigned int __u_int; +typedef unsigned long __u_long; +#ifdef __GNUC__ +__extension__ typedef unsigned long long int __u_quad_t; +__extension__ typedef long long int __quad_t; +#else +typedef struct + { + long int __val[2]; + } __quad_t; +typedef struct + { + __u_long __val[2]; + } __u_quad_t; +#endif +typedef signed char __int8_t; +typedef unsigned char __uint8_t; +typedef signed short int __int16_t; +typedef unsigned short int __uint16_t; +typedef signed int __int32_t; +typedef unsigned int __uint32_t; +#ifdef __GNUC__ +__extension__ typedef signed long long int __int64_t; +__extension__ typedef unsigned long long int __uint64_t; +#endif +typedef __quad_t *__qaddr_t; + +typedef __u_quad_t __dev_t; /* Type of device numbers. */ +typedef __u_int __uid_t; /* Type of user identifications. */ +typedef __u_int __gid_t; /* Type of group identifications. */ +typedef __u_long __ino_t; /* Type of file serial numbers. */ +typedef __u_int __mode_t; /* Type of file attribute bitmasks. */ +typedef __u_int __nlink_t; /* Type of file link counts. */ +typedef long int __off_t; /* Type of file sizes and offsets. */ +typedef __quad_t __loff_t; /* Type of file sizes and offsets. */ +typedef int __pid_t; /* Type of process identifications. */ +typedef int __ssize_t; /* Type of a byte count, or error. */ +typedef __u_long __rlim_t; /* Type of resource counts. */ +typedef __u_quad_t __rlim64_t; /* Type of resource counts (LFS). */ +typedef __u_int __id_t; /* General type for ID. */ + +typedef struct + { + int __val[2]; + } __fsid_t; /* Type of file system IDs. */ + +/* Everythin' else. */ +typedef int __daddr_t; /* The type of a disk address. */ +typedef char *__caddr_t; +typedef long int __time_t; +typedef unsigned int __useconds_t; +typedef long int __suseconds_t; +typedef long int __swblk_t; /* Type of a swap block maybe? */ + +typedef long int __clock_t; + +/* Clock ID used in clock and timer functions. */ +typedef int __clockid_t; + +/* Timer ID returned by `timer_create'. */ +typedef int __timer_t; + + +/* Number of descriptors that can fit in an `fd_set'. */ +#define __FD_SETSIZE 1024 + + +typedef int __key_t; + +/* Used in `struct shmid_ds'. */ +typedef unsigned short int __ipc_pid_t; + + +/* Type to represent block size. */ +typedef long int __blksize_t; + +/* Types from the Large File Support interface. */ + +/* Type to count number os disk blocks. */ +typedef long int __blkcnt_t; +typedef __quad_t __blkcnt64_t; + +/* Type to count file system blocks. */ +typedef __u_long __fsblkcnt_t; +typedef __u_quad_t __fsblkcnt64_t; + +/* Type to count file system inodes. */ +typedef __u_long __fsfilcnt_t; +typedef __u_quad_t __fsfilcnt64_t; + +/* Type of file serial numbers. */ +typedef __u_quad_t __ino64_t; + +/* Type of file sizes and offsets. */ +typedef __loff_t __off64_t; + +/* Used in XTI. */ +typedef long int __t_scalar_t; +typedef unsigned long int __t_uscalar_t; + +/* Duplicates info from stdint.h but this is used in unistd.h. */ +typedef int __intptr_t; + +/* Duplicate info from sys/socket.h. */ +typedef unsigned int __socklen_t; + + +/* Now add the thread types. */ +#if defined __USE_POSIX199506 || defined __USE_UNIX98 +# include +#endif + +#endif /* bits/types.h */ diff -Naur gcc-2.95.3.old/gcc/glibc-include/features.h gcc-2.95.3/gcc/glibc-include/features.h --- gcc-2.95.3.old/gcc/glibc-include/features.h Thu Jan 1 03:00:00 1970 +++ gcc-2.95.3/gcc/glibc-include/features.h Mon May 27 07:05:27 2002 @@ -0,0 +1,314 @@ +/* Copyright (C) 1991,92,93,95,96,97,98,99, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library 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. + + The GNU C Library 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 the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _FEATURES_H +#define _FEATURES_H 1 + +/* These are defined by the user (or the compiler) + to specify the desired environment: + + __STRICT_ANSI__ ISO Standard C. + _ISOC99_SOURCE Extensions to ISO C89 from ISO C99. + _POSIX_SOURCE IEEE Std 1003.1. + _POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2; + if >=199309L, add IEEE Std 1003.1b-1993; + if >=199506L, add IEEE Std 1003.1c-1995 + _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if + Single Unix conformance is wanted, to 600 for the + upcoming sixth revision. + _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions. + _LARGEFILE_SOURCE Some more functions for correct standard I/O. + _LARGEFILE64_SOURCE Additional functionality from LFS for large files. + _FILE_OFFSET_BITS=N Select default filesystem interface. + _BSD_SOURCE ISO C, POSIX, and 4.3BSD things. + _SVID_SOURCE ISO C, POSIX, and SVID things. + _GNU_SOURCE All of the above, plus GNU extensions. + _REENTRANT Select additionally reentrant object. + _THREAD_SAFE Same as _REENTRANT, often used by other systems. + + The `-ansi' switch to the GNU C compiler defines __STRICT_ANSI__. + If none of these are defined, the default is to have _SVID_SOURCE, + _BSD_SOURCE, and _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to + 199506L. If more than one of these are defined, they accumulate. + For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE + together give you ISO C, 1003.1, and 1003.2, but nothing else. + + These are defined by this file and are used by the + header files to decide what to declare or define: + + __USE_ISOC99 Define ISO C99 things. + __USE_POSIX Define IEEE Std 1003.1 things. + __USE_POSIX2 Define IEEE Std 1003.2 things. + __USE_POSIX199309 Define IEEE Std 1003.1, and .1b things. + __USE_POSIX199506 Define IEEE Std 1003.1, .1b, .1c and .1i things. + __USE_XOPEN Define XPG things. + __USE_XOPEN_EXTENDED Define X/Open Unix things. + __USE_UNIX98 Define Single Unix V2 things. + __USE_XOPEN2K Define XPG6 things. + __USE_LARGEFILE Define correct standard I/O things. + __USE_LARGEFILE64 Define LFS things with separate names. + __USE_FILE_OFFSET64 Define 64bit interface as default. + __USE_BSD Define 4.3BSD things. + __USE_SVID Define SVID things. + __USE_MISC Define things common to BSD and System V Unix. + __USE_GNU Define GNU extensions. + __USE_REENTRANT Define reentrant/thread-safe *_r functions. + __FAVOR_BSD Favor 4.3BSD things in cases of conflict. + + The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are + defined by this file unconditionally. `__GNU_LIBRARY__' is provided + only for compatibility. All new code should use the other symbols + to test for features. + + All macros listed above as possibly being defined by this file are + explicitly undefined if they are not explicitly defined. + Feature-test macros that are not defined by the user or compiler + but are implied by the other feature-test macros defined (or by the + lack of any definitions) are defined by the file. */ + + +/* Undefine everything, so we get a clean slate. */ +#undef __USE_ISOC99 +#undef __USE_POSIX +#undef __USE_POSIX2 +#undef __USE_POSIX199309 +#undef __USE_POSIX199506 +#undef __USE_XOPEN +#undef __USE_XOPEN_EXTENDED +#undef __USE_UNIX98 +#undef __USE_XOPEN2K +#undef __USE_LARGEFILE +#undef __USE_LARGEFILE64 +#undef __USE_FILE_OFFSET64 +#undef __USE_BSD +#undef __USE_SVID +#undef __USE_MISC +#undef __USE_GNU +#undef __USE_REENTRANT +#undef __FAVOR_BSD +#undef __KERNEL_STRICT_NAMES + +/* Suppress kernel-name space pollution unless user expressedly asks + for it. */ +#ifndef _LOOSE_KERNEL_NAMES +# define __KERNEL_STRICT_NAMES +#endif + +/* Always use ISO C things. */ +#define __USE_ANSI 1 + + +/* If _BSD_SOURCE was defined by the user, favor BSD over POSIX. */ +#if defined _BSD_SOURCE && \ + !(defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || \ + defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_EXTENDED || \ + defined _GNU_SOURCE || defined _SVID_SOURCE) +# define __FAVOR_BSD 1 +#endif + +/* If _GNU_SOURCE was defined by the user, turn on all the other features. */ +#ifdef _GNU_SOURCE +# undef _ISOC99_SOURCE +# define _ISOC99_SOURCE 1 +# undef _POSIX_SOURCE +# define _POSIX_SOURCE 1 +# undef _POSIX_C_SOURCE +# define _POSIX_C_SOURCE 199506L +# undef _XOPEN_SOURCE +# define _XOPEN_SOURCE 600 +# undef _XOPEN_SOURCE_EXTENDED +# define _XOPEN_SOURCE_EXTENDED 1 +# undef _LARGEFILE64_SOURCE +# define _LARGEFILE64_SOURCE 1 +# undef _BSD_SOURCE +# define _BSD_SOURCE 1 +# undef _SVID_SOURCE +# define _SVID_SOURCE 1 +#endif + +/* If nothing (other than _GNU_SOURCE) is defined, + define _BSD_SOURCE and _SVID_SOURCE. */ +#if (!defined __STRICT_ANSI__ && !defined _ISOC99_SOURCE && \ + !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE && \ + !defined _XOPEN_SOURCE && !defined _XOPEN_SOURCE_EXTENDED && \ + !defined _BSD_SOURCE && !defined _SVID_SOURCE) +# define _BSD_SOURCE 1 +# define _SVID_SOURCE 1 +#endif + +/* This is to enable the ISO C99 extension. Also recognize the old macro + which was used prior to the standard acceptance. This macro will + eventually go away and the features enabled by default once the ISO C99 + standard is widely adopted. */ +#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \ + || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) +# define __USE_ISOC99 1 +#endif + +/* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2 + (and IEEE Std 1003.1b-1993 unless _XOPEN_SOURCE is defined). */ +#if (!defined __STRICT_ANSI__ && !defined _POSIX_SOURCE && \ + !defined _POSIX_C_SOURCE) +# define _POSIX_SOURCE 1 +# if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 500 +# define _POSIX_C_SOURCE 2 +# else +# define _POSIX_C_SOURCE 199506L +# endif +#endif + +#if defined _POSIX_SOURCE || _POSIX_C_SOURCE >= 1 || defined _XOPEN_SOURCE +# define __USE_POSIX 1 +#endif + +#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE +# define __USE_POSIX2 1 +#endif + +#if (_POSIX_C_SOURCE - 0) >= 199309L +# define __USE_POSIX199309 1 +#endif + +#if (_POSIX_C_SOURCE - 0) >= 199506L +# define __USE_POSIX199506 1 +#endif + +#ifdef _XOPEN_SOURCE +# define __USE_XOPEN 1 +# if (_XOPEN_SOURCE - 0) >= 500 +# define __USE_XOPEN_EXTENDED 1 +# define __USE_UNIX98 1 +# undef _LARGEFILE_SOURCE +# define _LARGEFILE_SOURCE 1 +# if (_XOPEN_SOURCE - 0) >= 600 +# define __USE_XOPEN2K 1 +# undef __USE_ISOC99 +# define __USE_ISOC99 1 +# endif +# else +# ifdef _XOPEN_SOURCE_EXTENDED +# define __USE_XOPEN_EXTENDED 1 +# endif +# endif +#endif + +#ifdef _LARGEFILE_SOURCE +# define __USE_LARGEFILE 1 +#endif + +#ifdef _LARGEFILE64_SOURCE +# define __USE_LARGEFILE64 1 +#endif + +#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 +# define __USE_FILE_OFFSET64 1 +#endif + +#if defined _BSD_SOURCE || defined _SVID_SOURCE +# define __USE_MISC 1 +#endif + +#ifdef _BSD_SOURCE +# define __USE_BSD 1 +#endif + +#ifdef _SVID_SOURCE +# define __USE_SVID 1 +#endif + +#ifdef _GNU_SOURCE +# define __USE_GNU 1 +#endif + +#if defined _REENTRANT || defined _THREAD_SAFE +# define __USE_REENTRANT 1 +#endif + +/* We do support the IEC 559 math functionality, real and complex. */ +#define __STDC_IEC_559__ 1 +#define __STDC_IEC_559_COMPLEX__ 1 + +/* wchar_t uses ISO 10646-1 (2nd ed., published 2000-09-15) / Unicode 3.0. */ +#define __STDC_ISO_10646__ 200009L + +/* This macro indicates that the installed library is the GNU C Library. + For historic reasons the value now is 6 and this will stay from now + on. The use of this variable is deprecated. Use __GLIBC__ and + __GLIBC_MINOR__ now (see below) when you want to test for a specific + GNU C library version and use the values in to get + the sonames of the shared libraries. */ +#undef __GNU_LIBRARY__ +#define __GNU_LIBRARY__ 6 + +/* Major and minor version number of the GNU C library package. Use + these macros to test for features in specific releases. */ +#define __GLIBC__ 2 +#define __GLIBC_MINOR__ 2 + +/* Convenience macros to test the versions of glibc and gcc. + Use them like this: + #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 + were not defined then. */ +#if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +#else +# define __GNUC_PREREQ(maj, min) 0 +#endif + +#define __GLIBC_PREREQ(maj, min) \ + ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) + +/* This is here only because every header file already includes this one. */ +#ifndef __ASSEMBLER__ +#ifndef _SYS_CDEFS_H +# include +#endif + +/* If we don't have __REDIRECT, prototypes will be missing if + __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */ +# if defined __USE_FILE_OFFSET64 && !defined __REDIRECT +# define __USE_LARGEFILE 1 +# define __USE_LARGEFILE64 1 +# endif + +#endif /* !ASSEMBLER */ + +/* Decide whether we can define 'extern inline' functions in headers. */ +#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ +# define __USE_EXTERN_INLINES 1 +#endif + +/* This is here only because every header file already includes this one. */ +#ifndef _LIBC +/* Get the definitions of all the appropriate `__stub_FUNCTION' symbols. + contains `#define __stub_FUNCTION' when FUNCTION is a stub + which will always return failure (and set errno to ENOSYS). + + We avoid including when compiling the C library itself to + avoid a dependency loop. stubs.h depends on every object file. If + this #include were done for the library source code, then every object + file would depend on stubs.h. */ + +# include +#endif + +#endif /* features.h */ diff -Naur gcc-2.95.3.old/gcc/glibc-include/gnu/stubs.h gcc-2.95.3/gcc/glibc-include/gnu/stubs.h --- gcc-2.95.3.old/gcc/glibc-include/gnu/stubs.h Thu Jan 1 03:00:00 1970 +++ gcc-2.95.3/gcc/glibc-include/gnu/stubs.h Mon May 27 07:05:27 2002 @@ -0,0 +1,24 @@ +/* This file is automatically generated. + It defines a symbol `__stub_FUNCTION' for each function + in the C library which is a stub, meaning it will fail + every time called, usually setting errno to ENOSYS. */ +#define __stub___kernel_cosl +#define __stub___kernel_sinl +#define __stub___kernel_tanl +#define __stub_chflags +#define __stub_fattach +#define __stub_fchflags +#define __stub_fdetach +#define __stub_fexecve +#define __stub_getcontext +#define __stub_gtty +#define __stub_makecontext +#define __stub_posix_fadvise +#define __stub_posix_fadvise64 +#define __stub_revoke +#define __stub_setcontext +#define __stub_setlogin +#define __stub_sigreturn +#define __stub_sstk +#define __stub_stty +#define __stub_swapcontext diff -Naur gcc-2.95.3.old/gcc/glibc-include/pthread.h gcc-2.95.3/gcc/glibc-include/pthread.h --- gcc-2.95.3.old/gcc/glibc-include/pthread.h Thu Jan 1 03:00:00 1970 +++ gcc-2.95.3/gcc/glibc-include/pthread.h Mon May 27 07:05:27 2002 @@ -0,0 +1,682 @@ +/* Linuxthreads - a simple clone()-based implementation of Posix */ +/* threads for Linux. */ +/* Copyright (C) 1996 Xavier Leroy (Xavier.Leroy@inria.fr) */ +/* */ +/* 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. */ + +#ifndef _PTHREAD_H +#define _PTHREAD_H 1 + +#include + +#include +#include + +#define __need_sigset_t +#include +#include +#include + + +__BEGIN_DECLS + +/* Initializers. */ + +#define PTHREAD_MUTEX_INITIALIZER \ + {0, 0, 0, PTHREAD_MUTEX_TIMED_NP, __LOCK_INITIALIZER} +#ifdef __USE_GNU +# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ + {0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, __LOCK_INITIALIZER} +# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ + {0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, __LOCK_INITIALIZER} +# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \ + {0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, __LOCK_INITIALIZER} +#endif + +#define PTHREAD_COND_INITIALIZER {__LOCK_INITIALIZER, 0} + +#ifdef __USE_UNIX98 +# define PTHREAD_RWLOCK_INITIALIZER \ + { __LOCK_INITIALIZER, 0, NULL, NULL, NULL, \ + PTHREAD_RWLOCK_DEFAULT_NP, PTHREAD_PROCESS_PRIVATE } +#endif +#ifdef __USE_GNU +# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ + { __LOCK_INITIALIZER, 0, NULL, NULL, NULL, \ + PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, PTHREAD_PROCESS_PRIVATE } +#endif + +/* Values for attributes. */ + +enum +{ + PTHREAD_CREATE_JOINABLE, +#define PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_JOINABLE + PTHREAD_CREATE_DETACHED +#define PTHREAD_CREATE_DETACHED PTHREAD_CREATE_DETACHED +}; + +enum +{ + PTHREAD_INHERIT_SCHED, +#define PTHREAD_INHERIT_SCHED PTHREAD_INHERIT_SCHED + PTHREAD_EXPLICIT_SCHED +#define PTHREAD_EXPLICIT_SCHED PTHREAD_EXPLICIT_SCHED +}; + +enum +{ + PTHREAD_SCOPE_SYSTEM, +#define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_SYSTEM + PTHREAD_SCOPE_PROCESS +#define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_PROCESS +}; + +enum +{ + PTHREAD_MUTEX_TIMED_NP, + PTHREAD_MUTEX_RECURSIVE_NP, + PTHREAD_MUTEX_ERRORCHECK_NP, + PTHREAD_MUTEX_ADAPTIVE_NP +#ifdef __USE_UNIX98 + , + PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP, + PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, + PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, + PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL +#endif +#ifdef __USE_GNU + /* For compatibility. */ + , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_ADAPTIVE_NP +#endif +}; + +enum +{ + PTHREAD_PROCESS_PRIVATE, +#define PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE + PTHREAD_PROCESS_SHARED +#define PTHREAD_PROCESS_SHARED PTHREAD_PROCESS_SHARED +}; + +#ifdef __USE_UNIX98 +enum +{ + PTHREAD_RWLOCK_PREFER_READER_NP, + PTHREAD_RWLOCK_PREFER_WRITER_NP, + PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, + PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_WRITER_NP +}; +#endif /* Unix98 */ + +#define PTHREAD_ONCE_INIT 0 + +/* Special constants */ + +#ifdef __USE_XOPEN2K +/* -1 is distinct from 0 and all errno constants */ +# define PTHREAD_BARRIER_SERIAL_THREAD -1 +#endif + +/* Cleanup buffers */ + +struct _pthread_cleanup_buffer +{ + void (*__routine) (void *); /* Function to call. */ + void *__arg; /* Its argument. */ + int __canceltype; /* Saved cancellation type. */ + struct _pthread_cleanup_buffer *__prev; /* Chaining of cleanup functions. */ +}; + +/* Cancellation */ + +enum +{ + PTHREAD_CANCEL_ENABLE, +#define PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_ENABLE + PTHREAD_CANCEL_DISABLE +#define PTHREAD_CANCEL_DISABLE PTHREAD_CANCEL_DISABLE +}; +enum +{ + PTHREAD_CANCEL_DEFERRED, +#define PTHREAD_CANCEL_DEFERRED PTHREAD_CANCEL_DEFERRED + PTHREAD_CANCEL_ASYNCHRONOUS +#define PTHREAD_CANCEL_ASYNCHRONOUS PTHREAD_CANCEL_ASYNCHRONOUS +}; +#define PTHREAD_CANCELED ((void *) -1) + + +/* Function for handling threads. */ + +/* Create a thread with given attributes ATTR (or default attributes + if ATTR is NULL), and call function START_ROUTINE with given + arguments ARG. */ +extern int pthread_create (pthread_t *__restrict __thread, + __const pthread_attr_t *__restrict __attr, + void *(*__start_routine) (void *), + void *__restrict __arg) __THROW; + +/* Obtain the identifier of the current thread. */ +extern pthread_t pthread_self (void) __THROW; + +/* Compare two thread identifiers. */ +extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __THROW; + +/* Terminate calling thread. */ +extern void pthread_exit (void *__retval) + __THROW __attribute__ ((__noreturn__)); + +/* Make calling thread wait for termination of the thread TH. The + exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN + is not NULL. */ +extern int pthread_join (pthread_t __th, void **__thread_return) __THROW; + +/* Indicate that the thread TH is never to be joined with PTHREAD_JOIN. + The resources of TH will therefore be freed immediately when it + terminates, instead of waiting for another thread to perform PTHREAD_JOIN + on it. */ +extern int pthread_detach (pthread_t __th) __THROW; + + +/* Functions for handling attributes. */ + +/* Initialize thread attribute *ATTR with default attributes + (detachstate is PTHREAD_JOINABLE, scheduling policy is SCHED_OTHER, + no user-provided stack). */ +extern int pthread_attr_init (pthread_attr_t *__attr) __THROW; + +/* Destroy thread attribute *ATTR. */ +extern int pthread_attr_destroy (pthread_attr_t *__attr) __THROW; + +/* Set the `detachstate' attribute in *ATTR according to DETACHSTATE. */ +extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, + int __detachstate) __THROW; + +/* Return in *DETACHSTATE the `detachstate' attribute in *ATTR. */ +extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr, + int *__detachstate) __THROW; + +/* Set scheduling parameters (priority, etc) in *ATTR according to PARAM. */ +extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, + __const struct sched_param *__restrict + __param) __THROW; + +/* Return in *PARAM the scheduling parameters of *ATTR. */ +extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict + __attr, + struct sched_param *__restrict __param) + __THROW; + +/* Set scheduling policy in *ATTR according to POLICY. */ +extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy) + __THROW; + +/* Return in *POLICY the scheduling policy of *ATTR. */ +extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict + __attr, int *__restrict __policy) + __THROW; + +/* Set scheduling inheritance mode in *ATTR according to INHERIT. */ +extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, + int __inherit) __THROW; + +/* Return in *INHERIT the scheduling inheritance mode of *ATTR. */ +extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict + __attr, int *__restrict __inherit) + __THROW; + +/* Set scheduling contention scope in *ATTR according to SCOPE. */ +extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope) + __THROW; + +/* Return in *SCOPE the scheduling contention scope of *ATTR. */ +extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr, + int *__restrict __scope) __THROW; + +#ifdef __USE_UNIX98 +/* Set the size of the guard area at the bottom of the thread. */ +extern int pthread_attr_setguardsize (pthread_attr_t *__attr, + size_t __guardsize) __THROW; + +/* Get the size of the guard area at the bottom of the thread. */ +extern int pthread_attr_getguardsize (__const pthread_attr_t *__restrict + __attr, size_t *__restrict __guardsize) + __THROW; +#endif + +/* Set the starting address of the stack of the thread to be created. + Depending on whether the stack grows up or down the value must either + be higher or lower than all the address in the memory block. The + minimal size of the block must be PTHREAD_STACK_SIZE. */ +extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, + void *__stackaddr) __THROW; + +/* Return the previously set address for the stack. */ +extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict + __attr, void **__restrict __stackaddr) + __THROW; + +#ifdef __USE_XOPEN2K +/* The following two interfaces are intended to replace the last two. They + require setting the address as well as the size since only setting the + address will make the implementation on some architectures impossible. */ +extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr, + size_t __stacksize) __THROW; + +/* Return the previously set address for the stack. */ +extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr, + void **__restrict __stackaddr, + size_t *__restrict __stacksize) __THROW; +#endif + +/* Add information about the minimum stack size needed for the thread + to be started. This size must never be less than PTHREAD_STACK_SIZE + and must also not exceed the system limits. */ +extern int pthread_attr_setstacksize (pthread_attr_t *__attr, + size_t __stacksize) __THROW; + +/* Return the currently used minimal stack size. */ +extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict + __attr, size_t *__restrict __stacksize) + __THROW; + +#ifdef __USE_GNU +/* Get thread attributes corresponding to the already running thread TH. */ +extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) __THROW; +#endif + +/* Functions for scheduling control. */ + +/* Set the scheduling parameters for TARGET_THREAD according to POLICY + and *PARAM. */ +extern int pthread_setschedparam (pthread_t __target_thread, int __policy, + __const struct sched_param *__param) + __THROW; + +/* Return in *POLICY and *PARAM the scheduling parameters for TARGET_THREAD. */ +extern int pthread_getschedparam (pthread_t __target_thread, + int *__restrict __policy, + struct sched_param *__restrict __param) + __THROW; + +#ifdef __USE_UNIX98 +/* Determine level of concurrency. */ +extern int pthread_getconcurrency (void) __THROW; + +/* Set new concurrency level to LEVEL. */ +extern int pthread_setconcurrency (int __level) __THROW; +#endif + +#ifdef __USE_GNU +/* Yield the processor to another thread or process. + This function is similar to the POSIX `sched_yield' function but + might be differently implemented in the case of a m-on-n thread + implementation. */ +extern int pthread_yield (void) __THROW; +#endif + +/* Functions for mutex handling. */ + +/* Initialize MUTEX using attributes in *MUTEX_ATTR, or use the + default values if later is NULL. */ +extern int pthread_mutex_init (pthread_mutex_t *__restrict __mutex, + __const pthread_mutexattr_t *__restrict + __mutex_attr) __THROW; + +/* Destroy MUTEX. */ +extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) __THROW; + +/* Try to lock MUTEX. */ +extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) __THROW; + +/* Wait until lock for MUTEX becomes available and lock it. */ +extern int pthread_mutex_lock (pthread_mutex_t *__mutex) __THROW; + +#ifdef __USE_XOPEN2K +/* Wait until lock becomes available, or specified time passes. */ +extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, + __const struct timespec *__restrict + __abstime) __THROW; +#endif + +/* Unlock MUTEX. */ +extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) __THROW; + + +/* Functions for handling mutex attributes. */ + +/* Initialize mutex attribute object ATTR with default attributes + (kind is PTHREAD_MUTEX_TIMED_NP). */ +extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) __THROW; + +/* Destroy mutex attribute object ATTR. */ +extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) __THROW; + +/* Get the process-shared flag of the mutex attribute ATTR. */ +extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t * + __restrict __attr, + int *__restrict __pshared) __THROW; + +/* Set the process-shared flag of the mutex attribute ATTR. */ +extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr, + int __pshared) __THROW; + +#ifdef __USE_UNIX98 +/* Set the mutex kind attribute in *ATTR to KIND (either PTHREAD_MUTEX_NORMAL, + PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_ERRORCHECK, or + PTHREAD_MUTEX_DEFAULT). */ +extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind) + __THROW; + +/* Return in *KIND the mutex kind attribute in *ATTR. */ +extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict + __attr, int *__restrict __kind) __THROW; +#endif + + +/* Functions for handling conditional variables. */ + +/* Initialize condition variable COND using attributes ATTR, or use + the default values if later is NULL. */ +extern int pthread_cond_init (pthread_cond_t *__restrict __cond, + __const pthread_condattr_t *__restrict + __cond_attr) __THROW; + +/* Destroy condition variable COND. */ +extern int pthread_cond_destroy (pthread_cond_t *__cond) __THROW; + +/* Wake up one thread waiting for condition variable COND. */ +extern int pthread_cond_signal (pthread_cond_t *__cond) __THROW; + +/* Wake up all threads waiting for condition variables COND. */ +extern int pthread_cond_broadcast (pthread_cond_t *__cond) __THROW; + +/* Wait for condition variable COND to be signaled or broadcast. + MUTEX is assumed to be locked before. */ +extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, + pthread_mutex_t *__restrict __mutex) __THROW; + +/* Wait for condition variable COND to be signaled or broadcast until + ABSTIME. MUTEX is assumed to be locked before. ABSTIME is an + absolute time specification; zero is the beginning of the epoch + (00:00:00 GMT, January 1, 1970). */ +extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, + pthread_mutex_t *__restrict __mutex, + __const struct timespec *__restrict + __abstime) __THROW; + +/* Functions for handling condition variable attributes. */ + +/* Initialize condition variable attribute ATTR. */ +extern int pthread_condattr_init (pthread_condattr_t *__attr) __THROW; + +/* Destroy condition variable attribute ATTR. */ +extern int pthread_condattr_destroy (pthread_condattr_t *__attr) __THROW; + +/* Get the process-shared flag of the condition variable attribute ATTR. */ +extern int pthread_condattr_getpshared (__const pthread_condattr_t * + __restrict __attr, + int *__restrict __pshared) __THROW; + +/* Set the process-shared flag of the condition variable attribute ATTR. */ +extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, + int __pshared) __THROW; + + +#ifdef __USE_UNIX98 +/* Functions for handling read-write locks. */ + +/* Initialize read-write lock RWLOCK using attributes ATTR, or use + the default values if later is NULL. */ +extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock, + __const pthread_rwlockattr_t *__restrict + __attr) __THROW; + +/* Destroy read-write lock RWLOCK. */ +extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) __THROW; + +/* Acquire read lock for RWLOCK. */ +extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) __THROW; + +/* Try to acquire read lock for RWLOCK. */ +extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) __THROW; + +#ifdef __USE_XOPEN2K +/* Try to acquire read lock for RWLOCK or return after specfied time. */ +extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, + __const struct timespec *__restrict + __abstime) __THROW; +#endif + +/* Acquire write lock for RWLOCK. */ +extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) __THROW; + +/* Try to acquire write lock for RWLOCK. */ +extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) __THROW; + +#ifdef __USE_XOPEN2K +/* Try to acquire write lock for RWLOCK or return after specfied time. */ +extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, + __const struct timespec *__restrict + __abstime) __THROW; +#endif + +/* Unlock RWLOCK. */ +extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) __THROW; + + +/* Functions for handling read-write lock attributes. */ + +/* Initialize attribute object ATTR with default values. */ +extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) __THROW; + +/* Destroy attribute object ATTR. */ +extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) __THROW; + +/* Return current setting of process-shared attribute of ATTR in PSHARED. */ +extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t * + __restrict __attr, + int *__restrict __pshared) __THROW; + +/* Set process-shared attribute of ATTR to PSHARED. */ +extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, + int __pshared) __THROW; + +/* Return current setting of reader/writer preference. */ +extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *__attr, + int *__pref) __THROW; + +/* Set reader/write preference. */ +extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr, + int __pref) __THROW; +#endif + +#ifdef __USE_XOPEN2K +/* The IEEE Std. 1003.1j-2000 introduces functions to implement + spinlocks. */ + +/* Initialize the spinlock LOCK. If PSHARED is nonzero the spinlock can + be shared between different processes. */ +extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) + __THROW; + +/* Destroy the spinlock LOCK. */ +extern int pthread_spin_destroy (pthread_spinlock_t *__lock) __THROW; + +/* Wait until spinlock LOCK is retrieved. */ +extern int pthread_spin_lock (pthread_spinlock_t *__lock) __THROW; + +/* Try to lock spinlock LOCK. */ +extern int pthread_spin_trylock (pthread_spinlock_t *__lock) __THROW; + +/* Release spinlock LOCK. */ +extern int pthread_spin_unlock (pthread_spinlock_t *__lock) __THROW; + + +/* Barriers are a also a new feature in 1003.1j-2000. */ + +extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier, + __const pthread_barrierattr_t *__restrict + __attr, unsigned int __count) __THROW; + +extern int pthread_barrier_destroy (pthread_barrier_t *__barrier) __THROW; + +extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr) __THROW; + +extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr) __THROW; + +extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t * + __restrict __attr, + int *__restrict __pshared) __THROW; + +extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, + int __pshared) __THROW; + +extern int pthread_barrier_wait (pthread_barrier_t *__barrier) __THROW; +#endif + + +/* Functions for handling thread-specific data. */ + +/* Create a key value identifying a location in the thread-specific + data area. Each thread maintains a distinct thread-specific data + area. DESTR_FUNCTION, if non-NULL, is called with the value + associated to that key when the key is destroyed. + DESTR_FUNCTION is not called if the value associated is NULL when + the key is destroyed. */ +extern int pthread_key_create (pthread_key_t *__key, + void (*__destr_function) (void *)) __THROW; + +/* Destroy KEY. */ +extern int pthread_key_delete (pthread_key_t __key) __THROW; + +/* Store POINTER in the thread-specific data slot identified by KEY. */ +extern int pthread_setspecific (pthread_key_t __key, + __const void *__pointer) __THROW; + +/* Return current value of the thread-specific data slot identified by KEY. */ +extern void *pthread_getspecific (pthread_key_t __key) __THROW; + + +/* Functions for handling initialization. */ + +/* Guarantee that the initialization function INIT_ROUTINE will be called + only once, even if pthread_once is executed several times with the + same ONCE_CONTROL argument. ONCE_CONTROL must point to a static or + extern variable initialized to PTHREAD_ONCE_INIT. */ +extern int pthread_once (pthread_once_t *__once_control, + void (*__init_routine) (void)) __THROW; + + +/* Functions for handling cancellation. */ + +/* Set cancelability state of current thread to STATE, returning old + state in *OLDSTATE if OLDSTATE is not NULL. */ +extern int pthread_setcancelstate (int __state, int *__oldstate) __THROW; + +/* Set cancellation state of current thread to TYPE, returning the old + type in *OLDTYPE if OLDTYPE is not NULL. */ +extern int pthread_setcanceltype (int __type, int *__oldtype) __THROW; + +/* Cancel THREAD immediately or at the next possibility. */ +extern int pthread_cancel (pthread_t __thread) __THROW; + +/* Test for pending cancellation for the current thread and terminate + the thread as per pthread_exit(PTHREAD_CANCELED) if it has been + cancelled. */ +extern void pthread_testcancel (void) __THROW; + + +/* Install a cleanup handler: ROUTINE will be called with arguments ARG + when the thread is cancelled or calls pthread_exit. ROUTINE will also + be called with arguments ARG when the matching pthread_cleanup_pop + is executed with non-zero EXECUTE argument. + pthread_cleanup_push and pthread_cleanup_pop are macros and must always + be used in matching pairs at the same nesting level of braces. */ + +#define pthread_cleanup_push(routine,arg) \ + { struct _pthread_cleanup_buffer _buffer; \ + _pthread_cleanup_push (&_buffer, (routine), (arg)); + +extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *__buffer, + void (*__routine) (void *), + void *__arg) __THROW; + +/* Remove a cleanup handler installed by the matching pthread_cleanup_push. + If EXECUTE is non-zero, the handler function is called. */ + +#define pthread_cleanup_pop(execute) \ + _pthread_cleanup_pop (&_buffer, (execute)); } + +extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *__buffer, + int __execute) __THROW; + +/* Install a cleanup handler as pthread_cleanup_push does, but also + saves the current cancellation type and set it to deferred cancellation. */ + +#ifdef __USE_GNU +# define pthread_cleanup_push_defer_np(routine,arg) \ + { struct _pthread_cleanup_buffer _buffer; \ + _pthread_cleanup_push_defer (&_buffer, (routine), (arg)); + +extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *__buffer, + void (*__routine) (void *), + void *__arg) __THROW; + +/* Remove a cleanup handler as pthread_cleanup_pop does, but also + restores the cancellation type that was in effect when the matching + pthread_cleanup_push_defer was called. */ + +# define pthread_cleanup_pop_restore_np(execute) \ + _pthread_cleanup_pop_restore (&_buffer, (execute)); } + +extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *__buffer, + int __execute) __THROW; +#endif + + +#ifdef __USE_XOPEN2K +/* Get ID of CPU-time clock for thread THREAD_ID. */ +extern int pthread_getcpuclockid (pthread_t __thread_id, + clockid_t *__clock_id) __THROW; +#endif + + +/* Functions for handling signals. */ +#include + + +/* Functions for handling process creation and process execution. */ + +/* Install handlers to be called when a new process is created with FORK. + The PREPARE handler is called in the parent process just before performing + FORK. The PARENT handler is called in the parent process just after FORK. + The CHILD handler is called in the child process. Each of the three + handlers can be NULL, meaning that no handler needs to be called at that + point. + PTHREAD_ATFORK can be called several times, in which case the PREPARE + handlers are called in LIFO order (last added with PTHREAD_ATFORK, + first called before FORK), and the PARENT and CHILD handlers are called + in FIFO (first added, first called). */ + +extern int pthread_atfork (void (*__prepare) (void), + void (*__parent) (void), + void (*__child) (void)) __THROW; + +/* Terminate all threads in the program except the calling process. + Should be called just before invoking one of the exec*() functions. */ + +extern void pthread_kill_other_threads_np (void) __THROW; + +__END_DECLS + +#endif /* pthread.h */ diff -Naur gcc-2.95.3.old/gcc/glibc-include/sched.h gcc-2.95.3/gcc/glibc-include/sched.h --- gcc-2.95.3.old/gcc/glibc-include/sched.h Thu Jan 1 03:00:00 1970 +++ gcc-2.95.3/gcc/glibc-include/sched.h Mon May 27 07:05:27 2002 @@ -0,0 +1,67 @@ +/* Definitions for POSIX 1003.1b-1993 (aka POSIX.4) scheduling interface. + Copyright (C) 1996, 1997, 1999, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library 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. + + The GNU C Library 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 the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SCHED_H +#define _SCHED_H 1 + +#include + +/* Get type definitions. */ +#include + +#define __need_timespec +#include + +/* Get system specific constant and data structure definitions. */ +#include +/* Define the real names for the elements of `struct sched_param'. */ +#define sched_priority __sched_priority + + +__BEGIN_DECLS + +/* Set scheduling parameters for a process. */ +extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param) + __THROW; + +/* Retrieve scheduling parameters for a particular process. */ +extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __THROW; + +/* Set scheduling algorithm and/or parameters for a process. */ +extern int sched_setscheduler (__pid_t __pid, int __policy, + __const struct sched_param *__param) __THROW; + +/* Retrieve scheduling algorithm for a particular purpose. */ +extern int sched_getscheduler (__pid_t __pid) __THROW; + +/* Yield the processor. */ +extern int sched_yield (void) __THROW; + +/* Get maximum priority value for a scheduler. */ +extern int sched_get_priority_max (int __algorithm) __THROW; + +/* Get minimum priority value for a scheduler. */ +extern int sched_get_priority_min (int __algorithm) __THROW; + +/* Get the SCHED_RR interval for the named process. */ +extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW; + +__END_DECLS + +#endif /* sched.h */ diff -Naur gcc-2.95.3.old/gcc/glibc-include/signal.h gcc-2.95.3/gcc/glibc-include/signal.h --- gcc-2.95.3.old/gcc/glibc-include/signal.h Thu Jan 1 03:00:00 1970 +++ gcc-2.95.3/gcc/glibc-include/signal.h Mon May 27 07:05:27 2002 @@ -0,0 +1,373 @@ +/* Copyright (C) 1991-1999, 2000, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library 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. + + The GNU C Library 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 the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * ISO C99 Standard: 7.14 Signal handling + */ + +#ifndef _SIGNAL_H + +#if !defined __need_sig_atomic_t && !defined __need_sigset_t +# define _SIGNAL_H +#endif + +#include + +__BEGIN_DECLS + +#include /* __sigset_t, __sig_atomic_t. */ + +/* An integral type that can be modified atomically, without the + possibility of a signal arriving in the middle of the operation. */ +#if defined __need_sig_atomic_t || defined _SIGNAL_H +# ifndef __sig_atomic_t_defined +# define __sig_atomic_t_defined +typedef __sig_atomic_t sig_atomic_t; +# endif +# undef __need_sig_atomic_t +#endif + +#if defined __need_sigset_t || (defined _SIGNAL_H && defined __USE_POSIX) +# ifndef __sigset_t_defined +# define __sigset_t_defined +typedef __sigset_t sigset_t; +# endif +# undef __need_sigset_t +#endif + +#ifdef _SIGNAL_H + +#include +#include + +#ifdef __USE_XOPEN +# ifndef __pid_t_defined +typedef __pid_t pid_t; +# define __pid_t_defined +# endif +# ifndef __uid_t_defined +typedef __uid_t uid_t; +# define __uid_t_defined +# endif +#endif /* Unix98 */ + + +/* Type of a signal handler. */ +typedef void (*__sighandler_t) (int); + +/* The X/Open definition of `signal' specifies the SVID semantic. Use + the additional function `sysv_signal' when X/Open compatibility is + requested. */ +extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler) + __THROW; +#ifdef __USE_GNU +extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler) + __THROW; +#endif + +/* Set the handler for the signal SIG to HANDLER, returning the old + handler, or SIG_ERR on error. + By default `signal' has the BSD semantic. */ +#ifdef __USE_BSD +extern __sighandler_t signal (int __sig, __sighandler_t __handler) __THROW; +#else +/* Make sure the used `signal' implementation is the SVID version. */ +# ifdef __REDIRECT +extern __sighandler_t __REDIRECT (signal, + (int __sig, + __sighandler_t __handler) __THROW, + __sysv_signal); +# else +# define signal __sysv_signal +# endif +#endif + +#ifdef __USE_XOPEN +/* The X/Open definition of `signal' conflicts with the BSD version. + So they defined another function `bsd_signal'. */ +extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler) __THROW; +#endif + +/* Send signal SIG to process number PID. If PID is zero, + send SIG to all processes in the current process's process group. + If PID is < -1, send SIG to all processes in process group - PID. */ +#ifdef __USE_POSIX +extern int kill (__pid_t __pid, int __sig) __THROW; +#endif /* Use POSIX. */ + +#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED +/* Send SIG to all processes in process group PGRP. + If PGRP is zero, send SIG to all processes in + the current process's process group. */ +extern int killpg (__pid_t __pgrp, int __sig) __THROW; +#endif /* Use BSD || X/Open Unix. */ + +/* Raise signal SIG, i.e., send SIG to yourself. */ +extern int raise (int __sig) __THROW; + +#ifdef __USE_SVID +/* SVID names for the same things. */ +extern __sighandler_t ssignal (int __sig, __sighandler_t __handler) __THROW; +extern int gsignal (int __sig) __THROW; +#endif /* Use SVID. */ + +#ifdef __USE_MISC +/* Print a message describing the meaning of the given signal number. */ +extern void psignal (int __sig, __const char *__s) __THROW; +#endif /* Use misc. */ + + +/* The `sigpause' function has two different interfaces. The original + BSD definition defines the argument as a mask of the signal, while + the more modern interface in X/Open defines it as the signal + number. We go with the BSD version unless the user explicitly + selects the X/Open version. */ +extern int __sigpause (int __sig_or_mask, int __is_sig) __THROW; + +#ifdef __USE_BSD +/* Set the mask of blocked signals to MASK, + wait for a signal to arrive, and then restore the mask. */ +extern int sigpause (int __mask) __THROW; +# define sigpause(mask) __sigpause ((mask), 0) +#else +# ifdef __USE_XOPEN +# ifdef __GNUC__ +extern int sigpause (int __sig) __THROW __asm__ ("__xpg_sigpause"); +# endif +/* Remove a signal from the signal mask and suspend the process. */ +# define sigpause(sig) __sigpause ((sig), 1) +# endif +#endif + + +#ifdef __USE_BSD +/* None of the following functions should be used anymore. They are here + only for compatibility. A single word (`int') is not guaranteed to be + enough to hold a complete signal mask and therefore these functions + simply do not work in many situations. Use `sigprocmask' instead. */ + +/* Compute mask for signal SIG. */ +# define sigmask(sig) __sigmask(sig) + +/* Block signals in MASK, returning the old mask. */ +extern int sigblock (int __mask) __THROW; + +/* Set the mask of blocked signals to MASK, returning the old mask. */ +extern int sigsetmask (int __mask) __THROW; + +/* Return currently selected signal mask. */ +extern int siggetmask (void) __THROW; +#endif /* Use BSD. */ + + +#ifdef __USE_MISC +# define NSIG _NSIG +#endif + +#ifdef __USE_GNU +typedef __sighandler_t sighandler_t; +#endif + +/* 4.4 BSD uses the name `sig_t' for this. */ +#ifdef __USE_BSD +typedef __sighandler_t sig_t; +#endif + +#ifdef __USE_POSIX + +# ifdef __USE_POSIX199309 +/* We need `struct timespec' later on. */ +# define __need_timespec +# include + +/* Get the `siginfo_t' type plus the needed symbols. */ +# include +# endif + +/* Clear all signals from SET. */ +extern int sigemptyset (sigset_t *__set) __THROW; + +/* Set all signals in SET. */ +extern int sigfillset (sigset_t *__set) __THROW; + +/* Add SIGNO to SET. */ +extern int sigaddset (sigset_t *__set, int __signo) __THROW; + +/* Remove SIGNO from SET. */ +extern int sigdelset (sigset_t *__set, int __signo) __THROW; + +/* Return 1 if SIGNO is in SET, 0 if not. */ +extern int sigismember (__const sigset_t *__set, int __signo) __THROW; + +# ifdef __USE_GNU +/* Return non-empty value is SET is not empty. */ +extern int sigisemptyset (__const sigset_t *__set) __THROW; + +/* Build new signal set by combining the two inputs set using logical AND. */ +extern int sigandset (sigset_t *__set, __const sigset_t *__left, + __const sigset_t *__right) __THROW; + +/* Build new signal set by combining the two inputs set using logical OR. */ +extern int sigorset (sigset_t *__set, __const sigset_t *__left, + __const sigset_t *__right) __THROW; +# endif /* GNU */ + +/* Get the system-specific definitions of `struct sigaction' + and the `SA_*' and `SIG_*'. constants. */ +# include + +/* Get and/or change the set of blocked signals. */ +extern int sigprocmask (int __how, __const sigset_t *__restrict __set, + sigset_t *__restrict __oset) __THROW; + +/* Change the set of blocked signals to SET, + wait until a signal arrives, and restore the set of blocked signals. */ +extern int sigsuspend (__const sigset_t *__set) __THROW; + +/* Get and/or set the action for signal SIG. */ +extern int sigaction (int __sig, __const struct sigaction *__restrict __act, + struct sigaction *__restrict __oact) __THROW; + +/* Put in SET all signals that are blocked and waiting to be delivered. */ +extern int sigpending (sigset_t *__set) __THROW; + + +/* Select any of pending signals from SET or wait for any to arrive. */ +extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig) + __THROW; + +# ifdef __USE_POSIX199309 +/* Select any of pending signals from SET and place information in INFO. */ +extern int sigwaitinfo (__const sigset_t *__restrict __set, + siginfo_t *__restrict __info) __THROW; + +/* Select any of pending signals from SET and place information in INFO. + Wait the imte specified by TIMEOUT if no signal is pending. */ +extern int sigtimedwait (__const sigset_t *__restrict __set, + siginfo_t *__restrict __info, + __const struct timespec *__restrict __timeout) + __THROW; + +/* Send signal SIG to the process PID. Associate data in VAL with the + signal. */ +extern int sigqueue (__pid_t __pid, int __sig, __const union sigval __val) + __THROW; +# endif /* Use POSIX 199306. */ + +#endif /* Use POSIX. */ + +#ifdef __USE_BSD + +/* Names of the signals. This variable exists only for compatibility. + Use `strsignal' instead (see ). */ +extern __const char *__const _sys_siglist[_NSIG]; +extern __const char *__const sys_siglist[_NSIG]; + +/* Structure passed to `sigvec'. */ +struct sigvec + { + __sighandler_t sv_handler; /* Signal handler. */ + int sv_mask; /* Mask of signals to be blocked. */ + + int sv_flags; /* Flags (see below). */ +# define sv_onstack sv_flags /* 4.2 BSD compatibility. */ + }; + +/* Bits in `sv_flags'. */ +# define SV_ONSTACK (1 << 0)/* Take the signal on the signal stack. */ +# define SV_INTERRUPT (1 << 1)/* Do not restart system calls. */ +# define SV_RESETHAND (1 << 2)/* Reset handler to SIG_DFL on receipt. */ + + +/* If VEC is non-NULL, set the handler for SIG to the `sv_handler' member + of VEC. The signals in `sv_mask' will be blocked while the handler runs. + If the SV_RESETHAND bit is set in `sv_flags', the handler for SIG will be + reset to SIG_DFL before `sv_handler' is entered. If OVEC is non-NULL, + it is filled in with the old information for SIG. */ +extern int sigvec (int __sig, __const struct sigvec *__vec, + struct sigvec *__ovec) __THROW; + + +/* Get machine-dependent `struct sigcontext' and signal subcodes. */ +# include + +/* Restore the state saved in SCP. */ +extern int sigreturn (struct sigcontext *__scp) __THROW; + +#endif /* use BSD. */ + + +#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED + +/* If INTERRUPT is nonzero, make signal SIG interrupt system calls + (causing them to fail with EINTR); if INTERRUPT is zero, make system + calls be restarted after signal SIG. */ +extern int siginterrupt (int __sig, int __interrupt) __THROW; + +# include +# ifdef __USE_XOPEN +# include +# endif + +/* Run signals handlers on the stack specified by SS (if not NULL). + If OSS is not NULL, it is filled in with the old signal stack status. + This interface is obsolete and on many platform not implemented. */ +extern int sigstack (struct sigstack *__ss, struct sigstack *__oss) __THROW; + +/* Alternate signal handler stack interface. + This interface should always be preferred over `sigstack'. */ +extern int sigaltstack (__const struct sigaltstack *__restrict __ss, + struct sigaltstack *__restrict __oss) __THROW; + +#endif /* use BSD or X/Open Unix. */ + +#ifdef __USE_UNIX98 +/* Simplified interface for signal management. */ + +/* Add SIG to the calling process' signal mask. */ +extern int sighold (int __sig) __THROW; + +/* Remove SIG from the calling process' signal mask. */ +extern int sigrelse (int __sig) __THROW; + +/* Set the disposition of SIG to SIG_IGN. */ +extern int sigignore (int __sig) __THROW; + +/* Set the disposition of SIG. */ +extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __THROW; +#endif + +#if defined __USE_POSIX199506 || defined __USE_UNIX98 +/* Some of the functions for handling signals in threaded programs must + be defined here. */ +# include +#endif /* use Unix98 */ + +/* The following functions are used internally in the C library and in + other code which need deep insights. */ + +/* Return number of available real-time signal with highest priority. */ +extern int __libc_current_sigrtmin (void) __THROW; +/* Return number of available real-time signal with lowest priority. */ +extern int __libc_current_sigrtmax (void) __THROW; + +#endif /* signal.h */ + +__END_DECLS + +#endif /* not signal.h */ diff -Naur gcc-2.95.3.old/gcc/glibc-include/sys/cdefs.h gcc-2.95.3/gcc/glibc-include/sys/cdefs.h --- gcc-2.95.3.old/gcc/glibc-include/sys/cdefs.h Thu Jan 1 03:00:00 1970 +++ gcc-2.95.3/gcc/glibc-include/sys/cdefs.h Mon May 27 07:05:27 2002 @@ -0,0 +1,202 @@ +/* Copyright (C) 1992,93,94,95,96,97,98,99, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library 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. + + The GNU C Library 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 the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_CDEFS_H +#define _SYS_CDEFS_H 1 + +/* We are almost always included from features.h. */ +#ifndef _FEATURES_H +# include +#endif + +/* The GNU libc does not support any K&R compilers or the traditional mode + of ISO C compilers anymore. Check for some of the combinations not + anymore supported. */ +#if defined __GNUC__ && !defined __STDC__ +# error "You need a ISO C conforming compiler to use the glibc headers" +#endif + +/* Some user header file might have defined this before. */ +#undef __P +#undef __PMT + +#ifdef __GNUC__ + +/* GCC can always grok prototypes. For C++ programs we add throw() + to help it optimize the function calls. But this works only with + gcc 2.8.x and egcs. */ +# if defined __cplusplus && __GNUC_PREREQ (2,8) +# define __THROW throw () +# else +# define __THROW +# endif +# define __P(args) args __THROW +/* This macro will be used for functions which might take C++ callback + functions. */ +# define __PMT(args) args + +#else /* Not GCC. */ + +# define __inline /* No inline functions. */ + +# define __THROW +# define __P(args) args +# define __PMT(args) args + +# define __const const +# define __signed signed +# define __volatile volatile + +#endif /* GCC. */ + +/* For these things, GCC behaves the ANSI way normally, + and the non-ANSI way under -traditional. */ + +#define __CONCAT(x,y) x ## y +#define __STRING(x) #x + +/* This is not a typedef so `const __ptr_t' does the right thing. */ +#define __ptr_t void * +#define __long_double_t long double + + +/* C++ needs to know that types and declarations are C, not C++. */ +#ifdef __cplusplus +# define __BEGIN_DECLS extern "C" { +# define __END_DECLS } +#else +# define __BEGIN_DECLS +# define __END_DECLS +#endif + + +/* Support for bounded pointers. */ +#ifndef __BOUNDED_POINTERS__ +# define __bounded /* nothing */ +# define __unbounded /* nothing */ +# define __ptrvalue /* nothing */ +#endif + + +/* Support for flexible arrays. */ +#if __GNUC_PREREQ (2,97) +/* GCC 2.97 supports C99 flexible array members. */ +# define __flexarr [] +#else +# ifdef __GNUC__ +# define __flexarr [0] +# else +# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +# define __flexarr [] +# else +/* Some other non-C99 compiler. Approximate with [1]. */ +# define __flexarr [1] +# endif +# endif +#endif + + +/* __asm__ ("xyz") is used throughout the headers to rename functions + at the assembly language level. This is wrapped by the __REDIRECT + macro, in order to support compilers that can do this some other + way. When compilers don't support asm-names at all, we have to do + preprocessor tricks instead (which don't have exactly the right + semantics, but it's the best we can do). + + Example: + int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ + +#if defined __GNUC__ && __GNUC__ >= 2 + +# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) +# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) +# define __ASMNAME2(prefix, cname) __STRING (prefix) cname + +/* +#elif __SOME_OTHER_COMPILER__ + +# define __REDIRECT(name, proto, alias) name proto; \ + _Pragma("let " #name " = " #alias) +*/ +#endif + +/* GCC has various useful declarations that can be made with the + `__attribute__' syntax. All of the ways we use this do fine if + they are omitted for compilers that don't understand it. */ +#if !defined __GNUC__ || __GNUC__ < 2 +# define __attribute__(xyz) /* Ignore */ +#endif + +/* At some point during the gcc 2.96 development the `malloc' attribute + for functions was introduced. We don't want to use it unconditionally + (although this would be possible) since it generates warnings. */ +#if __GNUC_PREREQ (2,96) +# define __attribute_malloc__ __attribute__ ((__malloc__)) +#else +# define __attribute_malloc__ /* Ignore */ +#endif + +/* At some point during the gcc 2.96 development the `pure' attribute + for functions was introduced. We don't want to use it unconditionally + (although this would be possible) since it generates warnings. */ +#if __GNUC_PREREQ (2,96) +# define __attribute_pure__ __attribute__ ((__pure__)) +#else +# define __attribute_pure__ /* Ignore */ +#endif + +/* At some point during the gcc 2.8 development the `format_arg' attribute + for functions was introduced. We don't want to use it unconditionally + (although this would be possible) since it generates warnings. */ +#if __GNUC_PREREQ (2,8) +# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) +#else +# define __attribute_format_arg__(x) /* Ignore */ +#endif + +/* At some point during the gcc 2.97 development the `strfmon' format + attribute for functions was introduced. We don't want to use it + unconditionally (although this would be possible) since it + generates warnings. */ +#if __GNUC_PREREQ (2,97) +# define __attribute_format_strfmon__(a,b) \ + __attribute__ ((__format__ (__strfmon__, a, b))) +#else +# define __attribute_format_strfmon__(a,b) /* Ignore */ +#endif + +/* It is possible to compile containing GCC extensions even if GCC is + run in pedantic mode if the uses are carefully marked using the + `__extension__' keyword. But this is not generally available before + version 2.8. */ +#if !__GNUC_PREREQ (2,8) +# define __extension__ /* Ignore */ +#endif + +/* __restrict is known in EGCS 1.2 and above. */ +#if !__GNUC_PREREQ (2,92) +# define __restrict /* Ignore */ +#endif + +/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is + array_name[restrict] + But gcc so far does not support this syntax. We define a separate macro + for this which can be enabled if the underlying compiler supports it. */ +#define __restrict_arr + +#endif /* sys/cdefs.h */ diff -Naur gcc-2.95.3.old/gcc/glibc-include/time.h gcc-2.95.3/gcc/glibc-include/time.h --- gcc-2.95.3.old/gcc/glibc-include/time.h Thu Jan 1 03:00:00 1970 +++ gcc-2.95.3/gcc/glibc-include/time.h Mon May 27 07:05:27 2002 @@ -0,0 +1,366 @@ +/* Copyright (C) 1991-1999, 2000, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library 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. + + The GNU C Library 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 the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * ISO C99 Standard: 7.23 Date and time + */ + +#ifndef _TIME_H + +#if (! defined __need_time_t && !defined __need_clock_t && \ + ! defined __need_timespec) +# define _TIME_H 1 +# include + +__BEGIN_DECLS + +#endif + +#ifdef _TIME_H +/* Get size_t and NULL from . */ +# define __need_size_t +# define __need_NULL +# include + +/* This defines CLOCKS_PER_SEC, which is the number of processor clock + ticks per second. */ +# include + +/* This is the obsolete POSIX.1-1988 name for the same constant. */ +# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K +# ifndef CLK_TCK +# define CLK_TCK CLOCKS_PER_SEC +# endif +# endif + +#endif /* included. */ + +#if !defined __clock_t_defined && (defined _TIME_H || defined __need_clock_t) +# define __clock_t_defined 1 + +# include + +/* Returned by `clock'. */ +typedef __clock_t clock_t; + +#endif /* clock_t not defined and or need clock_t. */ +#undef __need_clock_t + +#if !defined __time_t_defined && (defined _TIME_H || defined __need_time_t) +# define __time_t_defined 1 + +# include + +/* Returned by `time'. */ +typedef __time_t time_t; + +#endif /* time_t not defined and or need time_t. */ +#undef __need_time_t + +#if !defined __clockid_t_defined && \ + ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_clockid_t) +# define __clockid_t_defined 1 + +# include + +/* Clock ID used in clock and timer functions. */ +typedef __clockid_t clockid_t; + +#endif /* clockid_t not defined and or need clockid_t. */ +#undef __clockid_time_t + +#if !defined __timer_t_defined && \ + ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_timer_t) +# define __timer_t_defined 1 + +# include + +/* Timer ID returned by `timer_create'. */ +typedef __timer_t timer_t; + +#endif /* timer_t not defined and or need timer_t. */ +#undef __need_timer_t + + +#if !defined __timespec_defined && \ + ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_timespec) +# define __timespec_defined 1 + +/* POSIX.1b structure for a time value. This is like a `struct timeval' but + has nanoseconds instead of microseconds. */ +struct timespec + { + long int tv_sec; /* Seconds. */ + long int tv_nsec; /* Nanoseconds. */ + }; + +#endif /* timespec not defined and or need timespec. */ +#undef __need_timespec + + +#ifdef _TIME_H +/* Used by other time functions. */ +struct tm +{ + int tm_sec; /* Seconds. [0-60] (1 leap second) */ + int tm_min; /* Minutes. [0-59] */ + int tm_hour; /* Hours. [0-23] */ + int tm_mday; /* Day. [1-31] */ + int tm_mon; /* Month. [0-11] */ + int tm_year; /* Year - 1900. */ + int tm_wday; /* Day of week. [0-6] */ + int tm_yday; /* Days in year.[0-365] */ + int tm_isdst; /* DST. [-1/0/1]*/ + +# ifdef __USE_BSD + long int tm_gmtoff; /* Seconds east of UTC. */ + __const char *tm_zone; /* Timezone abbreviation. */ +# else + long int __tm_gmtoff; /* Seconds east of UTC. */ + __const char *__tm_zone; /* Timezone abbreviation. */ +# endif +}; + + +#ifdef __USE_POSIX199309 +/* POSIX.1b structure for timer start values and intervals. */ +struct itimerspec + { + struct timespec it_interval; + struct timespec it_value; + }; + +/* We can use a simple forward declaration. */ +struct sigevent; + +#endif /* POSIX.1b */ + +#ifdef __USE_XOPEN2K +# ifndef __pid_t_defined +typedef __pid_t pid_t; +# define __pid_t_defined +# endif +#endif + + +/* Time used by the program so far (user time + system time). + The result / CLOCKS_PER_SECOND is program time in seconds. */ +extern clock_t clock (void) __THROW; + +/* Return the current time and put it in *TIMER if TIMER is not NULL. */ +extern time_t time (time_t *__timer) __THROW; + +/* Return the difference between TIME1 and TIME0. */ +extern double difftime (time_t __time1, time_t __time0) + __THROW __attribute__ ((__const__)); + +/* Return the `time_t' representation of TP and normalize TP. */ +extern time_t mktime (struct tm *__tp) __THROW; + + +/* Format TP into S according to FORMAT. + Write no more than MAXSIZE characters and return the number + of characters written, or 0 if it would exceed MAXSIZE. */ +extern size_t strftime (char *__restrict __s, size_t __maxsize, + __const char *__restrict __format, + __const struct tm *__restrict __tp) __THROW; + +# ifdef __USE_XOPEN +/* Parse S according to FORMAT and store binary time information in TP. + The return value is a pointer to the first unparsed character in S. */ +extern char *strptime (__const char *__restrict __s, + __const char *__restrict __fmt, struct tm *__tp) + __THROW; +# endif + + +/* Return the `struct tm' representation of *TIMER + in Universal Coordinated Time (aka Greenwich Mean Time). */ +extern struct tm *gmtime (__const time_t *__timer) __THROW; + +/* Return the `struct tm' representation + of *TIMER in the local timezone. */ +extern struct tm *localtime (__const time_t *__timer) __THROW; + +# if defined __USE_POSIX || defined __USE_MISC +/* Return the `struct tm' representation of *TIMER in UTC, + using *TP to store the result. */ +extern struct tm *gmtime_r (__const time_t *__restrict __timer, + struct tm *__restrict __tp) __THROW; + +/* Return the `struct tm' representation of *TIMER in local time, + using *TP to store the result. */ +extern struct tm *localtime_r (__const time_t *__restrict __timer, + struct tm *__restrict __tp) __THROW; +# endif /* POSIX or misc */ + +/* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n" + that is the representation of TP in this format. */ +extern char *asctime (__const struct tm *__tp) __THROW; + +/* Equivalent to `asctime (localtime (timer))'. */ +extern char *ctime (__const time_t *__timer) __THROW; + +# if defined __USE_POSIX || defined __USE_MISC +/* Reentrant versions of the above functions. */ + +/* Return in BUF a string of the form "Day Mon dd hh:mm:ss yyyy\n" + that is the representation of TP in this format. */ +extern char *asctime_r (__const struct tm *__restrict __tp, + char *__restrict __buf) __THROW; + +/* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'. */ +extern char *ctime_r (__const time_t *__restrict __timer, + char *__restrict __buf) __THROW; +# endif /* POSIX or misc */ + + +/* Defined in localtime.c. */ +extern char *__tzname[2]; /* Current timezone names. */ +extern int __daylight; /* If daylight-saving time is ever in use. */ +extern long int __timezone; /* Seconds west of UTC. */ + + +# ifdef __USE_POSIX +/* Same as above. */ +extern char *tzname[2]; + +/* Set time conversion information from the TZ environment variable. + If TZ is not defined, a locale-dependent default is used. */ +extern void tzset (void) __THROW; +# endif + +# if defined __USE_SVID || defined __USE_XOPEN +extern int daylight; +extern long int timezone; +# endif + +# ifdef __USE_SVID +/* Set the system time to *WHEN. + This call is restricted to the superuser. */ +extern int stime (__const time_t *__when) __THROW; +# endif + + +/* Nonzero if YEAR is a leap year (every 4 years, + except every 100th isn't, and every 400th is). */ +# define __isleap(year) \ + ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) + + +# ifdef __USE_MISC +/* Miscellaneous functions many Unices inherited from the public domain + localtime package. These are included only for compatibility. */ + +/* Like `mktime', but for TP represents Universal Time, not local time. */ +extern time_t timegm (struct tm *__tp) __THROW; + +/* Another name for `mktime'. */ +extern time_t timelocal (struct tm *__tp) __THROW; + +/* Return the number of days in YEAR. */ +extern int dysize (int __year) __THROW __attribute__ ((__const__)); +# endif + + +# ifdef __USE_POSIX199309 +/* Pause execution for a number of nanoseconds. */ +extern int nanosleep (__const struct timespec *__requested_time, + struct timespec *__remaining) __THROW; + + +/* Get resolution of clock CLOCK_ID. */ +extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __THROW; + +/* Get current value of clock CLOCK_ID and store it in TP. */ +extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __THROW; + +/* Set clock CLOCK_ID to value TP. */ +extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp) + __THROW; + +# ifdef __USE_XOPEN2K +/* High-resolution sleep with the specified clock. */ +extern int clock_nanosleep (clockid_t __clock_id, int __flags, + __const struct timespec *__req, + struct timespec *__rem) __THROW; + +/* Return clock ID for CPU-time clock. */ +extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __THROW; +# endif + + +/* Create new per-process timer using CLOCK_ID. */ +extern int timer_create (clockid_t __clock_id, + struct sigevent *__restrict __evp, + timer_t *__restrict __timerid) __THROW; + +/* Delete timer TIMERID. */ +extern int timer_delete (timer_t __timerid) __THROW; + +/* Set timer TIMERID to VALUE, returning old value in OVLAUE. */ +extern int timer_settime (timer_t __timerid, int __flags, + __const struct itimerspec *__restrict __value, + struct itimerspec *__restrict __ovalue) __THROW; + +/* Get current value of timer TIMERID and store it in VLAUE. */ +extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) + __THROW; + +/* Get expiration overrun for timer TIMERID. */ +extern int timer_getoverrun (timer_t __timerid) __THROW; +# endif + + +# ifdef __USE_XOPEN_EXTENDED +/* Set to one of the following values to indicate an error. + 1 the DATEMSK environment variable is null or undefined, + 2 the template file cannot be opened for reading, + 3 failed to get file status information, + 4 the template file is not a regular file, + 5 an error is encountered while reading the template file, + 6 memory allication failed (not enough memory available), + 7 there is no line in the template that matches the input, + 8 invalid input specification Example: February 31 or a time is + specified that can not be represented in a time_t (representing + the time in seconds since 00:00:00 UTC, January 1, 1970) */ +extern int getdate_err; + +/* Parse the given string as a date specification and return a value + representing the value. The templates from the file identified by + the environment variable DATEMSK are used. In case of an error + `getdate_err' is set. */ +extern struct tm *getdate (__const char *__string) __THROW; +# endif + +# ifdef __USE_GNU +/* Since `getdate' is not reentrant because of the use of `getdate_err' + and the static buffer to return the result in, we provide a thread-safe + variant. The functionality is the same. The result is returned in + the buffer pointed to by RESBUFP and in case of an error the return + value is != 0 with the same values as given above for `getdate_err'. */ +extern int getdate_r (__const char *__restrict __string, + struct tm *__restrict __resbufp) __THROW; +# endif + + +__END_DECLS + +#endif /* included. */ + +#endif /* not already included. */ diff -Naur gcc-2.95.3.old/gcc/java/Make-lang.in gcc-2.95.3/gcc/java/Make-lang.in --- gcc-2.95.3.old/gcc/java/Make-lang.in Sat Jun 26 02:31:04 1999 +++ gcc-2.95.3/gcc/java/Make-lang.in Mon May 27 07:05:27 2002 @@ -85,10 +85,10 @@ $(INCLUDES) $(srcdir)/java/jvspec.c # Create the compiler driver for $(GCJ). -$(GCJ)$(exeext): gcc.o jvspec.o version.o \ +$(GCJ)$(exeext): gcc.o jvspec.o version.o find_cross.o cross_update_cpu.o \ prefix.o intl.o $(LIBDEPS) $(EXTRA_GCC_OBJS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o jvspec.o prefix.o intl.o \ - version.o $(EXTRA_GCC_OBJS) $(LIBS) + version.o find_cross.o cross_update_cpu.o $(EXTRA_GCC_OBJS) $(LIBS) # Create a version of the $(GCJ) driver which calls the cross-compiler. $(GCJ)-cross$(exeext): $(GCJ)$(exeext) diff -Naur gcc-2.95.3.old/gcc/libgcc2.c gcc-2.95.3/gcc/libgcc2.c --- gcc-2.95.3.old/gcc/libgcc2.c Sat Jun 12 23:32:37 1999 +++ gcc-2.95.3/gcc/libgcc2.c Mon May 27 07:05:27 2002 @@ -1080,7 +1080,7 @@ #undef double #undef MIN #undef MAX -#include +#include USItype __fixunsxfsi (XFtype a) @@ -1102,7 +1102,7 @@ #undef double #undef MIN #undef MAX -#include +#include USItype __fixunsdfsi (DFtype a) @@ -1124,7 +1124,7 @@ #undef double #undef MIN #undef MAX -#include +#include USItype __fixunssfsi (SFtype a) diff -Naur gcc-2.95.3.old/gcc/prefix.c gcc-2.95.3/gcc/prefix.c --- gcc-2.95.3.old/gcc/prefix.c Thu May 20 14:51:36 1999 +++ gcc-2.95.3/gcc/prefix.c Mon May 27 07:05:27 2002 @@ -292,6 +292,20 @@ const char *path; const char *key; { +// int len = strlen(PREFIX); + + /* If the path starts with default PREFIX and std_prefix was reset + change PREFIX to std_prefix */ +/* if (strcmp(std_prefix, PREFIX) && + ! strncmp (path, PREFIX, len)) + { + char *new = xmalloc(strlen(std_prefix) + + strlen(path) - len + 1); + strcpy(new, std_prefix); + strcat(new, path + len); + path = new; + } +*/ if (! strncmp (path, std_prefix, strlen (std_prefix)) && key != 0) { if (key[0] != '$') @@ -331,7 +345,6 @@ path = new_path; } #endif - return path; } @@ -342,4 +355,9 @@ int len; { std_prefix = save_string (prefix, len); +} + +char *get_std_prefix() +{ + return std_prefix; } diff -Naur gcc-2.95.3.old/gcc/protoize.c gcc-2.95.3/gcc/protoize.c --- gcc-2.95.3.old/gcc/protoize.c Thu May 20 14:51:36 1999 +++ gcc-2.95.3/gcc/protoize.c Mon May 27 07:05:27 2002 @@ -91,6 +91,8 @@ extern char *version_string; +extern char *replace(char *, char*); + /* Systems which are compatible only with POSIX 1003.1-1988 (but *not* with POSIX 1003.1-1990), e.g. Ultrix 4.2, might not have const qualifiers in the prototypes in the system include files. @@ -239,42 +241,7 @@ struct default_include { const char *fname; const char *component; - int x1, x2; } include_defaults[] -#ifdef INCLUDE_DEFAULTS - = INCLUDE_DEFAULTS; -#else - = { - /* Pick up GNU C++ specific include files. */ - { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 }, -#ifdef CROSS_COMPILE - /* This is the dir for fixincludes. Put it just before - the files that we fix. */ - { GCC_INCLUDE_DIR, "GCC", 0, 0 }, - /* For cross-compilation, this dir name is generated - automatically in Makefile.in. */ - { CROSS_INCLUDE_DIR, 0, 0, 0 }, - /* This is another place that the target system's headers might be. */ - { TOOL_INCLUDE_DIR, "BINUTILS", 0, 0 }, -#else /* not CROSS_COMPILE */ - /* This should be /use/local/include and should come before - the fixincludes-fixed header files. */ - { LOCAL_INCLUDE_DIR, 0, 0, 1 }, - /* This is here ahead of GCC_INCLUDE_DIR because assert.h goes here. - Likewise, behind LOCAL_INCLUDE_DIR, where glibc puts its assert.h. */ - { TOOL_INCLUDE_DIR, "BINUTILS", 0, 0 }, - /* This is the dir for fixincludes. Put it just before - the files that we fix. */ - { GCC_INCLUDE_DIR, "GCC", 0, 0 }, - /* Some systems have an extra dir of include files. */ -#ifdef SYSTEM_INCLUDE_DIR - { SYSTEM_INCLUDE_DIR, 0, 0, 0 }, -#endif - { STANDARD_INCLUDE_DIR, 0, 0, 0}, -#endif /* not CROSS_COMPILE */ - { 0, 0, 0, 0} - }; -#endif /* no INCLUDE_DEFAULTS */ - + int x1, x2; } include_defaults[10]; /* Datatype for lists of directories or filenames. */ struct string_list { @@ -4554,6 +4521,161 @@ int longind; int c; const char *params = ""; + + /* Fill in the include_defaults array */ +#define add_to_include(_var, _fname, _component, _cplusplus, _cxx_aware) \ + do { _var.fname = _fname; \ + _var.component = _component; \ + _var.x1 = _cplusplus; \ + _var.x2 = _cxx_aware; } while (0); + int ind = 0; + char *cross_dir; + char *family_cpu; + + if (! find_family_cpu(&family_cpu)) { + notice ("%s: the CROSS_COMPILE environment variable is not set\n", + pname); + exit (FATAL_EXIT_CODE); + } + + find_cross_dir(argv[0], &cross_dir, 0); + if (cross_dir) + { + add_to_include(include_defaults[ind], + replace(cross_dir, GPLUSPLUS_INCLUDE_DIR), + "G++", 1, 1); + ind++; +#ifdef CROSS_COMPILE + add_to_include(include_defaults[ind], + replace(cross_dir, GCC_INCLUDE_DIR), + "GCC", 0, 0); + ind++; + add_to_include(include_defaults[ind], + replace(cross_dir, CROSS_INCLUDE_DIR), + "GCC", 0, 0); + ind++; + +#ifdef TOOL_INCLUDE_DIR + add_to_include(include_defaults[ind], + replace(cross_dir, TOOL_INCLUDE_DIR), + "BINUTILS", 0, 1); + ind++; +#endif + { + char * target_include_dir = concat(cross_dir, "/../", + family_cpu, "/usr/include", NULL_PTR); + char * gxx_target_include_dir = concat(cross_dir, "/../", + family_cpu, "/usr/include/g++-3", + NULL_PTR); + if (gxx_target_include_dir) { + add_to_include(include_defaults[ind], gxx_target_include_dir, + 0, 1, 1); + ind++; + } + + if (target_include_dir) { + add_to_include(include_defaults[ind], target_include_dir, + 0, 0, 0); + ind++; + } + } +#else /* not CROSS_COMPILE */ +#ifdef LOCAL_INCLUDE_DIR + add_to_include(include_defaults[ind], + replace(cross_dir, LOCAL_INCLUDE_DIR), 0, 0, 1); + ind++; +#endif +#ifdef TOOL_INCLUDE_DIR + add_to_include(include_defaults[ind], + replace(cross_dir, TOOL_INCLUDE_DIR), + "BINUTILS", 0, 1); + ind++; +#endif + add_to_include(include_defaults[ind], + replace(cross_dir, GCC_INCLUDE_DIR), + "GCC", 0, 0); + ind++; +#ifdef SYSTEM_INCLUDE_DIR + add_to_include(include_defaults[ind], + replace(cross_dir, SYSTEM_INCLUDE_DIR), + 0, 0, 0); + ind++; +#endif +#ifdef STANDARD_INCLUDE_DIR + add_to_include(include_defaults[ind], + replace(cross_dir, STANDARD_INCLUDE_DIR), + 0, 0, 0); + ind++; +#endif + +#endif /* not CROSS_COMPILE */ + } + else + { + add_to_include(include_defaults[ind], GPLUSPLUS_INCLUDE_DIR, + "G++", 1, 1); + ind++; +#ifdef CROSS_COMPILE + add_to_include(include_defaults[ind], GCC_INCLUDE_DIR, + "GCC", 0, 0); + ind++; + add_to_include(include_defaults[ind], CROSS_INCLUDE_DIR, + "GCC", 0, 0); + ind++; + +#ifdef TOOL_INCLUDE_DIR + add_to_include(include_defaults[ind], TOOL_INCLUDE_DIR, + "BINUTILS", 0, 1); + ind++; +#endif + { + char * target_include_dir = concat(GCC_INCLUDE_DIR, "/../", + family_cpu, "/usr/include", NULL_PTR); + char * gxx_target_include_dir = concat(GCC_INCLUDE_DIR, "/../", + family_cpu, "/usr/include/g++-3", + NULL_PTR); + if (gxx_target_include_dir) { + add_to_include(include_defaults[ind], gxx_target_include_dir, + 0, 1, 1); + ind++; + } + + if (target_include_dir) { + add_to_include(include_defaults[ind], target_include_dir, + 0, 0, 0); + ind++; + } + } +#else /* not CROSS_COMPILE */ +#ifdef LOCAL_INCLUDE_DIR + add_to_include(include_defaults[ind], LOCAL_INCLUDE_DIR, + 0, 0, 1); + ind++; +#endif +#ifdef TOOL_INCLUDE_DIR + add_to_include(include_defaults[ind], TOOL_INCLUDE_DIR, + "BINUTILS", 0, 1); + ind++; +#endif + add_to_include(include_defaults[ind], GCC_INCLUDE_DIR, + "GCC", 0, 0); + ind++; +#ifdef SYSTEM_INCLUDE_DIR + add_to_include(include_defaults[ind], SYSTEM_INCLUDE_DIR, + 0, 0, 0); + ind++; +#endif +#ifdef STANDARD_INCLUDE_DIR + add_to_include(include_defaults[ind], STANDARD_INCLUDE_DIR, + 0, 0, 0); + ind++; +#endif + +#endif /* not CROSS_COMPILE */ + } + add_to_include(include_defaults[ind], 0, 0, 0, 0); + +#undef add_to_include pname = strrchr (argv[0], '/'); pname = pname ? pname+1 : argv[0];