Make profiling work.

This commit is contained in:
John Polstra 1998-10-08 21:33:02 +00:00
parent f0f64ab3a3
commit 71e64d35d1
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=13754
60 changed files with 2640 additions and 80 deletions

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

51
lang/egcs/files/patch-af Normal file
View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

54
lang/egcs/files/patch-ai Normal file
View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

51
lang/gcc/files/patch-af Normal file
View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

54
lang/gcc/files/patch-ai Normal file
View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

51
lang/gcc30/files/patch-af Normal file
View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

54
lang/gcc30/files/patch-ai Normal file
View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

51
lang/gcc31/files/patch-af Normal file
View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

54
lang/gcc31/files/patch-ai Normal file
View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

51
lang/gcc32/files/patch-af Normal file
View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

54
lang/gcc32/files/patch-ai Normal file
View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

51
lang/gcc33/files/patch-af Normal file
View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

54
lang/gcc33/files/patch-ai Normal file
View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

51
lang/gcc34/files/patch-af Normal file
View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

54
lang/gcc34/files/patch-ai Normal file
View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

51
lang/gcc35/files/patch-af Normal file
View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

54
lang/gcc35/files/patch-ai Normal file
View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

51
lang/gcc40/files/patch-af Normal file
View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

54
lang/gcc40/files/patch-ai Normal file
View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

51
lang/gcc41/files/patch-af Normal file
View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

54
lang/gcc41/files/patch-ai Normal file
View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

51
lang/gcc42/files/patch-af Normal file
View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

54
lang/gcc42/files/patch-ai Normal file
View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

51
lang/gcc43/files/patch-af Normal file
View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

54
lang/gcc43/files/patch-ai Normal file
View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

51
lang/gcc44/files/patch-af Normal file
View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

54
lang/gcc44/files/patch-ai Normal file
View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

51
lang/gcc45/files/patch-af Normal file
View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

54
lang/gcc45/files/patch-ai Normal file
View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

51
lang/gcc46/files/patch-af Normal file
View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

54
lang/gcc46/files/patch-ai Normal file
View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

51
lang/gcc47/files/patch-af Normal file
View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

54
lang/gcc47/files/patch-ai Normal file
View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)

View file

@ -1,6 +1,29 @@
--- gcc/config/i386/freebsd.h.orig Tue Jun 30 15:52:18 1998
+++ gcc/config/i386/freebsd.h Sun Jul 19 14:35:14 1998
@@ -129,6 +129,7 @@
+++ gcc/config/i386/freebsd.h Wed Oct 7 17:06:41 1998
@@ -99,19 +99,18 @@
/* Profiling routines, partially copied from i386/osfrose.h. */
-/* Redefine this to use %eax instead of %edx. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
+
#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"); \
} \
}
@@ -129,6 +128,7 @@
#define TYPE_ASM_OP ".type"
#define SIZE_ASM_OP ".size"
@ -8,7 +31,7 @@
/* The following macro defines the format used to output the second
operand of the .type assembler directive. Different svr4 assemblers
@@ -138,6 +139,12 @@
@@ -138,6 +138,12 @@
#define TYPE_OPERAND_FMT "@%s"
@ -21,7 +44,7 @@
/* Write the extra assembler code needed to declare a function's result.
Most svr4 assemblers don't require any special declaration of the
result value, but there are exceptions. */
@@ -239,6 +246,8 @@
@@ -239,6 +245,8 @@
#define STARTFILE_SPEC \
"%{shared:c++rt0.o%s} \
%{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}"

51
lang/gcc48/files/patch-af Normal file
View file

@ -0,0 +1,51 @@
--- gcc/config/i386/freebsd-elf.h.orig Mon Jul 13 15:38:36 1998
+++ gcc/config/i386/freebsd-elf.h Wed Oct 7 22:18:02 1998
@@ -108,22 +108,19 @@
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
: (-1))
-/* Output assembler code to FILE to increment profiler label # LABELNO
- for profiling a function entry. */
+/* Tell final.c that we don't need a label passed to mcount. */
+#define NO_PROFILE_DATA
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
if (flag_pic) \
{ \
- fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
- LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
+ fprintf (FILE, "\tcall *.mcount@GOT(%%ebx)\n"); \
} \
else \
{ \
- fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
- fprintf (FILE, "\tcall mcount\n"); \
+ fprintf (FILE, "\tcall .mcount\n"); \
} \
}
@@ -146,20 +143,8 @@
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
#undef LIB_SPEC
-#if 1
-/* We no longer link with libc_p.a or libg.a by default. If you
- * want to profile or debug the C library, please add
- * -lc_p or -ggdb to LDFLAGS at the link time, respectively.
- */
#define LIB_SPEC \
- "%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
- %{!ggdb:-lc} %{ggdb:-lg}}"
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
+ "%{!shared: %{p:-lc_p} %{pg:-lc_p} %{!p:%{!pg:-lc}}}"
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to

54
lang/gcc48/files/patch-ai Normal file
View file

@ -0,0 +1,54 @@
--- gcc/final.c.orig Sat Sep 5 22:52:01 1998
+++ gcc/final.c Wed Oct 7 17:06:58 1998
@@ -383,6 +383,8 @@
/* zero word */
assemble_integer (const0_rtx, long_bytes, 1);
+ fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n");
+
/* address of filename */
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 1);
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, 1);
@@ -1635,6 +1637,9 @@
leaf_renumber_regs (first);
#endif
+ if (profile_block_flag)
+ add_bb (file);
+
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
@@ -1696,7 +1701,9 @@
profile_function (file)
FILE *file;
{
+#ifndef NO_PROFILE_DATA
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
+#endif /* not NO_PROFILE_DATA */
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct;
@@ -1706,10 +1713,12 @@
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
+#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, LONG_TYPE_SIZE / BITS_PER_UNIT, 1);
+#endif /* not NO_PROFILE_DATA */
function_section (current_function_decl);
@@ -1800,6 +1809,9 @@
code to restore the stack frame and return to the caller. */
FUNCTION_EPILOGUE (file, get_frame_size ());
#endif
+
+ if (profile_block_flag)
+ add_bb (file);
#ifdef SDB_DEBUGGING_INFO
if (write_symbols == SDB_DEBUG)