Package: src:gnat-4.9 Followup-For: Bug #742590 At least three failures affect build/gcc/ada/rts-static-zcx. A 54 compiler segfault when optimization is asked. B 106 warnings (= errors with -gnatg), mostly about conversions between types with different sizes. C 46 errors caused by the same problem: s-osinte.ads:590:07: size for "Address" too small, minimum allowed is 64
Investigating the latter, I have found a bug in build/gcc/xgcc. Standard'Address_Size should match System.Address'Size but does not: # debian/rules binary-arch ... fails # cd build/gcc/ada/rts-static-zcx # cat > hello.ads <<EOF with System; package Hello is Standard_Address_Size : constant Integer := Standard'Address_Size; System_Address_Size : constant Integer := System.Address'Size; end Hello; EOF # ../../xgcc -B../.. -c -gnatpg -nostdinc hello.ads -gnatG | grep address_size hello__standard_address_size : constant integer := 32; hello__system_address_size : constant integer := 64; In case this helps others, I attach a diff listing which file is affected by each problem, and preventing the effects to abort the compilation.
--- old.in.mk 2014-03-29 11:18:53.576474900 +0100 +++ new.in.mk 2014-03-29 15:57:34.287388432 +0100 @@ -2738,23 +2738,20 @@ # 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-traceb.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). @@ -2763,30 +2760,27 @@ # 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 : 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. @@ -2794,6 +2788,56 @@ $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) \ $(INCLUDES) -fno-omit-frame-pointer $< $(OUTPUT_OPTION) +# If kept, all this should be restricted to powerpc or powerpc%. +# Avoid any optimization otherwise gnat1 crashes on powerpc. + +a-direct.o a-except.o a-finali.o a-stream.o a-strunb.o a-ststio.o \ +a-stwima.o a-stwiun.o a-stzmap.o a-stzunb.o a-synbar.o a-sytaco.o \ +a-tasatt.o a-taside.o a-taster.o a-textio.o a-witeio.o a-ztexio.o \ +g-awk.o g-catiio.o g-cgideb.o g-debpoo.o g-expect.o g-exptty.o \ +g-pehage.o g-semaph.o g-sercom.o g-signal.o g-socket.o g-spipat.o \ +g-sptabo.o g-sptain.o g-sptavs.o g-strspl.o g-thread.o g-wistsp.o \ +g-zstspl.o s-asthan.o s-chepoo.o s-direio.o s-ficobl.o s-fileio.o \ +s-finmas.o s-finroo.o s-parint.o s-pooglo.o s-pooloc.o s-poosiz.o \ +s-regexp.o s-rpc.o s-sequio.o s-shasto.o s-stopoo.o s-stposu.o \ + : ALL_ADAFLAGS += -O0 + +# Warnings are treated as errors because of -gnatg. +# Disable this behaviour on some files to inspect powerpc problems. + +a-interr.o a-intnam.o a-intsig.o a-reatim.o a-retide.o a-rttiev.o \ +a-tags.o g-allein.o g-debpoo.o g-dirope.o g-expect.o g-memdum.o \ +g-socket.o g-spipat.o i-cstrea.o i-cstrin.o i-pacdec.o s-auxdec.o \ +s-bitops.o s-boarop.o s-carsi8.o s-carun8.o s-casi16.o s-casi32.o \ +s-casi64.o s-caun16.o s-caun32.o s-caun64.o s-excmac.o s-fatflt.o \ +s-fatlfl.o s-fatllf.o s-fatsfl.o s-filofl.o s-fishfl.o s-imenne.o \ +s-imgenu.o s-os_lib.o s-osprim.o s-pack03.o s-pack05.o s-pack06.o \ +s-pack07.o s-pack09.o s-pack10.o s-pack11.o s-pack12.o s-pack13.o \ +s-pack14.o s-pack15.o s-pack17.o s-pack18.o s-pack19.o s-pack20.o \ +s-pack21.o s-pack22.o s-pack23.o s-pack24.o s-pack25.o s-pack26.o \ +s-pack27.o s-pack28.o s-pack29.o s-pack30.o s-pack31.o s-pack33.o \ +s-pack34.o s-pack35.o s-pack36.o s-pack37.o s-pack38.o s-pack39.o \ +s-pack40.o s-pack41.o s-pack42.o s-pack43.o s-pack44.o s-pack45.o \ +s-pack46.o s-pack47.o s-pack48.o s-pack49.o s-pack50.o s-pack51.o \ +s-pack52.o s-pack53.o s-pack54.o s-pack55.o s-pack56.o s-pack57.o \ +s-pack58.o s-pack59.o s-pack60.o s-pack61.o s-pack62.o s-pack63.o \ +s-pooloc.o s-poosiz.o s-rannum.o s-secsta.o s-stalib.o s-stoele.o \ +s-stposu.o s-valenu.o s-widenu.o s-wwdenu.o \ + : ALL_ADAFLAGS += -gnatwn + +# See Debian bug #742590 for details. + +a-dynpri.o a-exetim.o a-interr.o a-intnam.o a-intsig.o a-reatim.o \ +a-retide.o a-rttiev.o a-sytaco.o a-tasatt.o a-taside.o a-taster.o \ +g-semaph.o g-signal.o g-thread.o s-asthan.o s-inmaop.o s-interr.o \ +s-intman.o s-mudido.o s-osinte.o s-solita.o s-stusta.o s-taasde.o \ +s-tadeca.o s-tadert.o s-taenca.o s-taprob.o s-taprop.o s-tarest.o \ +s-tasdeb.o s-tasinf.o s-tasini.o s-taskin.o s-taspri.o s-tasque.o \ +s-tasren.o s-tasres.o s-tassta.o s-tasuti.o s-tataat.o s-tpinop.o \ +s-tpoben.o s-tpobop.o s-tposen.o s-tratas.o \ + : %.o : %.ads + -$(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION) + adadecode.o : adadecode.c adadecode.h aux-io.o : aux-io.c argv.o : argv.c