[LLVMdev] llvm-gcc fortran bootstrap broken

Duncan Sands baldrick at free.fr
Wed Jul 30 11:39:12 PDT 2008


On Wednesday 30 July 2008 18:13:27 Duncan Sands wrote:
> On x86-64 linux, in stage 2, I get:
> 
> c++   -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wmissing-format-attribute -fno-common   -DHAVE_CONFIG_H  -o f951 \
>                 fortran/arith.o fortran/array.o fortran/bbt.o fortran/check.o fortran/data.o fortran/decl.o fortran/dump-parse-tree.o fortran/error.o fortran/expr.o fortran/interface.o fortran/intrinsic.o fortran/io.o fortran/iresolve.o fortran/match.o fortran/matchexp.o fortran/misc.o fortran/module.o fortran/openmp.o fortran/options.o fortran/parse.o fortran/primary.o fortran/resolve.o fortran/scanner.o fortran/simplify.o fortran/st.o fortran/symbol.o fortran/convert.o fortran/dependency.o fortran/f95-lang.o fortran/trans.o fortran/trans-array.o fortran/trans-common.o fortran/trans-const.o fortran/trans-decl.o fortran/trans-expr.o fortran/trans-intrinsic.o fortran/trans-io.o fortran/trans-openmp.o fortran/trans-stmt.o fortran/trans-types.o llvm-main.o tree-browser.o libbackend.a ../libcpp/libcpp.a /home/duncan/LLVM/llvm-objects/Debug/lib/libLLVMBitReader.a /home/duncan/LLVM/llvm-objects/Debug/lib/libLLVMipo.a /home/duncan/LLVM/llvm-objects/Debug/lib/libLLVMBitWriter.a /hom!
>  e/duncan/LLVM/llvm-objects/Debug/lib/LLVMX86.o /home/duncan/LLVM/llvm-objects/Debug/lib/libLLVMSelectionDAG.a /home/duncan/LLVM/llvm-objects/Debug/lib/libLLVMCodeGen.a /home/duncan/LLVM/llvm-objects/Debug/lib/libLLVMScalarOpts.a /home/duncan/LLVM/llvm-objects/Debug/lib/libLLVMTransformUtils.a /home/duncan/LLVM/llvm-objects/Debug/lib/libLLVMipa.a /home/duncan/LLVM/llvm-objects/Debug/lib/libLLVMAnalysis.a /home/duncan/LLVM/llvm-objects/Debug/lib/libLLVMTarget.a /home/duncan/LLVM/llvm-objects/Debug/lib/libLLVMCore.a /home/duncan/LLVM/llvm-objects/Debug/lib/libLLVMSupport.a /home/duncan/LLVM/llvm-objects/Debug/lib/libLLVMSystem.a attribs.o stub-objc.o stub-c.o -lmpfr -lgmp ../libcpp/libcpp.a   ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -L/home/duncan/LLVM/llvm-objects/Debug/lib  -lpthread -ldl -lm
> libbackend.a(dwarf2out.o): In function `add_type_attribute':
> (.text+0x1ffb3): undefined reference to `invoke_impl_ptr_type'
> libbackend.a(llvm-backend.o): In function `createOptimizationPasses':
> /home/duncan/LLVM/gcc-4.2.llvm-objects/gcc/../../gcc-4.2.llvm/gcc/llvm-backend.cpp:384: undefined reference to `flag_no_builtin'

This one (with Ada):
libbackend.a(dwarf2out.o): In function `modified_type_die':
gcc/../../gcc-4.2.llvm/gcc/dwarf2out.c:8617: undefined reference to `c_language'

Seems to be due to placing C language specific stuff in a generic file.
Take a look (dwarf2out.c):


+/* APPLE LOCAL radar 5811943 - Fix type of pointers to Blocks  */
+/* APPLE LOCAL Radar 5741731, typedefs used in '@try' blocks    */
+#include "c-common.h"

^ Including a C language header!!!

...

+  /* APPLE LOCAL begin Radar 5741731, typedefs used in '@try' blocks    */
+  if (is_volatile_type
+      && c_dialect_objc ()
+      && lookup_attribute ("objc_volatilized", TYPE_ATTRIBUTES (type)))
+    {
+      is_volatile_type = 0;
+      if (TYPE_NAME (type) && TREE_TYPE (TYPE_NAME (type)))
+       type = TREE_TYPE (TYPE_NAME (type));
+    }
+  /* APPLE LOCAL end Radar 5741731, typedefs used in '@try' blocks    */

^ Using a C language method (c_dialect_objc)!!!

How about something like this instead (I have no idea if this works):

Index: gcc-4.2.llvm/gcc/dwarf2out.c
===================================================================
--- gcc-4.2.llvm.orig/gcc/dwarf2out.c	2008-07-30 20:37:22.000000000 +0200
+++ gcc-4.2.llvm/gcc/dwarf2out.c	2008-07-30 20:38:20.000000000 +0200
@@ -69,9 +69,6 @@
 #include "hashtab.h"
 #include "cgraph.h"
 #include "input.h"
-/* APPLE LOCAL radar 5811943 - Fix type of pointers to Blocks  */
-/* APPLE LOCAL Radar 5741731, typedefs used in '@try' blocks    */ 
-#include "c-common.h"
 
 #ifdef DWARF2_DEBUGGING_INFO
 static void dwarf2out_source_line (unsigned int, const char *);
@@ -4099,6 +4096,7 @@
 static inline dw_die_ref get_AT_ref (dw_die_ref, enum dwarf_attribute);
 static bool is_c_family (void);
 static bool is_cxx (void);
+static bool is_objc (void);
 static bool is_java (void);
 static bool is_fortran (void);
 static bool is_ada (void);
@@ -5493,6 +5491,16 @@
   return lang == DW_LANG_C_plus_plus || lang == DW_LANG_ObjC_plus_plus;
 }
 
+/* Return TRUE if the language is objc.  */
+
+static inline bool
+is_objc (void)
+{
+  unsigned int lang = get_AT_unsigned (comp_unit_die, DW_AT_language);
+
+  return lang == DW_LANG_ObjC;
+}
+
 /* Return TRUE if the language is Fortran.  */
 
 static inline bool
@@ -8615,7 +8623,7 @@
 
   /* APPLE LOCAL begin Radar 5741731, typedefs used in '@try' blocks    */ 
   if (is_volatile_type
-      && c_dialect_objc ()
+      && is_objc ()
       && lookup_attribute ("objc_volatilized", TYPE_ATTRIBUTES (type)))
     {
       is_volatile_type = 0;




More information about the llvm-dev mailing list