gcc 2.6 is kinda obsolete now.

This commit is contained in:
Peter Wemm 1999-08-27 23:47:15 +00:00
parent 4d1bb12d6c
commit e6c8b48d90
8 changed files with 0 additions and 1826 deletions

View File

@ -1,36 +0,0 @@
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.
You should read the tcl-script first, at least the beginning, to see if there
are any special instructions.
We try to get these patches rolled back into the GNU-distributions, to avoid
code-drift. Please consider very carefully before doing something which isn't
general enough to make it back into the GNU-dist.
If you want to create a new script, here are some hints:
Get as much info as you can from the Makefiles macros.
Use this sequence to test:
make all
make clean ; make all
make cleandir ; make depend ; make all ; make install
make cleandir ; make obj ; make depend ; make all ; make install
make cleandir
Remember to install man-pages (and .texi files ?)
Thanks to Bruce for the patches to gcc, he knows a LOT more about gcc
than I do...
Poul-Henning Kamp
phk@login.dkuug.dk

View File

@ -1,513 +0,0 @@
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

View File

@ -1,259 +0,0 @@
#!/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/gcc-2.6.0
set ddir /a/phk/cc26
#######################################################################
# Do the stunt
########
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
rtl c-parse c-gperf function defaults convert obstack insn-attr
bytecode bc-emit insn-flags expr insn-codes regs hard-reg-set
insn-config loop recog bc-typecd bc-opcode bc-optab typeclass
output basic-block reload integrate conditions bytetypes bi-run
bc-arity multilib stack}
# other files on their way to ~/include
set l_include_x {tree.def machmode.def rtl.def modemap.def bc-typecd.def}
# .h files going into ~/include/i386
set l_include_i386 {perform gstabs gas bsd i386 unix }
# .c source for cpp
set l_cpp {cccp cexp version}
# .c source for cc1
set l_cc1 [zap_suffix [makefile_macro C_OBJS $sdir]]
append l_cc1 " " [zap_suffix [makefile_macro OBJS $sdir]]
append l_cc1 " " [zap_suffix [makefile_macro BC_OBJS $sdir]]
# .c source for cc
set l_cc {gcc version}
append l_cc " " [zap_suffix [makefile_macro OBSTACK $sdir]]
# .c source for c++
set l_cplus [zap_suffix [makefile_macro OBSTACK $sdir]]
# .c source for c++ from "cp" subdir
set l_cplus_cp {g++}
# .c source for cc1plus
set l_cc1plus {c-common}
append l_cc1plus " " [zap_suffix [makefile_macro OBJS $sdir]]
append l_cc1plus " " [zap_suffix [makefile_macro BC_OBJS $sdir]]
# .c source for cc1plus from "cp" subdir
set l_cc1plus_cp {}
append l_cc1plus_cp " " [zap_suffix [makefile_macro CXX_OBJS $sdir/cp]]
# .h file for cc1plus from "cp" subdir
set l_cc1plus_h {lex parse cp-tree decl class hash}
# other file for cc1plus from "cp" subdir
set l_cc1plus_x {tree.def input.c}
# All files used more than once go into the lib.
set l_common [common_set $l_cpp $l_cc1 $l_cc $l_cc1plus $l_cplus]
set l_cpp [reduce_by $l_cpp $l_common]
set l_cc1 [reduce_by $l_cc1 $l_common]
set l_cc [reduce_by $l_cc $l_common]
set l_cplus [reduce_by $l_cplus $l_common]
set l_cc1plus [reduce_by $l_cc1plus $l_common]
# functions in libgcc1
set l_libgcc1 [makefile_macro LIB1FUNCS $sdir]
# functions in libgcc2
set l_libgcc2 [makefile_macro LIB2FUNCS $sdir]
# .c files in libgcc
set l_libgcc {libgcc1.c libgcc2.c}
# .h files in libgcc
set l_libgcc_h {tconfig longlong glimits gbl-ctors}
set version [makefile_macro version $sdir]
set target [makefile_macro target $sdir]
# do ~
sh "rm -rf $ddir"
sh "mkdir $ddir"
set f [open $ddir/Makefile.inc w]
puts $f "#\n# \$FreeBSD\$\n#\n"
puts $f "CFLAGS+=\t-I\${.CURDIR} -I\${.CURDIR}/../include"
puts $f "CFLAGS+=\t-Dbsd4_4"
puts $f "CFLAGS+=\t-DGCC_INCLUDE_DIR=\\\"FOO\\\""
puts $f "CFLAGS+=\t-DDEFAULT_TARGET_VERSION=\\\"$version\\\""
puts $f "CFLAGS+=\t-DDEFAULT_TARGET_MACHINE=\\\"$target\\\""
puts $f "CFLAGS+=\t-DMD_EXEC_PREFIX=\\\"/usr/libexec/\\\""
puts $f "CFLAGS+=\t-DSTANDARD_STARTFILE_PREFIX=\\\"/usr/lib\\\""
close $f
set f [open $ddir/Makefile w]
puts $f "#\n# \$FreeBSD\$\n#\n"
puts $f "PGMDIR=\tcc_int cpp cc1 cc cc1plus c++ libgcc"
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]
puts $f "#\n# \$FreeBSD\$\n#\n"
puts $f "LIB=\tgcc"
puts $f "INSTALL_PIC_ARCHIVE=\tyes"
puts $f "SHLIB_MAJOR=\t26"
puts $f "SHLIB_MINOR=\t0"
puts $f ""
puts $f "LIB1OBJS=\t[add_suffix $l_libgcc1 .o]"
puts $f "LIB2OBJS=\t[add_suffix $l_libgcc2 .o]"
puts $f {
OBJS= ${LIB1OBJS} ${LIB2OBJS}
LIB1SOBJS=${LIB1OBJS:.o=.so}
LIB2SOBJS=${LIB2OBJS:.o=.so}
P1OBJS=${LIB1OBJS:.o=.po}
P2OBJS=${LIB2OBJS:.o=.po}
${LIB1OBJS}: libgcc1.c
${CC} -c ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc1.c
@${LD} -x -r ${.TARGET}
@mv a.out ${.TARGET}
${LIB2OBJS}: libgcc2.c
${CC} -c ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc2.c
@${LD} -x -r ${.TARGET}
@mv a.out ${.TARGET}
.if !defined(NOPIC)
${LIB1SOBJS}: libgcc1.c
${CC} -c -fpic ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc1.c
${LIB2SOBJS}: libgcc2.c
${CC} -c -fpic ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc2.c
.endif
.if !defined(NOPROFILE)
${P1OBJS}: libgcc1.c
${CC} -c -p ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc1.c
${P2OBJS}: libgcc2.c
${CC} -c -p ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc2.c
.endif
.include <bsd.lib.mk>
}
close $f
copy_c $sdir $ddir/libgcc $l_libgcc
# do ~/include
sh "mkdir $ddir/include"
copy_l $sdir $ddir/include [add_suffix $l_include .h]
copy_l $sdir $ddir/include $l_include_x
copy_l $sdir $ddir/include [add_suffix $l_libgcc_h .h]
# do ~/include/i386
sh "mkdir $ddir/include/i386"
copy_l $sdir/config/i386 $ddir/include/i386 [add_suffix $l_include_i386 .h]
# do ~/cc_int
mk_lib $ddir cc_int [add_suffix $l_common .c] {
"NOPROFILE=\t1"
"\ninstall:\n\t@true"
}
copy_c $sdir $ddir/cc_int $l_common
# do ~/cpp
mk_prog $ddir cpp [add_suffix $l_cpp .c] {
"BINDIR=\t/usr/libexec"
"LDDESTDIR+=\t-L\${.CURDIR}/../cc_int/obj"
"LDDESTDIR+=\t-L\${.CURDIR}/../cc_int"
"LDADD+=\t-lcc_int"
}
copy_c $sdir $ddir/cpp $l_cpp
cp $sdir/cpp.1 $ddir/cpp/cpp.1
# do ~/c++
mk_prog $ddir c++ [add_suffix "$l_cplus $l_cplus_cp" .c] {
"BINDIR=\t/usr/bin"
"NOMAN=\t1"
"LDDESTDIR+=\t-L\${.CURDIR}/../cc_int/obj"
"LDDESTDIR+=\t-L\${.CURDIR}/../cc_int"
"LDADD+=\t-lcc_int"
}
copy_c $sdir $ddir/c++ $l_cplus
copy_c $sdir/cp $ddir/c++ $l_cplus_cp
# do ~/cc
mk_prog $ddir cc [add_suffix $l_cc .c] {
"BINDIR=\t/usr/bin"
"MLINKS+=cc.1 gcc.1"
"MLINKS+=cc.1 c++.1"
"MLINKS+=cc.1 g++.1"
"LDDESTDIR+=\t-L\${.CURDIR}/../cc_int/obj"
"LDDESTDIR+=\t-L\${.CURDIR}/../cc_int"
"LDADD+=\t-lcc_int"
"\nafterinstall:\n\tcd \$(DESTDIR)\$(BINDIR) ; rm gcc ; ln -s cc gcc"
}
copy_c $sdir $ddir/cc $l_cc
cp $sdir/gcc.1 $ddir/cc/cc.1
# do ~/cc1
mk_prog $ddir cc1 [add_suffix $l_cc1 .c] {
"BINDIR=\t/usr/libexec"
"NOMAN=\t1"
"LDDESTDIR+=\t-L\${.CURDIR}/../cc_int/obj"
"LDDESTDIR+=\t-L\${.CURDIR}/../cc_int"
"LDADD+=\t-lcc_int"
}
copy_c $sdir $ddir/cc1 $l_cc1
# do ~/cc1plus
mk_prog $ddir cc1plus [add_suffix "$l_cc1plus_cp $l_cc1plus" .c] {
"BINDIR=\t/usr/libexec"
"NOMAN=\t1"
"LDDESTDIR+=\t-L\${.CURDIR}/../cc_int/obj"
"LDDESTDIR+=\t-L\${.CURDIR}/../cc_int"
"LDADD+=\t-lcc_int"
}
copy_l $sdir/cp $ddir/cc1plus $l_cc1plus_x
copy_c $sdir $ddir/cc1plus $l_cc1plus
copy_c $sdir/cp $ddir/cc1plus $l_cc1plus_cp
copy_l $sdir/cp $ddir/cc1plus [add_suffix $l_cc1plus_h .h]
exit 0

View File

@ -1,407 +0,0 @@
# this patch is good for 2.6.1 and 2.6.2
diff -r -c ../../scratch/gcc-2.6.1/cccp.1 ./cccp.1
*** ../../scratch/gcc-2.6.1/cccp.1 Tue May 31 16:29:50 1994
--- ./cccp.1 Mon Nov 14 19:42:44 1994
***************
*** 1,13 ****
.\" Copyright (c) 1991, 1992, 1993 Free Software Foundation \-*-Text-*-
.\" See section COPYING for conditions for redistribution
! .TH cpp 1 "30apr1993" "GNU Tools" "GNU Tools"
.SH NAME
! cccp, cpp \- The GNU C-Compatible Compiler Preprocessor.
.SH SYNOPSIS
.hy 0
.na
.TP
! .B cccp
.RB "[\|" \-$ "\|]"
.RB "[\|" \-A \c
.I predicate\c
--- 1,13 ----
.\" Copyright (c) 1991, 1992, 1993 Free Software Foundation \-*-Text-*-
.\" See section COPYING for conditions for redistribution
! .TH cpp 1 "30, April 1993" "FreeBSD" "GNU Tools"
.SH NAME
! cpp \- Compiler Preprocessor.
.SH SYNOPSIS
.hy 0
.na
.TP
! .B cpp
.RB "[\|" \-$ "\|]"
.RB "[\|" \-A \c
.I predicate\c
***************
*** 142,154 ****
Most often when you use the C preprocessor you will not have to invoke it
explicitly: the C compiler will do so automatically. However, the
preprocessor is sometimes useful individually.
-
- When you call the preprocessor individually, either name
- (\c
- .B cpp\c
- \& or \c
- .B cccp\c
- \&) will do\(em\&they are completely synonymous.
The C preprocessor expects two file names as arguments, \c
.I infile\c
--- 142,147 ----
Only in .: cccp.1.orig
diff -r -c ../../scratch/gcc-2.6.1/cccp.c ./cccp.c
*** ../../scratch/gcc-2.6.1/cccp.c Tue Oct 25 15:37:44 1994
--- ./cccp.c Mon Nov 14 19:40:30 1994
***************
*** 188,194 ****
#ifndef VMS
#ifndef HAVE_STRERROR
extern int sys_nerr;
! #if defined(bsd4_4) || defined(__NetBSD__)
extern const char *const sys_errlist[];
#else
extern char *sys_errlist[];
--- 188,194 ----
#ifndef VMS
#ifndef HAVE_STRERROR
extern int sys_nerr;
! #if defined(bsd4_4) || defined(__NetBSD__) || defined(__FreeBSD__)
extern const char *const sys_errlist[];
#else
extern char *sys_errlist[];
Only in .: cccp.c.orig
Only in .: cccp.c.rej
diff -r -c ../../scratch/gcc-2.6.1/config/i386/freebsd.h ./config/i386/freebsd.h
*** ../../scratch/gcc-2.6.1/config/i386/freebsd.h Tue Oct 18 17:59:52 1994
--- ./config/i386/freebsd.h Mon Nov 14 19:41:07 1994
***************
*** 19,27 ****
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
- /* This goes away when the math-emulator is fixed */
- #define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
-
/* This is tested by i386gas.h. */
#define YES_UNDERSCORES
--- 19,24 ----
***************
*** 31,37 ****
#include "i386/perform.h"
#undef CPP_PREDEFINES
! #define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -D__386BSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
#define INCLUDE_DEFAULTS { \
{ "/usr/include", 0 }, \
--- 28,34 ----
#include "i386/perform.h"
#undef CPP_PREDEFINES
! #define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__=2 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
#define INCLUDE_DEFAULTS { \
{ "/usr/include", 0 }, \
***************
*** 39,47 ****
--- 36,54 ----
{ 0, 0} \
}
+ #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}"
+
+ /* This goes away when the math emulator is fixed. */
+ #undef TARGET_DEFAULT
+ #define TARGET_DEFAULT (MASK_NO_FANCY_MATH_387 | 0301)
+
#undef SIZE_TYPE
#define SIZE_TYPE "unsigned int"
***************
*** 49,80 ****
#define PTRDIFF_TYPE "int"
#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"); \
! } \
}
/* There are conflicting reports about whether this system uses
a different assembler syntax. wilson@cygnus.com says # is right. */
#undef COMMENT_BEGIN
--- 56,95 ----
#define PTRDIFF_TYPE "int"
#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"); \
}
+ #if 0 /* not ready for this; it should be decided at compile time */
+ #define FUNCTION_PROFILER_EPILOGUE(FILE) \
+ { \
+ if (flag_pic) \
+ fprintf (FILE, "\tcall *mexitcount@GOT(%%ebx)\n"); \
+ else \
+ fprintf (FILE, "\tcall mexitcount\n"); \
+ }
+ #endif
+
/* There are conflicting reports about whether this system uses
a different assembler syntax. wilson@cygnus.com says # is right. */
#undef COMMENT_BEGIN
***************
*** 218,227 ****
putc ('\n', FILE); \
} \
} while (0)
-
- #define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k}"
- #define LINK_SPEC \
- "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} %{assert*}"
/* This is defined when gcc is compiled in the BSD-directory-tree, and must
* make up for the gap to all the stuff done in the GNU-makefiles.
--- 233,238 ----
Only in ./config/i386: freebsd.h.orig
diff -r -c ../../scratch/gcc-2.6.1/config/i386/i386.c ./config/i386/i386.c
*** ../../scratch/gcc-2.6.1/config/i386/i386.c Fri Oct 7 12:45:14 1994
--- ./config/i386/i386.c Mon Nov 14 19:41:27 1994
***************
*** 1097,1103 ****
int limit;
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;
xops[1] = frame_pointer_rtx;
--- 1097,1104 ----
int limit;
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;
xops[1] = frame_pointer_rtx;
***************
*** 1158,1165 ****
int nregs = 0;
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
if (NON_SAVING_SETJMP && current_function_calls_setjmp)
--- 1159,1174 ----
int nregs = 0;
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
if (NON_SAVING_SETJMP && current_function_calls_setjmp)
***************
*** 1170,1177 ****
return 0;
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++;
return nregs == 0 || ! frame_pointer_needed;
--- 1179,1185 ----
return 0;
for (regno = reglimit - 1; regno >= 0; regno--)
! if (regs_ever_live[regno] && ! call_used_regs[regno])
nregs++;
return nregs == 0 || ! frame_pointer_needed;
***************
*** 1193,1198 ****
--- 1201,1211 ----
rtx xops[3];
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 */
Only in ./config/i386: i386.c.orig
diff -r -c ../../scratch/gcc-2.6.1/cp/g++.c ./cp/g++.c
*** ../../scratch/gcc-2.6.1/cp/g++.c Sat Oct 29 04:17:44 1994
--- ./cp/g++.c Mon Nov 14 19:41:16 1994
***************
*** 84,90 ****
#endif
extern int sys_nerr;
! #if defined(bsd4_4) || defined(__NetBSD__)
extern const char *const sys_errlist[];
#else
extern char *sys_errlist[];
--- 84,90 ----
#endif
extern int sys_nerr;
! #if defined(bsd4_4) || defined(__NetBSD__) || defined(__FreeBSD__)
extern const char *const sys_errlist[];
#else
extern char *sys_errlist[];
Only in ./cp: g++.c.orig
Only in ../../scratch/gcc-2.6.1: cpp.1
Only in .: cpp.1.orig
Only in .: cpp.1.rej
Only in .: cpp.1.rej.orig
diff -r -c ../../scratch/gcc-2.6.1/final.c ./final.c
*** ../../scratch/gcc-2.6.1/final.c Tue Sep 20 17:05:03 1994
--- ./final.c Mon Nov 14 19:40:32 1994
***************
*** 957,970 ****
--- 957,974 ----
profile_function (file)
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 ();
Only in .: final.c.orig
Only in .: final.c.rej
diff -r -c ../../scratch/gcc-2.6.1/gcc.c ./gcc.c
*** ../../scratch/gcc-2.6.1/gcc.c Thu Oct 27 15:49:58 1994
--- ./gcc.c Mon Nov 14 19:41:18 1994
***************
*** 166,172 ****
#endif
extern int sys_nerr;
! #if defined(bsd4_4) || defined(__NetBSD__)
extern const char *const sys_errlist[];
#else
extern char *sys_errlist[];
--- 166,172 ----
#endif
extern int sys_nerr;
! #if defined(bsd4_4) || defined(__NetBSD__) || defined (__FreeBSD__)
extern const char *const sys_errlist[];
#else
extern char *sys_errlist[];
***************
*** 711,716 ****
--- 711,745 ----
%{!S:%{!gnatc:%{!gnats:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
%{c:%W{o*}%{!o*:-o %w%b.o}}\
%{!c:-o %d%w%u.o} %{!pipe:%g.s} %A\n}}}}}} "},
+ /***** ljo's Fortran rule *****/
+ {".f", "@f2c"},
+ {"@f2c",
+ "f2c %{checksubscripts:-C} %{I2} %{onetrip} %{honorcase:-U} %{u} %{w}\
+ %{ANSIC:-A} %{a} %{C++}\
+ %{c} %{E} %{ec} %{ext} %{f} %{72} %{g} %{h} %{i2} %{kr}\
+ %{P} %{p} %{r} %{r8} %{s} %{w8} %{z} %{N*}\
+ %i %{!pipe: -o %g.c} %{pipe:-o -}|\n",
+ "cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
+ %{C:%{!E:%eGNU C does not support -C without using -E}}\
+ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
+ -undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\
+ %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
+ %{!undef:%{!ansi:%p} %P} %{trigraphs} \
+ %c %{O*:%{!O0:-D__OPTIMIZE__}} %{traditional} %{ftraditional:-traditional}\
+ %{traditional-cpp:-traditional}\
+ %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*}\
+ %{pipe:-} %{!pipe:%g.c} %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
+ "%{!M:%{!MM:%{!E:cc1 %{!pipe:%g.i} %1 \
+ %{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a}\
+ %{g*} %{O*} %{W*} %{w} %{pedantic*} %{ansi} \
+ %{traditional} %{v:-version} %{pg:-p} %{p} %{f*}\
+ %{aux-info*}\
+ %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
+ %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
+ %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
+ %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o}\
+ %{!pipe:%g.s} %A\n }}}}"},
+ /***** End of ljo's Fortran rule *****/
/* Mark end of table */
{0, 0}
};
Only in .: gcc.c.orig

View File

@ -1,275 +0,0 @@
#!/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$
#
# Good for 2.6.1 and 2.6.2
source gnu2bmake.tcl
#######################################################################
# Parameters to tweak
########
set sdir /freebsd/gcc-2.6.2
set ddir /freebsd/cc262
#######################################################################
# Do the stunt
########
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
rtl c-parse c-gperf function defaults convert obstack insn-attr
bytecode bc-emit insn-flags expr insn-codes regs hard-reg-set
insn-config loop recog bc-typecd bc-opcode bc-optab typeclass
output basic-block reload integrate conditions bytetypes bi-run
bc-arity multilib stack}
# other files on their way to ~/include
set l_include_x {tree.def machmode.def rtl.def modemap.def bc-typecd.def}
# .h files going into ~/include/i386
set l_include_i386 {perform gstabs gas bsd i386 unix }
# .c source for cpp
set l_cpp {cccp cexp version}
# .c source for cc1
set l_cc1 [zap_suffix [makefile_macro C_OBJS $sdir]]
append l_cc1 " " [zap_suffix [makefile_macro OBJS $sdir]]
append l_cc1 " " [zap_suffix [makefile_macro BC_OBJS $sdir]]
# .c source for cc
set l_cc {gcc version}
append l_cc " " [zap_suffix [makefile_macro OBSTACK $sdir]]
# .c source for c++
set l_cplus [zap_suffix [makefile_macro OBSTACK $sdir]]
# .c source for c++ from "cp" subdir
set l_cplus_cp {g++}
# .c source for cc1plus
set l_cc1plus {c-common}
append l_cc1plus " " [zap_suffix [makefile_macro OBJS $sdir]]
append l_cc1plus " " [zap_suffix [makefile_macro BC_OBJS $sdir]]
# .c source for cc1plus from "cp" subdir
set l_cc1plus_cp {}
append l_cc1plus_cp " " [zap_suffix [makefile_macro CXX_OBJS $sdir/cp]]
# .h file for cc1plus from "cp" subdir
set l_cc1plus_h {lex parse cp-tree decl class hash}
# other file for cc1plus from "cp" subdir
set l_cc1plus_x {tree.def input.c}
# All files used more than once go into the lib.
set l_common [common_set $l_cpp $l_cc1 $l_cc $l_cc1plus $l_cplus]
set l_cpp [reduce_by $l_cpp $l_common]
set l_cc1 [reduce_by $l_cc1 $l_common]
set l_cc [reduce_by $l_cc $l_common]
set l_cplus [reduce_by $l_cplus $l_common]
set l_cc1plus [reduce_by $l_cc1plus $l_common]
# functions in libgcc1
set l_libgcc1 [makefile_macro LIB1FUNCS $sdir]
# functions in libgcc2
set l_libgcc2 [makefile_macro LIB2FUNCS $sdir]
# .c files in libgcc
set l_libgcc {libgcc1.c libgcc2.c}
# .h files in libgcc
set l_libgcc_h {tconfig longlong glimits gbl-ctors}
set version [makefile_macro version $sdir]
set target [makefile_macro target $sdir]
# do ~
sh "rm -rf $ddir"
sh "mkdir $ddir"
set f [open $ddir/Makefile.inc w]
puts $f "#\n# \$FreeBSD$\n#\n"
puts $f "CFLAGS+=\t-I\${.CURDIR} -I\${.CURDIR}/../include"
puts $f "CFLAGS+=\t-Dbsd4_4"
puts $f "CFLAGS+=\t-DGCC_INCLUDE_DIR=\\\"FOO\\\""
puts $f "CFLAGS+=\t-DTOOL_INCLUDE_DIR=\\\"FOO\\\""
puts $f "CFLAGS+=\t-DGPLUSPLUS_INCLUDE_DIR=\\\"FOO\\\""
puts $f "CFLAGS+=\t-DDEFAULT_TARGET_VERSION=\\\"$version\\\""
puts $f "CFLAGS+=\t-DDEFAULT_TARGET_MACHINE=\\\"$target\\\""
puts $f "CFLAGS+=\t-DMD_EXEC_PREFIX=\\\"/usr/libexec/\\\""
puts $f "CFLAGS+=\t-DSTANDARD_STARTFILE_PREFIX=\\\"/usr/lib\\\""
puts $f "CFLAGS+=\t-DGCC_NAME=\\\"cc\\\""
puts $f ""
puts $f ".if exists(\${.CURDIR}/../cc_int/obj)"
puts $f "LIBDESTDIR=\t\${.CURDIR}/../cc_int/obj"
puts $f ".else"
puts $f "LIBDESTDIR=\t\${.CURDIR}/../cc_int"
puts $f ".endif"
puts $f ""
puts $f "# XXX LDDESTDIR isn't a directory and there is no standard name for the dir"
puts $f "LDDESTDIR=\t-L\${LIBDESTDIR}"
puts $f ".if defined(SHARED_LIBCC_INT)"
puts $f "LIBCC_INT=\t\${LIBDESTDIR}/libcc_int.so.262.0"
puts $f ".else"
puts $f "LIBCC_INT=\t\${LIBDESTDIR}/libcc_int.a"
puts $f ".endif"
close $f
set f [open $ddir/Makefile w]
puts $f "#\n# \$FreeBSD$\n#\n"
puts $f "PGMDIR=\tcc_int cpp cc1 cc cc1plus c++ f77 libgcc"
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]
puts $f "#\n# \$FreeBSD$\n#\n"
puts $f "LIB=\tgcc"
puts $f "INSTALL_PIC_ARCHIVE=\tyes"
puts $f "SHLIB_MAJOR=\t261"
puts $f "SHLIB_MINOR=\t0"
puts $f ""
puts $f "LIB1OBJS=\t[add_suffix $l_libgcc1 .o]"
puts $f "LIB2OBJS=\t[add_suffix $l_libgcc2 .o]"
puts $f {
OBJS= ${LIB1OBJS} ${LIB2OBJS}
LIB1SOBJS=${LIB1OBJS:.o=.so}
LIB2SOBJS=${LIB2OBJS:.o=.so}
P1OBJS=${LIB1OBJS:.o=.po}
P2OBJS=${LIB2OBJS:.o=.po}
${LIB1OBJS}: libgcc1.c
${CC} -c ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc1.c
@${LD} -x -r ${.TARGET}
@mv a.out ${.TARGET}
${LIB2OBJS}: libgcc2.c
${CC} -c ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc2.c
@${LD} -x -r ${.TARGET}
@mv a.out ${.TARGET}
.if !defined(NOPIC)
${LIB1SOBJS}: libgcc1.c
${CC} -c -fpic ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc1.c
${LIB2SOBJS}: libgcc2.c
${CC} -c -fpic ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc2.c
.endif
.if !defined(NOPROFILE)
${P1OBJS}: libgcc1.c
${CC} -c -p ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc1.c
${P2OBJS}: libgcc2.c
${CC} -c -p ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc2.c
.endif
.include <bsd.lib.mk>
}
close $f
copy_c $sdir $ddir/libgcc $l_libgcc
# do ~/include
sh "mkdir $ddir/include"
copy_l $sdir $ddir/include [add_suffix $l_include .h]
copy_l $sdir $ddir/include $l_include_x
copy_l $sdir $ddir/include [add_suffix $l_libgcc_h .h]
# do ~/include/i386
sh "mkdir $ddir/include/i386"
copy_l $sdir/config/i386 $ddir/include/i386 [add_suffix $l_include_i386 .h]
# do ~/cc_int
mk_lib $ddir cc_int [add_suffix $l_common .c] {
"NOPROFILE=\tyes"
".if defined(SHARED_LIBCC_INT)"
"INTERNALLIB="
"SHLIB_MAJOR=262"
"SHLIB_MINOR=0"
".else"
"\ninstall:\n\t@true"
".endif"
}
copy_c $sdir $ddir/cc_int $l_common
# do ~/cpp
mk_prog $ddir cpp [add_suffix $l_cpp .c] {
"BINDIR=\t/usr/libexec"
".PATH:\t\${.CURDIR}/../cc_int"
"SRCS+=\tobstack.c version.c"
}
copy_c $sdir $ddir/cpp $l_cpp
cp $sdir/cccp.1 $ddir/cpp/cpp.1
# do ~/c++
mk_prog $ddir c++ [add_suffix "$l_cplus $l_cplus_cp" .c] {
"BINDIR=\t/usr/bin"
"LINKS=\t\${BINDIR}/c++ \${BINDIR}/g++"
"NOMAN=\t1"
}
copy_c $sdir $ddir/c++ $l_cplus
copy_c $sdir/cp $ddir/c++ $l_cplus_cp
# do ~/cc
mk_prog $ddir cc [add_suffix $l_cc .c] {
"BINDIR=\t/usr/bin"
".PATH: \${.CURDIR}/../cc_int"
"SRCS+=\tobstack.c version.c"
"LINKS=\t\${BINDIR}/cc \${BINDIR}/gcc"
}
copy_c $sdir $ddir/cc $l_cc
cp $sdir/gcc.1 $ddir/cc/cc.1
# do ~/cc1
mk_prog $ddir cc1 [add_suffix $l_cc1 .c] {
"BINDIR=\t/usr/libexec"
"NOMAN=\t1"
"DPADD+=\t\${LIBCC_INT} \${LIBGNUMALLOC}"
"LDADD+=\t-lcc_int -lgnumalloc"
}
copy_c $sdir $ddir/cc1 $l_cc1
# do ~/cc1plus
mk_prog $ddir cc1plus [add_suffix "$l_cc1plus_cp $l_cc1plus" .c] {
"BINDIR=\t/usr/libexec"
"NOMAN=\t1"
"DPADD+=\t\${LIBCC_INT} \${LIBGNUMALLOC}"
"LDADD+=\t-lcc_int -lgnumalloc"
}
copy_l $sdir/cp $ddir/cc1plus $l_cc1plus_x
copy_c $sdir $ddir/cc1plus $l_cc1plus
copy_c $sdir/cp $ddir/cc1plus $l_cc1plus_cp
copy_l $sdir/cp $ddir/cc1plus [add_suffix $l_cc1plus_h .h]
exit 0

View File

@ -1,221 +0,0 @@
#!/usr/local/bin/tcl
#
# ----------------------------------------------------------------------------
# "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$
#
#######################################################################
# Generic procedures usable in the process of gnu-to-bmake jobs.
#
#######################################################################
# sh -- execute command.
# argv[1] shell command to execute.
#
proc sh {cmd} {
puts stdout "+ $cmd"
flush stdout
exec sh -e -c $cmd >&@ stdout
}
#######################################################################
# cp -- execute cp(1)
# argv arguments to cp(1)
#
proc cp {args} {
sh "cp $args"
}
#######################################################################
# copy_l -- Copy list of files, try to make(1) them if missing.
# argv[1] source directory
# argv[2] destination directory
# argv[3] list of filenames
#
proc copy_l {src dst files} {
foreach f $files {
if {![file exists $src/${f}]} {
sh "cd $src ; set +e ; make ${f}"
}
if {![file exists $src/${f}]} {
error "Couldn't produce ${f} in $src"
}
cp $src/${f} $dst
}
}
#######################################################################
# copy_c -- Copy list of .c files, try to make(1) them if missing.
# argv[1] source directory
# argv[2] destination directory
# argv[3] list of filenames, with or without .c suffixes.
#
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 ; exit 0"
}
if {![file exists $src/${f}.c]} {
sh "cd $src ; set +e ; make ${f}.o ; exit 0"
}
if {![file exists $src/${f}.c]} {
error "Couldn't produce ${f}.c in $src"
}
cp $src/${f}.c $dst
}
}
#######################################################################
# 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 {\.cc$|\.[cyolhsxS]$}}} {
set a ""
foreach i $lst {
regsub -all $suf $i {} i
lappend a $i
}
return $a
}
#######################################################################
# add_suffix -- add suffixes to list if filenames
# argv[1] list of filenames
# argv[2] string to add.
#
proc add_suffix {lst suf} {
set l ""
foreach i $lst {lappend l ${i}${suf}}
return $l
}
#######################################################################
# add_prefix -- add prefixes to list if filenames
# argv[1] list of filenames
# argv[2] string to add.
#
proc add_prefix {lst prf} {
set l ""
foreach i $lst {lappend l ${prf}${i}}
return $l
}
#######################################################################
# basename -- removes directory-prefixes from list of names.
# argv[1] list of filenames
#
proc basename {lst} {
set l ""
foreach i $lst {regsub {.*/} $i {} i ; lappend l $i}
return $l
}
#######################################################################
# makefile_macro -- return the contents of a Makefile macro
# argv[1] name of macro
# argv[2] source directory
# argv[3] (optional) name of makefile
#
proc makefile_macro {macro dir {makefile Makefile}} {
# Nobody will miss a core file, right ?
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 sh -e -c "cd $dir ; make -f make.core GNU2TCL_test"]
sh "rm -f $dir/make.core"
return $a
}
#######################################################################
# mk_prog -- Make a directory and Makefile for a program.
# argv[1] name of the parent-directory
# argv[2] name of the program
# argv[3] list of .c files (the SRCS macro content).
# argv[4] (optional) list of lines for the Makefile
#
proc mk_prog {ddir name list {make ""}} {
sh "mkdir $ddir/$name"
set f [open $ddir/$name/Makefile w]
puts $f "#\n# \$FreeBSD$\n#\n"
puts $f "PROG =\t$name"
puts $f "SRCS =\t[lsort $list]"
foreach i $make {puts $f $i}
puts $f "\n.include <bsd.prog.mk>"
close $f
}
#######################################################################
# mk_lib -- Make a directory and Makefile for a library
# argv[1] name of the parent-directory
# argv[2] name of the library
# argv[3] list of .c files (the SRCS macro content).
# argv[4] (optional) list of lines for the Makefile
#
proc mk_lib {ddir name list {make ""}} {
sh "mkdir $ddir/$name"
set f [open $ddir/$name/Makefile w]
puts $f "#\n# \$FreeBSD$\n#\n"
puts $f "SRCS =\t[lsort $list]"
puts $f "LIB =\t$name"
foreach i $make {puts $f $i}
puts $f "\n.include <bsd.lib.mk>"
close $f
}
#######################################################################
# common_set -- Return the files common to a list of lists.
# argv[] lists of filenames
#
proc common_set {args} {
set a(0) 0 ; unset a(0)
foreach i $args {
foreach j $i {if {[catch {incr a($j)} k]} {set a($j) 1}}
}
set j ""
foreach i [array names a] {
if {$a($i) > 1} {lappend j $i}
}
return $j
}
#######################################################################
# reduce_by -- Remove elements from list, if present in 2nd list.
# argv[1] lists of filenames
# argv[2] lists of filenames to be removed.
#
proc reduce_by {l1 l2} {
set a(0) 0 ; unset a(0)
foreach j $l1 { if {[catch {incr a($j)} k]} {set a($j) 1} }
foreach j $l2 { catch {unset a($j)} }
return [array names a]
}

View File

@ -1,26 +0,0 @@
This patch fixes two things:
config.guess:
i[34]86-*-FreeBSD* -> i386--bsd
libio/gen-params:
We use hex in limits.h
Poul-Henning Kamp
phk@login.dkuug.dk
diff -C2 -r libg++-2.6.orig/config.guess libg++-2.6/config.guess
*** libg++-2.6.orig/config.guess Sat Jul 16 12:11:08 1994
--- libg++-2.6/config.guess Sun Jul 31 20:45:59 1994
***************
*** 197,201 ****
exit 0 ;;
i[34]86:FreeBSD:*:*)
! echo ${UNAME_MACHINE}-unknown-freebsd${UNAME_RELEASE}
exit 0 ;;
i[34]86:NetBSD:*:*)
--- 197,201 ----
exit 0 ;;
i[34]86:FreeBSD:*:*)
! echo ${UNAME_MACHINE}-unknown-bsd
exit 0 ;;
i[34]86:NetBSD:*:*)

View File

@ -1,89 +0,0 @@
#!/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