summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1994-08-08 04:30:17 +0000
committerphk <phk@FreeBSD.org>1994-08-08 04:30:17 +0000
commitd76e884d30bd6944b16d425372c9d21302898c85 (patch)
tree882d6a1f1c151d928ad446760293506738c518b2 /gnu
parentbf39175a9eb4cfae6bd49290d1e77a0abb5b0ac6 (diff)
downloadFreeBSD-src-d76e884d30bd6944b16d425372c9d21302898c85.zip
FreeBSD-src-d76e884d30bd6944b16d425372c9d21302898c85.tar.gz
gcc260.patch:
moved to the logical name. libg++-2.6.patch: FOO_MAX in limits.h isn't in hex under 2.0 (for the time being ??) libg++-2.6.tcl: it works on my 1.1.5.1 system. I cannot test it here until gcc-2.6.0 is installed. gnu2bmake.tcl: enhanced various ways. README: says "don't hack the bmaked sources" gcc-2.6.0.tcl: added the gen-* and md files to the bmaked sources. Not used by makefiles. Do I need to add other files Garrett ?
Diffstat (limited to 'gnu')
-rw-r--r--gnu/gnu2bmake/README4
-rw-r--r--gnu/gnu2bmake/gcc-2.6.0.patch513
-rw-r--r--gnu/gnu2bmake/gcc-2.6.0.tcl27
-rw-r--r--gnu/gnu2bmake/gnu2bmake.tcl37
-rw-r--r--gnu/gnu2bmake/libg++-2.6.patch45
-rw-r--r--gnu/gnu2bmake/libg++-2.6.tcl89
6 files changed, 661 insertions, 54 deletions
diff --git a/gnu/gnu2bmake/README b/gnu/gnu2bmake/README
index 1516846..3daac9e 100644
--- a/gnu/gnu2bmake/README
+++ b/gnu/gnu2bmake/README
@@ -1,6 +1,10 @@
This directory contains tools to convert GNU-distributions into bmake-able
trees to be included in the FreeBSD distribution.
+*** If you want to hack and of the GNU-sources, get the real thing !
+*** We only do this because it is easier for us to cut a release when
+*** all directories are "bmakeable".
+
The tools are written in Tcl, so you need to install that first.
If there is a patch-file, you should apply that to the distribution first.
diff --git a/gnu/gnu2bmake/gcc-2.6.0.patch b/gnu/gnu2bmake/gcc-2.6.0.patch
new file mode 100644
index 0000000..dfcb2d1
--- /dev/null
+++ b/gnu/gnu2bmake/gcc-2.6.0.patch
@@ -0,0 +1,513 @@
+I have removed the "ljo-Fortran" stuff. It doesn't belong in cc. /phk
+
+From kralizec.zeta.org.au!bde Sat Jul 30 22:53:11 1994
+Return-Path: <bde@kralizec.zeta.org.au>
+Received: from warrane.connect.com.au by tfs.com (smail3.1.28.1) with SMTP
+ id m0qUTpa-0003wvC; Sat, 30 Jul 94 22:53 PDT
+Received: from kralizec.zeta.org.au by warrane.connect.com.au with SMTP id AA24021
+ (5.67b8/IDA-1.5 for <phk@TFS.COM>); Sun, 31 Jul 1994 15:51:38 +1000
+Received: (from bde@localhost) by kralizec.zeta.org.au (8.6.9/8.6.9) id PAA00298 for phk@TFS.COM; Sun, 31 Jul 1994 15:51:11 +1000
+Date: Sun, 31 Jul 1994 15:51:11 +1000
+From: Bruce Evans <bde@kralizec.zeta.org.au>
+Message-Id: <199407310551.PAA00298@kralizec.zeta.org.au>
+To: phk@tfs.com
+Subject: Re: gcc-2.6.0, diff netbsd/freebsd
+
+---
+>> I've compiled nothing else with 2.6.0, but it bootstraps fine on my
+>> 1.1R system. What's the problem with stddef.h? I haven't had any
+>> troubles here with that file.
+>Probably nothing serious, but I already has it on my list.
+
+Here are the diffs for my port of gcc-2.6.0. FreeBSD-1.1.5 and 4.4lite
+have an amazing number of bugs in involving namespace pollution from the
+runetype stuff. rune_t should never have been in <stddef.h>. <ctype.h>
+does not compile if _ANSI_SOURCE is defined ...
+
+Bruce
+
+Makefile.in:
+ Rip out debugging stuff from libgcc.a the same as FreeBSD does.
+
+final.c:
+ o If NO_PROFILE_DATA is defined, don't waste space for unused
+ profile data.
+
+config/i386/freebsd.h:
+ o Define specs together near the start.
+ o For -p and -pg, put -Bstatic in LINK_SPEC instead of in LIB_SPEC
+ so that it gets seen early enough when other libraries are used.
+ o Update wchar_t stuff. `wchar_t foo[] = "123";' is broken in
+ FreeBSD-1.1.5 because wchar_t was changed without changing gcc.
+ I guess nothing actually uses wchar_t :-).
+ o FUNCTION_PROFILER: don't waste space and time for unused profile
+ data and pointer to it. Compatible with FreeBSD-1.x.
+ o FUNCTION_PROFILER_EPILOGUE: for accurate profiling if there's
+ a readable clock. Incompatible with FreeBSD-1.x (hide it with
+ #if 0, or add a dummy mexitcount to the user mcount file and
+ a real mexitexit to the kernel mcount file). Need a -mflag for
+ this. Want more profiling stuff (profile before function
+ prologue...) from osfrose.h.
+ o Fixed white space in "svr4" stuff. Actually it's osfrose stuff.
+ Formatting now matches osfrose.h.
+
+config/i386/i386.c:
+ o Fix bugs: profiling may use the pic register. Need a macro for
+ this - it is machine-dependent. It is already fixed in osfrose.h
+ by not using the functions in i386.c.
+ o Support FUNCTION_PROFILER_EPILOGUE. Avoiding the use of the pic
+ register is even more complicated for the epilogue than for the
+ prologue. We don't attempt to. See osfrose.h for the prologue.
+
+config/i386/i386.h:
+ o Avoid average 1.2% code bloat caused by stupid register allocation.
+
+ginclude/stdarg.h, ginclude/varargs.h:
+ o Handle Net/2 _VA_LIST_ and 4.4lite _BSD_VA_LIST_ right.
+
+ginclude/stddef.h:
+ o Handle Net/2 _WCHAR_T_ and 4.4lite _BSD_WCHAR_T_ less wrongly than
+ before. Copy FreeBSD-1.1.5/4.4lite rune_t brokenness. Remove
+ extra underscores in _GCC_*_T_ which stopped the Net/2 _PTRDIFF_T_,
+ _SIZE_T_ and _WCHAR_T_ from being undefined. Still need to
+ handle the 4.4lite _BSD_PTRDIFF_T_ and _BSD_SIZE_T_. They are too
+ hard to handle using ifdefs anyway. stddef.h takes 227 lines to
+ define only 3 ANSI typedefs, 1 bogus typedef and 2 ANSI macros.
+
+diff -rc2 gcc-2.6.0/orig/Makefile.in gcc-2.6.0/Makefile.in
+*** gcc-2.6.0/orig/Makefile.in Thu Jul 14 08:46:54 1994
+--- gcc-2.6.0/Makefile.in Sun Jul 17 05:36:06 1994
+***************
+*** 212,216 ****
+ # we use this here because that should be enough, and also
+ # so that -g1 will be tested.
+! LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) -g1
+
+ # Additional options to use when compiling libgcc2.a.
+--- 213,217 ----
+ # we use this here because that should be enough, and also
+ # so that -g1 will be tested.
+! LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) # -g1
+
+ # Additional options to use when compiling libgcc2.a.
+***************
+*** 714,717 ****
+--- 716,720 ----
+ if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
+ mv libgcc1.o $${name}.o; \
++ ld -r -x $${name}.o; mv a.out $${name}.o; \
+ $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}.o; \
+ rm -f $${name}.o; \
+***************
+*** 733,736 ****
+--- 736,740 ----
+ $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c $${file}; \
+ if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
++ ld -r -x $${name}.o; mv a.out $${name}.o; \
+ $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}.o; \
+ if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
+***************
+*** 794,797 ****
+--- 798,802 ----
+ $(srcdir)/libgcc2.c -o $${name}.o; \
+ if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
++ ld -r -x $${name}.o; mv a.out $${name}.o; \
+ $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}.o; \
+ rm -f $${name}.o; \
+***************
+*** 813,816 ****
+--- 818,822 ----
+ $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
+ if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
++ ld -r -x $${name}.o; mv a.out $${name}.o; \
+ $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}.o; \
+ rm -f $${name}.[so]; \
+diff -rc2 gcc-2.6.0/orig/final.c gcc-2.6.0/final.c
+*** gcc-2.6.0/orig/final.c Wed Jul 13 11:30:52 1994
+--- gcc-2.6.0/final.c Sun Jul 17 05:49:35 1994
+***************
+*** 954,965 ****
+--- 954,969 ----
+ FILE *file;
+ {
++ #ifndef NO_PROFILE_DATA
+ int align = MIN (BIGGEST_ALIGNMENT, POINTER_SIZE);
++ #endif /* not NO_PROFILE_DATA */
+ int sval = current_function_returns_struct;
+ int cxt = current_function_needs_context;
+
++ #ifndef NO_PROFILE_DATA
+ data_section ();
+ ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT));
+ ASM_OUTPUT_INTERNAL_LABEL (file, "LP", profile_label_no);
+ assemble_integer (const0_rtx, POINTER_SIZE / BITS_PER_UNIT, 1);
++ #endif /* not NO_PROFILE_DATA */
+
+ text_section ();
+diff -rc2 gcc-2.6.0/config/i386/orig/freebsd.h gcc-2.6.0/config/i386/freebsd.h
+*** gcc-2.6.0/config/i386/orig/freebsd.h Fri Jul 15 02:55:14 1994
+--- gcc-2.6.0/config/i386/freebsd.h Sun Jul 17 07:33:20 1994
+***************
+*** 40,46 ****
+--- 40,52 ----
+ }
+
++ #define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k}"
++
+ /* Like the default, except no -lg. */
+ #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
+
++ #define LINK_SPEC \
++ "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} %{assert*} \
++ %{p:-Bstatic} %{pg:-Bstatic} %{Z}"
++
+ #undef SIZE_TYPE
+ #define SIZE_TYPE "unsigned int"
+***************
+*** 50,77 ****
+
+ #undef WCHAR_TYPE
+! #define WCHAR_TYPE "short unsigned int"
+
+! #define WCHAR_UNSIGNED 1
+
+ #undef WCHAR_TYPE_SIZE
+! #define WCHAR_TYPE_SIZE 16
+
+ #define HAVE_ATEXIT
+
+! /* Redefine this to use %eax instead of %edx. */
+ #undef FUNCTION_PROFILER
+ #define FUNCTION_PROFILER(FILE, LABELNO) \
+ { \
+ if (flag_pic) \
+! { \
+! fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%eax\n", \
+! LPREFIX, (LABELNO)); \
+! fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+! } \
+ else \
+! { \
+! fprintf (FILE, "\tmovl $%sP%d,%%eax\n", LPREFIX, (LABELNO)); \
+! fprintf (FILE, "\tcall mcount\n"); \
+! } \
+ }
+
+--- 56,89 ----
+
+ #undef WCHAR_TYPE
+! #define WCHAR_TYPE "int"
+
+! #define WCHAR_UNSIGNED 0
+
+ #undef WCHAR_TYPE_SIZE
+! #define WCHAR_TYPE_SIZE BITS_PER_WORD
+
+ #define HAVE_ATEXIT
+
+! /* Tell final.c that we don't need a label passed to mcount. */
+!
+! #define NO_PROFILE_DATA
+!
+! /* Redefine this to not pass an unused label in %edx. */
+!
+ #undef FUNCTION_PROFILER
+ #define FUNCTION_PROFILER(FILE, LABELNO) \
+ { \
+ if (flag_pic) \
+! fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+! else \
+! fprintf (FILE, "\tcall mcount\n"); \
+! }
+!
+! #define FUNCTION_PROFILER_EPILOGUE(FILE) \
+! { \
+! if (flag_pic) \
+! fprintf (FILE, "\tcall *mexitcount@GOT(%%ebx)\n"); \
+ else \
+! fprintf (FILE, "\tcall mexitcount\n"); \
+ }
+
+***************
+*** 170,174 ****
+ if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
+ { \
+! size_directive_output = 1; \
+ fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
+ assemble_name (FILE, NAME); \
+--- 182,186 ----
+ if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \
+ { \
+! size_directive_output = 1; \
+ fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
+ assemble_name (FILE, NAME); \
+***************
+*** 184,202 ****
+ by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
+
+! #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
+! do { \
+! char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
+! if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
+! && ! AT_END && TOP_LEVEL \
+! && DECL_INITIAL (DECL) == error_mark_node \
+! && !size_directive_output) \
+! { \
+! fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
+! assemble_name (FILE, name); \
+! fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL)));\
+! } \
+ } while (0)
+
+-
+ /* This is how to declare the size of a function. */
+
+--- 196,213 ----
+ by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
+
+! #define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
+! do { \
+! char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
+! if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \
+! && ! AT_END && TOP_LEVEL \
+! && DECL_INITIAL (DECL) == error_mark_node \
+! && !size_directive_output) \
+! { \
+! fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
+! assemble_name (FILE, name); \
+! fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
+! } \
+ } while (0)
+
+ /* This is how to declare the size of a function. */
+
+***************
+*** 219,226 ****
+ } \
+ } while (0)
+-
+- #define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k}"
+- #define LINK_SPEC \
+- "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} %{assert*}"
+
+ /* This section copied from i386/osfrose.h */
+--- 230,233 ----
+diff -rc2 gcc-2.6.0/config/i386/orig/i386.c gcc-2.6.0/config/i386/i386.c
+*** gcc-2.6.0/config/i386/orig/i386.c Tue Apr 12 21:40:35 1994
+--- gcc-2.6.0/config/i386/i386.c Sun Jul 17 06:10:00 1994
+***************
+*** 860,864 ****
+ rtx xops[4];
+ int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
+! || current_function_uses_const_pool);
+
+ xops[0] = stack_pointer_rtx;
+--- 860,865 ----
+ rtx xops[4];
+ int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
+! || current_function_uses_const_pool
+! || profile_flag || profile_block_flag);
+
+ xops[0] = stack_pointer_rtx;
+***************
+*** 921,926 ****
+ int reglimit = (frame_pointer_needed
+ ? FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM);
+! int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
+! || current_function_uses_const_pool);
+
+ #ifdef NON_SAVING_SETJMP
+--- 922,935 ----
+ int reglimit = (frame_pointer_needed
+ ? FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM);
+!
+! #ifdef FUNCTION_PROFILER_EPILOGUE
+! if (profile_flag)
+! return 0;
+! #endif
+!
+! if (flag_pic && (current_function_uses_pic_offset_table
+! || current_function_uses_const_pool
+! || profile_flag || profile_block_flag))
+! return 0;
+
+ #ifdef NON_SAVING_SETJMP
+***************
+*** 933,938 ****
+
+ for (regno = reglimit - 1; regno >= 0; regno--)
+! if ((regs_ever_live[regno] && ! call_used_regs[regno])
+! || (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used))
+ nregs++;
+
+--- 942,946 ----
+
+ for (regno = reglimit - 1; regno >= 0; regno--)
+! if (regs_ever_live[regno] && ! call_used_regs[regno])
+ nregs++;
+
+***************
+*** 955,958 ****
+--- 963,971 ----
+ int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
+ || current_function_uses_const_pool);
++
++ #ifdef FUNCTION_PROFILER_EPILOGUE
++ if (profile_flag)
++ FUNCTION_PROFILER_EPILOGUE (file);
++ #endif
+
+ /* Compute the number of registers to pop */
+diff -rc2 gcc-2.6.0/config/i386/orig/i386.h gcc-2.6.0/config/i386/i386.h
+*** gcc-2.6.0/config/i386/orig/i386.h Thu Jun 16 20:36:13 1994
+--- gcc-2.6.0/config/i386/i386.h Mon Jul 18 19:18:59 1994
+***************
+*** 267,272 ****
+
+ #define REG_ALLOC_ORDER \
+! /*dx,cx,ax,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7,arg*/ \
+! { 1, 2, 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }
+
+ /* Macro to conditionally modify fixed_regs/call_used_regs. */
+--- 267,272 ----
+
+ #define REG_ALLOC_ORDER \
+! /*ax,cx,dx,bx,si,di,bp,sp,st,st1,st2,st3,st4,st5,st6,st7,arg*/ \
+! { 0, 2, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }
+
+ /* Macro to conditionally modify fixed_regs/call_used_regs. */
+diff -rc2 gcc-2.6.0/ginclude/orig/stdarg.h gcc-2.6.0/ginclude/stdarg.h
+*** gcc-2.6.0/ginclude/orig/stdarg.h Sat Jul 9 12:04:08 1994
+--- gcc-2.6.0/ginclude/stdarg.h Mon Jul 18 01:32:16 1994
+***************
+*** 44,47 ****
+--- 44,56 ----
+ #ifndef __GNUC_VA_LIST
+ #define __GNUC_VA_LIST
++ #if defined (__FreeBSD__)
++ /* This is the correct way to handle all BSD NET2 and BSD 4.4 systems. */
++ #include <machine/ansi.h>
++ #ifdef _BSD_VA_LIST_
++ typedef _BSD_VA_LIST_ __gnuc_va_list;
++ #else
++ typedef _VA_LIST_ __gnuc_va_list;
++ #endif
++ #else
+ #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX)
+ typedef char *__gnuc_va_list;
+***************
+*** 50,53 ****
+--- 59,63 ----
+ #endif
+ #endif
++ #endif
+
+ /* Define the standard macros for the user,
+***************
+*** 113,118 ****
+--- 123,133 ----
+ #endif
+
++ #if 0
++ /* BSD 4.4 actually spells the name _BSD_VA_LIST_ and requires it to be
++ * defined and usable in place of va_list when the latter name is not
++ * allowed (e.g., in stdio.h - see above). */
+ #ifdef _BSD_VA_LIST
+ #undef _BSD_VA_LIST
++ #endif
+ #endif
+
+diff -rc2 gcc-2.6.0/ginclude/orig/stddef.h gcc-2.6.0/ginclude/stddef.h
+*** gcc-2.6.0/ginclude/orig/stddef.h Tue Apr 26 04:13:05 1994
+--- gcc-2.6.0/ginclude/stddef.h Sun Jul 17 21:52:12 1994
+***************
+*** 36,40 ****
+ #define _PTRDIFF_T
+ #endif
+! #ifndef _WCHAR_T_
+ #define _WCHAR_T
+ #endif
+--- 36,40 ----
+ #define _PTRDIFF_T
+ #endif
+! #if ! defined (_WCHAR_T_) && ! defined (_BSD_WCHAR_T_)
+ #define _WCHAR_T
+ #endif
+***************
+*** 173,176 ****
+--- 173,179 ----
+ #define __WCHAR_TYPE__ int
+ #endif
++ #if defined (_ANSI_H_) && defined (_BSD_RUNE_T_)
++ typedef _BSD_RUNE_T_ rune_t; /* WRONG */
++ #endif
+ typedef __WCHAR_TYPE__ wchar_t;
+ #endif
+***************
+*** 189,200 ****
+ are already defined. */
+ #ifdef _ANSI_H_
+! #ifdef _GCC_PTRDIFF_T_
+ #undef _PTRDIFF_T_
+ #endif
+! #ifdef _GCC_SIZE_T_
+ #undef _SIZE_T_
+ #endif
+! #ifdef _GCC_WCHAR_T_
+ #undef _WCHAR_T_
+ #endif
+ #endif /* _ANSI_H_ */
+--- 192,204 ----
+ are already defined. */
+ #ifdef _ANSI_H_
+! #ifdef _GCC_PTRDIFF_T
+ #undef _PTRDIFF_T_
+ #endif
+! #ifdef _GCC_SIZE_T
+ #undef _SIZE_T_
+ #endif
+! #ifdef _GCC_WCHAR_T
+ #undef _WCHAR_T_
++ #undef _BSD_WCHAR_T_
+ #endif
+ #endif /* _ANSI_H_ */
+diff -rc2 gcc-2.6.0/ginclude/orig/varargs.h gcc-2.6.0/ginclude/varargs.h
+*** gcc-2.6.0/ginclude/orig/varargs.h Sat Jul 9 12:04:13 1994
+--- gcc-2.6.0/ginclude/varargs.h Mon Jul 18 01:32:02 1994
+***************
+*** 76,79 ****
+--- 76,88 ----
+ #ifndef __GNUC_VA_LIST
+ #define __GNUC_VA_LIST
++ #if defined (__FreeBSD__)
++ /* This is the correct way to handle all BSD NET2 and BSD 4.4 systems. */
++ #include <machine/ansi.h>
++ #ifdef _BSD_VA_LIST_
++ typedef _BSD_VA_LIST_ __gnuc_va_list;
++ #else
++ typedef _VA_LIST_ __gnuc_va_list;
++ #endif
++ #else
+ #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX)
+ typedef char *__gnuc_va_list;
+***************
+*** 82,85 ****
+--- 91,95 ----
+ #endif
+ #endif
++ #endif
+
+ #define va_start(AP) AP=(char *) &__builtin_va_alist
+***************
+*** 171,175 ****
+--- 181,190 ----
+ /* The next BSD release (if there is one) wants this symbol to be
+ undefined instead of _VA_LIST_. */
++ #if 0
++ /* BSD 4.4 actually spells the name _BSD_VA_LIST_ and requires it to be
++ * defined and usable in place of va_list when the latter name is not
++ * allowed (e.g., in stdio.h - see ginclude/stdarg.h). */
+ #ifdef _BSD_VA_LIST
+ #undef _BSD_VA_LIST
++ #endif
+ #endif
diff --git a/gnu/gnu2bmake/gcc-2.6.0.tcl b/gnu/gnu2bmake/gcc-2.6.0.tcl
index 83f1ebf..65c862b 100644
--- a/gnu/gnu2bmake/gcc-2.6.0.tcl
+++ b/gnu/gnu2bmake/gcc-2.6.0.tcl
@@ -15,13 +15,13 @@ source gnu2bmake.tcl
#######################################################################
# Parameters to tweak
########
-set sdir /u7/gcc-2.6.0
-set ddir /usr/src/gnu/usr.bin/cc26
+set sdir /a/phk/gcc-2.6.0
+set ddir /a/phk/cc26
#######################################################################
# Do the stunt
########
-sh "cd $sdir ; sh configure"
+sh "cd $sdir ; sh configure i386--freebsd"
# .h files on their way to ~/include
set l_include {config tm pcp tree input c-lex c-tree flags machmode real
@@ -110,6 +110,27 @@ puts $f "SUBDIR=\t\$(PGMDIR)"
puts $f "\n.include <bsd.subdir.mk>"
close $f
+# do ~/legal
+sh "mkdir $ddir/legal"
+sh "cp $sdir/gen-*.c $sdir/md $ddir/legal"
+set f [open $ddir/README w]
+puts $f {
+$FreeBSD$
+
+This directory contains gcc in a form that uses "bmake" makefiles.
+This is not the place you want to start, if you want to hack gcc.
+we have included everything here which is part of the source-code
+of gcc, but still, don't use this as a hacking-base.
+
+If you suspect a problem with gcc, or just want to hack it in general,
+get a complete gcc-X.Y.Z.tar.gz from somewhere, and use that.
+
+Please look in the directory src/gnu/gnu2bmake to find the tools
+to generate these files.
+
+Thankyou.
+}
+
# do ~/libgcc
sh "mkdir $ddir/libgcc"
set f [open $ddir/libgcc/Makefile w]
diff --git a/gnu/gnu2bmake/gnu2bmake.tcl b/gnu/gnu2bmake/gnu2bmake.tcl
index 3ece69a..7422173 100644
--- a/gnu/gnu2bmake/gnu2bmake.tcl
+++ b/gnu/gnu2bmake/gnu2bmake.tcl
@@ -59,10 +59,10 @@ proc copy_c {src dst files} {
regsub -all {\.c} $files {} files
foreach f $files {
if {![file exists $src/${f}.c]} {
- sh "cd $src ; set +e ; make ${f}.c"
+ sh "cd $src ; set +e ; make ${f}.c ; exit 0"
}
if {![file exists $src/${f}.c]} {
- sh "cd $src ; set +e ; make ${f}.o"
+ sh "cd $src ; set +e ; make ${f}.o ; exit 0"
}
if {![file exists $src/${f}.c]} {
error "Couldn't produce ${f}.c in $src"
@@ -72,13 +72,38 @@ proc copy_c {src dst files} {
}
#######################################################################
+# find_source -- Return a list of sourcefiles.
+# argv[1] source directory
+# argv[2] source list.
+# argv[3] list of extensions
+#
+proc find_source {dir files ext} {
+ set l ""
+ foreach f $files {
+ set k ""
+ foreach i $ext {
+ if {[file exists $dir/${f}${i}]} { set k ${f}${i} ; break }
+ }
+ if {$k == ""} {
+ error "cannot find source for $f using extensions <$ext>"
+ }
+ lappend l $k
+ }
+ return $l
+}
+
+#######################################################################
# zap_suffix -- remove suffixes from list if filenames
# argv[1] list of filenames
# argv[2] (optional) regex matching suffixes to be removed,
# default removes all known suffixes, (AND warts too!).
#
-proc zap_suffix {lst {suf {\.[cyolhsxS]}}} {
- regsub -all $suf $lst {} a
+proc zap_suffix {lst {suf {\.cc$|\.[cyolhsxS]$}}} {
+ set a ""
+ foreach i $lst {
+ regsub -all $suf $i {} i
+ lappend a $i
+ }
return $a
}
@@ -122,11 +147,11 @@ proc basename {lst} {
#
proc makefile_macro {macro dir {makefile Makefile}} {
# Nobody will miss a core file, right ?
- cp $dir/$makefile $dir/make.core
+ sh "cd $dir ; cp $makefile make.core"
set f [open $dir/make.core a]
puts $f "\n\nGNU2TCL_test:\n\t@echo \$\{$macro\}"
close $f
- set a [exec make -f $dir/make.core GNU2TCL_test]
+ set a [exec sh -e -c "cd $dir ; make -f make.core GNU2TCL_test"]
sh "rm -f $dir/make.core"
return $a
}
diff --git a/gnu/gnu2bmake/libg++-2.6.patch b/gnu/gnu2bmake/libg++-2.6.patch
index 922a6de..442342e 100644
--- a/gnu/gnu2bmake/libg++-2.6.patch
+++ b/gnu/gnu2bmake/libg++-2.6.patch
@@ -24,48 +24,3 @@ diff -C2 -r libg++-2.6.orig/config.guess libg++-2.6/config.guess
! echo ${UNAME_MACHINE}-unknown-bsd
exit 0 ;;
i[34]86:NetBSD:*:*)
-diff -C2 -r libg++-2.6.orig/libio/gen-params libg++-2.6/libio/gen-params
-*** libg++-2.6.orig/libio/gen-params Mon Jul 18 18:04:09 1994
---- libg++-2.6/libio/gen-params Sun Jul 31 20:50:12 1994
-***************
-*** 415,432 ****
- default_int64=
- INT16=32767
- INT32=2147483647
- INT64=9223372036854775807
-
-! if [ "${SHRT_MAX}" = $INT16 ] ; then
- default_int16=short
-! if [ "${LONG_MAX}" = $INT32 ] ; then
- default_int32=long
-! if [ "${LONG_LONG_MAX}" = $INT64 ] ; then
- # Most Unices, DOS
- default_int64="long long"
- fi
-! elif [ "${INT_MAX}" = $INT32 ] ; then
- default_int32=int
-! if [ "${LONG_MAX}" = $INT64 ] ; then
- # Some 64-bit Unices, like OSF/1 on the Alpha
- default_int64=long
---- 415,435 ----
- default_int64=
- INT16=32767
-+ INT16X=0x7fff
- INT32=2147483647
-+ INT32X=0x7fffffff
- INT64=9223372036854775807
-+ INT64X=0x7fffffffffffffff
-
-! if [ "${SHRT_MAX}" = $INT16 -o "${SHRT_MAX}" = $INT16X ] ; then
- default_int16=short
-! if [ "${LONG_MAX}" = $INT32 -o "${LONG_MAX}" = $INT32X] ; then
- default_int32=long
-! if [ "${LONG_LONG_MAX}" = $INT64 -o "${LONG_LONG_MAX}" = $INT64X] ; then
- # Most Unices, DOS
- default_int64="long long"
- fi
-! elif [ "${INT_MAX}" = $INT32 -o "${INT_MAX}" = $INT32X] ; then
- default_int32=int
-! if [ "${LONG_MAX}" = $INT64 -o "${LONG_MAX}" = $INT64X] ; then
- # Some 64-bit Unices, like OSF/1 on the Alpha
- default_int64=long
diff --git a/gnu/gnu2bmake/libg++-2.6.tcl b/gnu/gnu2bmake/libg++-2.6.tcl
new file mode 100644
index 0000000..9ae1c9c
--- /dev/null
+++ b/gnu/gnu2bmake/libg++-2.6.tcl
@@ -0,0 +1,89 @@
+#!/usr/local/bin/tclsh
+#
+# ----------------------------------------------------------------------------
+# "THE BEER-WARE LICENSE" (Revision 42):
+# <phk@login.dkuug.dk> wrote this file. As long as you retain this notice you
+# can do whatever you want with this stuff. If we meet some day, and you think
+# this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
+# ----------------------------------------------------------------------------
+#
+# $FreeBSD$
+#
+
+source gnu2bmake.tcl
+
+#######################################################################
+# Parameters to tweak
+########
+set sdir /a/phk/libg++-2.6
+set ddir /a/phk/libg++26
+
+#######################################################################
+# Do the stunt
+########
+sh "cd $sdir ; sh configure i386--bsd"
+
+sh "cd $sdir/libiberty ; make needed-list"
+set l_ib [find_source $sdir/libiberty \
+ [zap_suffix \
+ [makefile_macro LIBIBERTY_OBJECTS_TO_GET \
+ $sdir/libiberty $sdir/libg++/Makefile] \
+ ] \
+ {.cc .C .c}]
+set l_io [find_source $sdir/libio [zap_suffix [makefile_macro \
+ LIBIOSTREAM_OBJECTS $sdir/libio]] {.cc .C .c}]
+
+set l_plus [find_source $sdir/libg++/src \
+ [zap_suffix [makefile_macro OBJS $sdir/libg++/src]] {.cc .C .c}]
+
+set l_ioh ""
+foreach i [zap_suffix $l_io] {
+ if {[file exists $sdir/libio/${i}.h]} { lappend l_ioh ${i}.h }
+}
+set l_plush ""
+foreach i [zap_suffix $l_plus] {
+ if {[file exists $sdir/libg++/src/${i}.h]} { lappend l_plush ${i}.h }
+}
+
+# do ~
+sh "rm -rf $ddir"
+sh "mkdir $ddir $ddir/libg++ $ddir/libio $ddir/libiberty $ddir/include"
+
+copy_l $sdir/libiberty $ddir/libiberty $l_ib
+copy_l $sdir/libiberty $ddir/include {config.h}
+copy_l $sdir/libio $ddir/libio $l_io
+copy_l $sdir/libio $ddir/include $l_ioh
+copy_l $sdir/libio $ddir/include {_G_config.h libioP.h floatio.h strfile.h
+ iostreamP.h libio.h iolibio.h}
+copy_l $sdir/libg++/src $ddir/libg++ $l_plus
+copy_l $sdir/libg++/src $ddir/include $l_plush
+copy_l $sdir/libg++/src $ddir/include {defines.h std.h bitprims.h Integer.hP
+ bitdo1.h bitdo2.h Pix.h}
+copy_l $sdir/include $ddir/include {ansidecl.h libiberty.h}
+
+set f [open $ddir/Makefile w]
+puts $f "#\n# \$FreeBSD\$\n#\n"
+puts $f "SRCS=\t$l_ib"
+puts $f "SRCS+=\t$l_io"
+puts $f "SRCS+=\t$l_plus"
+puts $f "LIB=\tlibg++"
+puts $f "NOMAN=\tnoman"
+puts $f "CFLAGS+=\t-nostdinc -I\${.CURDIR}/include -I/usr/include"
+puts $f "CXXFLAGS+=\t-fexternal-templates"
+puts $f ".PATH:\t\${.CURDIR}/libiberty \${.CURDIR}/libio \${.CURDIR}/libg++"
+puts $f {
+beforeinstall:
+ @-if [ ! -d ${DESTDIR}/usr/include/g++ ]; then \
+ mkdir ${DESTDIR}/usr/include/g++; \
+ chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/g++; \
+ chmod 755 ${DESTDIR}/usr/include/g++; \
+ fi
+ @(cd include ; for j in *.h; do \
+ cmp -s $$j ${DESTDIR}/usr/include/g++/$$j || \
+ install -c -o ${BINOWN} -g ${BINGRP} -m 444 $$j \
+ ${DESTDIR}/usr/include/$$j; \
+ done)
+}
+puts $f ".include <bsd.lib.mk>"
+close $f
+exit 0
OpenPOWER on IntegriCloud