[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#742590: gnat-4.9: FTBFS on powerpc, Storage_Error in two source files



Package: src:gnat-4.9
Followup-For: Bug #742590
Control: retitle -1 FTBFS on powerpc, wrong System.Address'Size
Control: tags -1 + pending

Revision b1ec15211bb78fd840cc96b500d13e5f1531f9b8 fixes this issue.

In order to help next newcomer to modify flags for specific sources,
please consider applying or forwarding the attached diff.
Two points deserve review:
* debian/ada-symbolic-tracebacks.diff adds this line:
  +convert_addresses.o : convert_addresses.c
  I believe this is redundant and can safely be removed.
* the recipe for tracebak.o inserts -fno-omit-frame-pointer after
  INCLUDES, and my diff inserts it after ALL_COMPILERFLAGS.
  I believe that flags ordering does not matter here.
--- a/src/gcc/ada/gcc-interface/Makefile.in	2014-03-29 22:52:13.090202118 +0100
+++ b/src/gcc/ada/gcc-interface/Makefile.in	2014-03-30 00:14:48.402774180 +0100
@@ -290,21 +290,26 @@
 # Avoid a lot of time thinking about remaking Makefile.in and *.def.
 .SUFFIXES: .in .def
 
-# Say how to compile Ada programs.
-.SUFFIXES: .ada .adb .ads .asm
-
+# Generic compilation recipes.
+# Flags or prerequisites for specific sources are added later.
 # Always use -I$(srcdir)/config when compiling.
-.asm.o:
+
+# How to build assembly sources.
+%.o: %.asm
 	$(CC) -c -x assembler $< $(OUTPUT_OPTION)
 
-.c.o:
+# How to build C sources. The header, if any, is a prerequisite.
+%.o: %.c %.h
+	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) \
+	  $(INCLUDES) $< $(OUTPUT_OPTION)
+%.o: %.c
 	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) \
 	  $(INCLUDES) $< $(OUTPUT_OPTION)
 
-.adb.o:
+# How to build Ada sources. The body, if any, is a prerequisite.
+%.o: %.adb %.ads
 	$(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
-
-.ads.o:
+%.o: %.ads
 	$(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
 
 # how to regenerate this file
@@ -2736,111 +2741,55 @@
 # force no sibling call optimization on s-traceb.o so the number of stack
 # frames to be skipped when computing a call chain is not modified by
 # optimization.
-
-s-traceb.o  : s-traceb.adb s-traceb.ads
-	$(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) \
-	      $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
+s-straceb.o: ALL_ADAFLAGS += $(FORCE_DEBUG_ADAFLAGS) $(NO_SIBLING_ADAFLAGS)
 
 # force debugging information on s-tasdeb.o so that it is always
 # possible to set conditional breakpoints on tasks.
-
-s-tasdeb.o  : s-tasdeb.adb s-tasdeb.ads
-	$(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
-	      $< $(OUTPUT_OPTION)
+s-tasdeb.o: ALL_ADAFLAGS += $(FORCE_DEBUG_ADAFLAGS) -O0
 
 # force debugging information on s-vaflop.o so that it is always
 # possible to call the VAX float debug print routines.
 # force at least -O so that the inline assembly works.
-
-s-vaflop.o  : s-vaflop.adb s-vaflop.ads
-	$(CC) -c -O $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \
-	      $< $(OUTPUT_OPTION)
+s-vaflop.o: ALL_ADAFLAGS += $(FORCE_DEBUG_ADAFLAGS)
 
 # force no function reordering on a-except.o because of the exclusion bounds
 # mechanism (see the source file for more detailed information).
 # force debugging information on a-except.o so that it is always
 # possible to set conditional breakpoints on exceptions.
 # use -O1 otherwise gdb isn't able to get a full backtrace on mips targets.
-
-a-except.o  : a-except.adb a-except.ads
-	$(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \
-	      $(NO_REORDER_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
+a-except.o: ALL_ADAFLAGS += $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \
+                            $(NO_REORDER_ADAFLAGS)
 
 # compile s-excdeb.o without optimization and with debug info to let the
 # debugger set breakpoints and inspect subprogram parameters on exception
 # related events.
-
-s-excdeb.o  : s-excdeb.adb s-excdeb.ads s-except.ads
-	$(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
-	      $< $(OUTPUT_OPTION)
+s-excdeb.o: s-except.ads
+s-excdeb.o: ALL_ADAFLAGS += $(FORCE_DEBUG_ADAFLAGS) -O0
 
 # force debugging information on s-assert.o so that it is always
 # possible to set breakpoint on assert failures.
-
-s-assert.o  : s-assert.adb s-assert.ads
-	$(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \
-	      $< $(OUTPUT_OPTION)
+s-assert.o: ALL_ADAFLAGS += $(FORCE_DEBUG_ADAFLAGS)
 
 # force debugging information on a-tags.o so that the debugger can find
 # the description of Ada.Tags.Type_Specific_Data.
-
-a-tags.o  : a-tags.adb a-tags.ads
-	$(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \
-	      $< $(OUTPUT_OPTION)
+a-tags.o: ALL_ADAFLAGS += $(FORCE_DEBUG_ADAFLAGS)
 
 # need to keep the frame pointer in this file to pop the stack properly on
 # some targets.
-tracebak.o  : tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c
-	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) \
-	      $(INCLUDES) -fno-omit-frame-pointer $< $(OUTPUT_OPTION)
+tracebak.o: tb-alvms.c tb-alvxw.c tb-gcc.c
+tracebak.o: ALL_COMPILERFLAGS += -fno-omit-frame-pointer
 
-adadecode.o : adadecode.c adadecode.h
-aux-io.o  : aux-io.c
-argv.o    : argv.c
-cal.o     : cal.c
-deftarg.o : deftarg.c
-errno.o   : errno.c
-exit.o    : adaint.h exit.c
-expect.o  : expect.c
-final.o   : final.c
-locales.o : locales.c
-mkdir.o   : mkdir.c
-socket.o  : socket.c gsocket.h
-sysdep.o  : sysdep.c
-raise.o   : raise.c raise.h
-convert_addresses.o : convert_addresses.c
-sigtramp-armvxw.o : sigtramp-armvxw.c sigtramp.h
-sigtramp-ppcvxw.o : sigtramp-ppcvxw.c sigtramp.h
-terminals.o : terminals.c
-vx_stack_info.o : vx_stack_info.c
-
-raise-gcc.o : raise-gcc.c raise.h
-	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
-		-iquote $(srcdir) -iquote $(ftop_srcdir)/libgcc \
-		$(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
-
-cio.o     : cio.c
-	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
-	         $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
-
-init.o    : init.c adaint.h raise.h
-	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
-	         $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
-
-initialize.o : initialize.c raise.h
-	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
-	         $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
-
-link.o : link.c
-	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
-		$(ALL_CPPFLAGS) $(INCLUDES_FOR_SUBDIR) \
-		$< $(OUTPUT_OPTION)
-
-targext.o : targext.c
-	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
-		-iquote $(srcdir) \
-		$(ALL_CPPFLAGS) $(INCLUDES_FOR_SUBDIR) \
-		$< $(OUTPUT_OPTION)
+exit.o: adaint.h
+socket.o: gsocket.h
+sigtramp-armvxw.o: sigtramp.h
+sigtramp-ppcvxw.o: sigtramp.h
+raise-gcc.o: raise.h
+raise-gcc.o: ALL_CPPFLAGS += -iquote $(srcdir) -iquote $(ftop_srcdir)/libgcc
+init.o: adaint.h raise.h
+initialize.o: raise.h
+link.o: INCLUDES = $(INCLUDES_FOR_SUBDIR)
+targext.o: ALL_CPPFLAGS += -iquote $(srcdir)
+targext.o: INCLUDES = $(INCLUDES_FOR_SUBDIR)
 
 # In GNU Make, ignore whether `stage*' exists.
 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap

Reply to: