This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

build problems on FreeBSD 3.0 ELF systems



I have tried building both egcs-1.1.1.prerelease3 and the
egcs-19981122 snapshot on a FreeBSD 3.0 ELF system, using the
command "gmake bootstrap".  In both cases, the build failed
at the point where the stage2 and the stage3 objects are compared
(pretty much all the objects differ).
I also applied a set of patches (enclosed below) that the freebsd
port maintainer has put together before doing the build.  I was
wondering what other information people would need to track down this
problem, or if I am doing something wrong.  I used the following
command line when invoking configure:

./configure --with-gnu-as --with-gnu-ld  --host=i386-unknown-freebsdelf

Anyway, here are the patches.

-Alec


--- 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
--- 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)
--- gcc/config/i386/i386.c.orig Sat Sep  5 22:52:05 1998
+++ gcc/config/i386/i386.c      Wed Oct  7 17:06:48 1998
@@ -51,6 +51,11 @@
 #define CHECK_STACK_LIMIT -1
 #endif
 
+#define PIC_REG_USED                                   \
+  (flag_pic && (current_function_uses_pic_offset_table \
+               || current_function_uses_const_pool     \
+               || profile_flag || profile_block_flag))
+
 /* Type of an operand for ix86_{binary,unary}_operator_ok */
 enum reg_mem
 {
@@ -1938,13 +1943,11 @@
      char *name ATTRIBUTE_UNUSED;
 {
   rtx xops[2];
-  int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
-                                 || current_function_uses_const_pool);
   xops[0] = pic_offset_table_rtx;
   xops[1] = stack_pointer_rtx;
 
   /* Deep branch prediction favors having a return for every call. */
-  if (pic_reg_used && TARGET_DEEP_BRANCH_PREDICTION)
+  if (PIC_REG_USED && TARGET_DEEP_BRANCH_PREDICTION)
     {
       tree prologue_node;
 
@@ -2074,8 +2077,7 @@
   register int regno;
   int limit;
   rtx xops[4];
-  int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
-                                 || current_function_uses_const_pool);
+  int pic_reg_used = PIC_REG_USED;
   long tsize = get_frame_size ();
   rtx insn;
   int cfa_offset = INCOMING_FRAME_SP_OFFSET, cfa_store_offset = cfa_offset;
@@ -2245,8 +2247,6 @@
   int nregs = 0;
   int reglimit = (frame_pointer_needed
                  ? FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM);
-  int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
-                                 || current_function_uses_const_pool);
 
 #ifdef NON_SAVING_SETJMP
   if (NON_SAVING_SETJMP && current_function_calls_setjmp)
@@ -2258,7 +2258,7 @@
 
   for (regno = reglimit - 1; regno >= 0; regno--)
     if ((regs_ever_live[regno] && ! call_used_regs[regno])
-       || (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used))
+       || (regno == PIC_OFFSET_TABLE_REGNUM && PIC_REG_USED))
       nregs++;
 
   return nregs == 0 || ! frame_pointer_needed;
@@ -2292,8 +2292,7 @@
   register int nregs, limit;
   int offset;
   rtx xops[3];
-  int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
-                                 || current_function_uses_const_pool);
+  int pic_reg_used = PIC_REG_USED;
   long tsize = get_frame_size ();
 
   /* Compute the number of registers to pop */





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]