GCC 8 Ada bootstrap failure on mingw-w64

2018-06-02 Thread Liu Hao

Dear developers,

(This issue is originally reported at 
<https://github.com/Alexpux/MINGW-packages/pull/3877#issuecomment-393931161>.)


On mingw-w64, bootstrapping GCC 8 with Ada enabled results in the 
following error after stage 3:


```
GNATLINK 8.1.1 20180602
Copyright (C) 1995-2018, Free Software Foundation, Inc.
xgcc -c -gnatA -gnatWb -gnatiw -B../../ -I- -I../rts -I. 
-I/e/GitHub/MINGW-packages/mingw-w64-gcc-git/src/gcc/gcc/ada -gnatws 
E:\GitHub\MINGW-packages\mingw-w64

-gcc-git\src\build-x86_64-w64-mingw32\gcc\ada\tools\b~gnatdll.adb
checking for fptrap.h... 
E:/GitHub/MINGW-packages/mingw-w64-gcc-git/src/build-x86_64-w64-mingw32/gcc/xg++.exe 
b~gnatdll.o ../link.o ../targext.o ../../ggc-none.
o ../rts\ada.o ../rts\a-charac.o ../rts\a-chlat1.o ../rts\gnat.o 
../rts\interfac.o ../rts\system.o ../rts\s-addope.o ../rts\s-atocou.o 
../rts\s-casuti.o ../rts\
s-imgboo.o ../rts\s-imgint.o ../rts\s-io.o ../rts\s-parame.o 
../rts\s-crtl.o ../rts\i-cstrea.o ../rts\s-stoele.o ../rts\s-stache.o 
../rts\s-strhas.o ../rts\s-ht
able.o ../rts\g-htable.o ../rts\s-string.o ../rts\g-string.o 
../rts\s-traent.o ../rts\s-unstyp.o ../rts\s-imguns.o ../rts\s-wchcon.o 
../rts\s-wchjis.o ../rts\s-
wchcnv.o ../rts\s-carun8.o ../rts\s-conca2.o ../rts\s-traceb.o 
../rts\a-exctra.o ../rts\s-exctab.o ../rts\a-ioexce.o ../rts\a-string.o 
../rts\a-contai.o ../rts\
s-except.o ../rts\s-soliin.o ../rts\s-soflin.o ../rts\s-secsta.o 
../rts\s-excdeb.o ../rts\s-exctra.o ../rts\s-memory.o ../rts\s-wchstw.o 
../rts\s-valuti.o ../rt
s\s-valllu.o ../rts\s-vallli.o ../rts\s-win32.o ../rts\s-mmosin.o 
../rts\s-mmap.o ../rts\s-os_lib.o ../rts\s-bitops.o ../rts\a-stmaco.o 
../rts\a-chahan.o ../rts
\s-excmac.o ../rts\a-elchha.o ../rts\s-addima.o ../rts\s-boustr.o 
../rts\s-stalib.o ../rts\s-dwalin.o ../rts\i-c.o ../rts\a-strmap.o 
../rts\s-trasym.o ../rts\a-
except.o ../rts\s-objrea.o ../rts\a-comlin.o ../rts\a-strsea.o 
../rts\a-strfix.o ../rts\a-tags.o ../rts\a-stream.o ../rts\g-os_lib.o 
../rts\s-ficobl.o ../rts\s-
finroo.o ../rts\a-finali.o ../rts\s-fileio.o ../rts\s-stopoo.o 
../rts\s-finmas.o ../rts\s-stposu.o ../rts\s-spsufi.o ../rts\s-stratt.o 
../rts\a-strunb.o ../rts\
s-valuns.o ../rts\s-valint.o ../rts\a-textio.o ../rts\g-dirope.o 
../rts\s-assert.o ../rts\s-pooglo.o ../rts\s-regexp.o ../rts\g-regexp.o 
../rts\g-comlin.o .\deb
ug.o .\types.o .\alloc.o .\gnatvsn.o .\hostparm.o .\output.o .\rident.o 
.\tree_io.o .\opt.o .\csets.o .\table.o .\widechar.o .\namet.o .\fmap.o 
.\targparm.o .\o
sint.o .\sdefault.o .\mdll-fil.o .\mdll-utl.o .\mdll.o .\switch.o 
.\gnatdll.o ../../libcommon-target.a ../../libcommon.a 
../../../libcpp/libcpp.a ../rts/libgnat
.a C:/MinGW/MSYS2/mingw64/lib/libiconv.a 
../../../libbacktrace/.libs/libbacktrace.a 
../../../libiberty/libiberty.a -no-pie -o ../../gnatdll.exe -L../rts\ -L.\ -
LE:/GitHub/MINGW-packages/mingw-w64-gcc-git/src/gcc/gcc/ada\ 
-L/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.1/adalib/ 
E:\GitHub\MINGW-packages\mingw-w64-gcc-git\src\
build-x86_64-w64-mingw32\gcc\ada\rts\libgnat.a -Wl,--stack=0x200 
-B/e/GitHub/MINGW-packages/mingw-w64-gcc-git/src/build-x86_64-w64-mingw32/./gcc/ 
-nostdinc+
+ -nostdinc++ 
-I/e/GitHub/MINGW-packages/mingw-w64-gcc-git/src/build-x86_64-w64-mingw32/x86_64-w64-mingw32/libstdc++-v3/include/x86_64-w64-mingw32 
-I/e/GitHub/M
INGW-packages/mingw-w64-gcc-git/src/build-x86_64-w64-mingw32/x86_64-w64-mingw32/libstdc++-v3/include 
-I/e/GitHub/MINGW-packages/mingw-w64-gcc-git/src/gcc/libstd
c++-v3/libsupc++ 
-I/e/GitHub/MINGW-packages/mingw-w64-gcc-git/src/gcc/libstdc++-v3/include/backward 
-I/e/GitHub/MINGW-packages/mingw-w64-gcc-git/src/gcc/libstdc
++-v3/testsuite/util 
-L/e/GitHub/MINGW-packages/mingw-w64-gcc-git/src/build-x86_64-w64-mingw32/x86_64-w64-mingw32/libstdc++-v3/src 
-L/e/GitHub/MINGW-packages/mi
ngw-w64-gcc-git/src/build-x86_64-w64-mingw32/x86_64-w64-mingw32/libstdc++-v3/src/.libs 
-L/e/GitHub/MINGW-packages/mingw-w64-gcc-git/src/build-x86_64-w64-mingw32
/x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs 
-B/e/GitHub/MINGW-packages/mingw-w64-gcc-git/src/build-x86_64-w64-mingw32/x86_64-w64-mingw32/libstdc++-v3/src/.
libs 
-B/e/GitHub/MINGW-packages/mingw-w64-gcc-git/src/build-x86_64-w64-mingw32/x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs 
-L/mingw64/x86_64-w64-mingw32/lib
 -L/mingw64/lib -isystem /mingw64/x86_64-w64-mingw32/include -isystem 
/mingw64/include -B/mingw64/x86_64-w64-mingw32/bin/ 
-B/mingw64/x86_64-w64-mingw32/lib/ -is
ystem /mingw64/x86_64-w64-mingw32/include -isystem 
/mingw64/x86_64-w64-mingw32/sys-include -static-libstdc++ -static-libgcc 
-static-libstdc++ -static-libgcc
xg++.exe: fatal error: -fuse-linker-plugin, but liblto_plugin-0.dll not 
found

compilation terminated.
gnatlink: error when calling 
E:/GitHub/MINGW-packages/mingw-w64-gcc-git/src/build-x86_64-w64-mingw32/gcc/xg++.exe

make[3]: *** [../gcc-interface/Makefile:2238: ../../gnatdll.exe] Error 4
make[3]: *** Waiting for unfinished jobs
```

It was configure

Re: GCC 8 Ada bootstrap failure on mingw-w64

2018-06-02 Thread Eric Botcazou
> Any ideas about how to resolve this?

Compare with a known working version (e.g. GCC 7) and find the discrepancy.

-- 
Eric Botcazou


Solaris issues

2018-06-02 Thread Paul Floyd
Hi

I’ve been having 2 issues with GCC head on Solaris. Firstly. The build is 
currently broken

gmake[3]: Leaving directory `/export/home/paulf/scratch/gcc/build'
Comparing stages 2 and 3
warning: gcc/cc1obj-checksum.o differs
Bootstrap comparison failure!
i386-pc-solaris2.11/amd64/libgcc/avx_resms64_s.o differs
i386-pc-solaris2.11/amd64/libgcc/sse_resms64_s.o differs
i386-pc-solaris2.11/amd64/libgcc/sse_resms64.o differs
[more snipped]

Is there any workaround for this

Secondly I’ve been doing some work on adding support for C++14 and C++17 
sized/aligned new and delete operators.

Currently Valgrind can’t cope with the .rodata sections that get generated (see 
bugzilla https://bugs.kde.org/show_bug.cgi?id=390871 
)

Here’s an extract from the report

--18142-- WARNING: Serious error when reading debug info
--18142-- When reading debug info from 
/export/home/paulf/tools/gcc/lib/libstdc++.so.6.0.25:
--18142-- Can't make sense of .rodata section mapping

The cause appears to be hundreds of Elf32_Shdr (also Elf64_Shdr) with names 
.rodata and/or .rodata..  Sample:
 Section Headers:
  [Nr] Name  TypeAddr OffSize   ES Flg Lk Inf Al
  [15] .rodata._ZNKSt10l PROGBITS00093a88 093a88 10 01 AMS  0   0  1
  [16] .rodata._ZNKSt12_ PROGBITS00093a98 093a98 08 01 AMS  0   0  1
  [17] .rodata._ZNKSt12_ PROGBITS00093aa0 093aa0 07 01 AMS  0   0  1
  [18] .rodata   PROGBITS00093ac0 093ac0 003504 00   A  0   0 32
  [19] .rodata._ZTSNSt12 PROGBITS00096fe0 096fe0 2c 00   A  0   0 32
  [20] .rodata._ZTSNSt12 PROGBITS00097020 097020 2b 00   A  0   0 32
  [21] .rodata._ZNSt6chr PROGBITS0009704b 09704b 01 00   A  0   0  1
  [22] .rodata._ZNSt6chr PROGBITS0009704c 09704c 01 00   A  0   0  1
  [23] .rodata._ZNKSt9ba PROGBITS0009704d 09704d 0f 01 AMS  0   0  1
  [24] .rodata._ZNKSt16b PROGBITS0009705c 09705c 16 01 AMS  0   0  1
  [25] .rodata._ZNKSt20b PROGBITS00097072 097072 1a 01 AMS  0   0  1
  [26] .rodata._ZNKSt8ba PROGBITS0009708c 09708c 0e 01 AMS  0   0  1
  [27] .rodata._ZNKSt10b PROGBITS0009709a 09709a 10 01 AMS  0   0  1
  [28] .rodata   PROGBITS000970ac 0970ac 0002b4 01 AMS  0   0  4
  [29] .rodata._ZNKSt9ex PROGBITS00097360 097360 0f 01 AMS  0   0  1
and there are 639 more .rodata* Sections in that one file.

Inspection shows that the .rodata* are adjacent after considering alignment.  
Therefore a workaround might be for the debuginfo reader to aggregate them all 
into a single internal .rodata section.  A simple proposed patch is:
https://bugsfiles.kde.org/attachment.cgi?id=110638 

The above patch does fix the problem.
Any idea why so many sections are getting generated? (The test case is 
trivially small)

A+
Paul