>Synopsis:      Fail to build lang/gcc/8 or lang/gcc/11 on loongson
>Category:      ports
>Environment:
        System      : OpenBSD 7.0
        Details     : OpenBSD 7.0 (GENERIC) #89: Sun Oct  3 10:09:54 MDT 2021
                         
[email protected]:/usr/src/sys/arch/loongson/compile/GENERIC

        Architecture: OpenBSD.loongson
        Machine     : loongson
>Description:

        GCC 8.4.0 and 11.2.0 from ports fails to build on Loongson
        system.  I've tested on 7.0-release, but as both ports has not
        been updated since it may also affect -current.  For both GCC
        versions, the base-clang fails to compile a usable
        bootstraping gcc
        (/usr/ports/pobj/gcc-8.4.0/build-mips64el/./gcc/xgcc) which
        ended up in ICE when trying to compile something.  For GCC 8,
        the configure check fails at this part:

        ,----
        | checking size of double... configure: error: in 
`/usr/ports/pobj/gcc-8.4.0/build-mips64el/mips64el-unknown-openbsd7.0/libgcc':
        | configure: error: cannot compute sizeof (double)
        | See `config.log' for more details.
        `----

        I've checked the config.log under the failing directory and
        tried to rerun the commands with "-v" and it turns out to be
        an ICE.  The full output looks like below:

        ,----
        | yeeloong# /usr/ports/pobj/gcc-8.4.0/build-mips64el/./gcc/xgcc -v 
-B/usr/ports/pobj/gcc-8.4.0/build-mips64el/./gcc/ 
-B/usr/local/mips64el-unknown-openbsd7.0/bin/ 
-B/usr/local/mips64el-unknown-openbsd7.0/lib/ -isystem 
/usr/local/mips64el-unknown-openbsd7.0/include -isystem 
/usr/local/mips64el-unknown-openbsd7.0/sys-include    -c -O2 -g  conftest.c
        | Reading specs from 
/usr/ports/pobj/gcc-8.4.0/build-mips64el/./gcc/specs
        | COLLECT_GCC=/usr/ports/pobj/gcc-8.4.0/build-mips64el/./gcc/xgcc
        | Target: mips64el-unknown-openbsd7.0
        | Configured with: /usr/ports/pobj/gcc-8.4.0/gcc-8.4.0/configure 
--verbose --program-transform-name='s,^,e,' --disable-nls --with-system-zlib 
--disable-libmudflap --disable-libgomp --disable-libssp --disable-tls 
--with-gnu-ld --with-gnu-as --enable-threads=posix --enable-wchar_t 
--with-gmp=/usr/local --enable-languages=c,c++,fortran,objc 
--disable-libstdcxx-pch --enable-default-ssp --enable-default-pie --without-isl 
--enable-cpp --prefix=/usr/local --sysconfdir=/etc --mandir=/usr/local/man 
--infodir=/usr/local/info --localstatedir=/var --disable-silent-rules 
--disable-gtk-doc
        | Thread model: posix
        | gcc version 8.4.0 (GCC)
        | COLLECT_GCC_OPTIONS='-v' '-B' 
'/usr/ports/pobj/gcc-8.4.0/build-mips64el/./gcc/' '-B' 
'/usr/local/mips64el-unknown-openbsd7.0/bin/' '-B' 
'/usr/local/mips64el-unknown-openbsd7.0/lib/' '-isystem' 
'/usr/local/mips64el-unknown-openbsd7.0/include' '-isystem' 
'/usr/local/mips64el-unknown-openbsd7.0/sys-include' '-c' '-O2' '-g'
        |  /usr/ports/pobj/gcc-8.4.0/build-mips64el/./gcc/cc1 -quiet -v 
-iprefix 
/usr/ports/pobj/gcc-8.4.0/build-mips64el/gcc/../lib/gcc/mips64el-unknown-openbsd7.0/8.4.0/
 -isystem /usr/ports/pobj/gcc-8.4.0/build-mips64el/./gcc/include -isystem 
/usr/ports/pobj/gcc-8.4.0/build-mips64el/./gcc/include-fixed -isystem 
/usr/local/mips64el-unknown-openbsd7.0/include -isystem 
/usr/local/mips64el-unknown-openbsd7.0/sys-include conftest.c -quiet -dumpbase 
conftest.c -auxbase conftest -g -O2 -version -o /tmp//ccNQSj3c.s
        | GNU C17 (GCC) version 8.4.0 (mips64el-unknown-openbsd7.0)
        |         compiled by GNU C version OpenBSD Clang 11.1.0, GMP version 
6.2.1, MPFR version 4.1.0, MPC version 1.1.0, isl version none
        | GGC heuristics: --param ggc-min-expand=30 --param 
ggc-min-heapsize=4096
        | ignoring nonexistent directory 
"/usr/local/mips64el-unknown-openbsd7.0/include"
        | ignoring nonexistent directory 
"/usr/local/mips64el-unknown-openbsd7.0/sys-include"
        | ignoring nonexistent directory 
"/usr/ports/pobj/gcc-8.4.0/build-mips64el/gcc/../lib/gcc/mips64el-unknown-openbsd7.0/8.4.0/include"
        | ignoring nonexistent directory 
"/usr/ports/pobj/gcc-8.4.0/build-mips64el/gcc/../lib/gcc/mips64el-unknown-openbsd7.0/8.4.0/include-fixed"
        | ignoring nonexistent directory 
"/usr/ports/pobj/gcc-8.4.0/build-mips64el/gcc/../lib/gcc/mips64el-unknown-openbsd7.0/8.4.0/../../../../mips64el-unknown-openbsd7.0/include"
        | ignoring nonexistent directory 
"/usr/ports/pobj/gcc-8.4.0/build-mips64el/gcc/../lib/gcc/../../lib/gcc/mips64el-unknown-openbsd7.0/8.4.0/include"
        | ignoring nonexistent directory 
"/usr/ports/pobj/gcc-8.4.0/build-mips64el/gcc/../lib/gcc/../../lib/gcc/mips64el-unknown-openbsd7.0/8.4.0/include-fixed"
        | ignoring nonexistent directory 
"/usr/ports/pobj/gcc-8.4.0/build-mips64el/gcc/../lib/gcc/../../lib/gcc/mips64el-unknown-openbsd7.0/8.4.0/../../../../mips64el-unknown-openbsd7.0/include"
        | #include "..." search starts here:
        | #include <...> search starts here:
        |  /usr/ports/pobj/gcc-8.4.0/build-mips64el/./gcc/include
        |  /usr/ports/pobj/gcc-8.4.0/build-mips64el/./gcc/include-fixed
        |  /usr/include
        | End of search list.
        | GNU C17 (GCC) version 8.4.0 (mips64el-unknown-openbsd7.0)
        |         compiled by GNU C version OpenBSD Clang 11.1.0, GMP version 
6.2.1, MPFR version 4.1.0, MPC version 1.1.0, isl version none
        | GGC heuristics: --param ggc-min-expand=30 --param 
ggc-min-heapsize=4096
        | Compiler executable checksum: 448862928c589cd7cbfeb4bad01c3537
        | during RTL pass: dse1
        | conftest.c: In function 'main':
        | conftest.c:18:1: internal compiler error: Segmentation fault
        |  }
        |  ^
        | no stack trace because unwind library not available
        | Please submit a full bug report,
        | with preprocessed source if appropriate.
        | See <https://gcc.gnu.org/bugs/> for instructions.
        `----

        For GCC 11, it fails at running testsuite/selftests.  The full
        commands and output with "-v" looks like below:

        ,----
        | yeeloong# /usr/ports/pobj/gcc-11.2.0/build-mips64el/./gcc/xgcc -v 
-B/usr/ports/pobj/gcc-11.2.0/build-mips64el/./gcc/ -xc -nostdinc /dev/null -S 
-o /dev/null 
-fself-test=/usr/ports/pobj/gcc-11.2.0/gcc-11.2.0/gcc/testsuite/selftests
        | Reading specs from 
/usr/ports/pobj/gcc-11.2.0/build-mips64el/./gcc/specs
        | COLLECT_GCC=/usr/ports/pobj/gcc-11.2.0/build-mips64el/./gcc/xgcc
        | Target: mips64el-unknown-openbsd7.0
        | Configured with: /usr/ports/pobj/gcc-11.2.0/gcc-11.2.0/configure 
--verbose --program-transform-name='s,^,e,' --disable-nls --with-system-zlib 
--disable-libmudflap --disable-libgomp --disable-libssp --disable-tls 
--with-gnu-ld --with-gnu-as --enable-threads=posix --enable-wchar_t 
--with-gmp=/usr/local --enable-languages=c,c++,fortran,objc 
--disable-libstdcxx-pch --enable-default-ssp --enable-default-pie --without-isl 
--enable-cpp --prefix=/usr/local --sysconfdir=/etc --mandir=/usr/local/man 
--infodir=/usr/local/info --localstatedir=/var --disable-silent-rules 
--disable-gtk-doc
        | Thread model: posix
        | Supported LTO compression algorithms: zlib
        | gcc version 11.2.0 (GCC)
        | COLLECT_GCC_OPTIONS='-v' '-B' 
'/usr/ports/pobj/gcc-11.2.0/build-mips64el/./gcc/' '-nostdinc' '-S' '-o' 
'/dev/null' 
'-fself-test=/usr/ports/pobj/gcc-11.2.0/gcc-11.2.0/gcc/testsuite/selftests' 
'-dumpdir' '/dev/'
        |  /usr/ports/pobj/gcc-11.2.0/build-mips64el/./gcc/cc1 -quiet -nostdinc 
-v -iprefix 
/usr/ports/pobj/gcc-11.2.0/build-mips64el/gcc/../lib/gcc/mips64el-unknown-openbsd7.0/11.2.0/
 -isystem /usr/ports/pobj/gcc-11.2.0/build-mips64el/./gcc/include -isystem 
/usr/ports/pobj/gcc-11.2.0/build-mips64el/./gcc/include-fixed /dev/null -quiet 
-dumpdir /dev/ -dumpbase null -version 
-fself-test=/usr/ports/pobj/gcc-11.2.0/gcc-11.2.0/gcc/testsuite/selftests -o 
/dev/null
        | GNU C17 (GCC) version 11.2.0 (mips64el-unknown-openbsd7.0)
        |         compiled by GNU C version OpenBSD Clang 11.1.0, GMP version 
6.2.1, MPFR version 4.1.0, MPC version 1.1.0, isl version none
        | GGC heuristics: --param ggc-min-expand=30 --param 
ggc-min-heapsize=4096
        | #include "..." search starts here:
        | #include <...> search starts here:
        |  /usr/ports/pobj/gcc-11.2.0/build-mips64el/./gcc/include
        |  /usr/ports/pobj/gcc-11.2.0/build-mips64el/./gcc/include-fixed
        | End of search list.
        | GNU C17 (GCC) version 11.2.0 (mips64el-unknown-openbsd7.0)
        |         compiled by GNU C version OpenBSD Clang 11.1.0, GMP version 
6.2.1, MPFR version 4.1.0, MPC version 1.1.0, isl version none
        | GGC heuristics: --param ggc-min-expand=30 --param 
ggc-min-heapsize=4096
        | Compiler executable checksum: acc39dedfd2be9366e8838b5eac22da2
        | In function 'test_fn':
        | cc1: internal compiler error: Bus error
        | no stack trace because unwind library not available
        | Please submit a full bug report,
        | with preprocessed source if appropriate.
        | See <https://gcc.gnu.org/bugs/> for instructions.
        `----

        (Note that the issue for GCC 8.4.0 has been reproducible since
        6.9-release.)

        I understand that Loongson is a niche platform and may not
        receive the same level of support as other more popular
        platforms.  I'd like to help debugging by providing anything
        useful and any guidance or suggestions are welcome.

>How-To-Repeat:
        Trying to build lang/gcc/{8,11}.
>Fix:
        Don't know.


dmesg:
OpenBSD 7.0 (GENERIC) #89: Sun Oct  3 10:09:54 MDT 2021
    [email protected]:/usr/src/sys/arch/loongson/compile/GENERIC
real mem = 1073741824 (1024MB)
avail mem = 1052000256 (1003MB)
random: boothowto does not indicate good seed
mainbus0 at root: Lemote Yeeloong
cpu0 at mainbus0: STC Loongson2F CPU 797 MHz, STC Loongson2F FPU
cpu0: cache L1-I 64KB D 64KB 4 way, L2 512KB 4 way
bonito0 at mainbus0: memory and PCI-X controller, rev 1
pci0 at bonito0 bus 0
rl0 at pci0 dev 7 function 0 "Realtek 8139" rev 0x10: irq 5, address 
00:23:8b:33:d4:7f
rlphy0 at rl0 phy 0: RTL internal PHY
smfb0 at pci0 dev 8 function 0 "Silicon Motion LynxEM+" rev 0xb0: 1024x600, 
16bpp
wsdisplay0 at smfb0 mux 1: console (std, vt100 emulation)
ohci0 at pci0 dev 9 function 0 "NEC USB" rev 0x44: irq 7, version 1.0
ehci0 at pci0 dev 9 function 1 "NEC USB" rev 0x05: irq 7
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "NEC EHCI root hub" rev 2.00/1.00 
addr 1
glxpcib0 at pci0 dev 14 function 0 "AMD CS5536 ISA" rev 0x03: rev 3, 32-bit 
3579545Hz timer, watchdog, gpio, i2c
isa0 at glxpcib0
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
wsmouse0 at pms0 mux 0
mcclock0 at isa0 port 0x70/2: mc146818 or compatible
ykbec0 at isa0 port 0x381/3
gpio1 at glxpcib0: 32 pins
iic at glxpcib0 not configured
glxclk0 at glxpcib0: clock, prof
pciide0 at pci0 dev 14 function 2 "AMD CS5536 IDE" rev 0x01: DMA, channel 0 
wired to compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 0: <FUJITSU MHZ2160BH G2>
wd0: 16-sector PIO, LBA48, 152627MB, 312581808 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2
pciide0: channel 1 ignored (disabled)
auglx0 at pci0 dev 14 function 3 "AMD CS5536 Audio" rev 0x01: isa irq 9, CS5536 
AC97
ac97: codec id 0x414c4760 (Avance Logic ALC655 rev 0)
audio0 at auglx0
ohci1 at pci0 dev 14 function 4 "AMD CS5536 USB" rev 0x02: isa irq 11, version 
1.0, legacy support
ehci1 at pci0 dev 14 function 5 "AMD CS5536 USB" rev 0x02: isa irq 11
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 configuration 1 interface 0 "AMD EHCI root hub" rev 2.00/1.00 
addr 1
usb2 at ohci0: USB revision 1.0
uhub2 at usb2 configuration 1 interface 0 "NEC OHCI root hub" rev 1.00/1.00 
addr 1
usb3 at ohci1: USB revision 1.0
uhub3 at usb3 configuration 1 interface 0 "AMD OHCI root hub" rev 1.00/1.00 
addr 1
apm0 at mainbus0
umass0 at uhub1 port 1 configuration 1 interface 0 "Generic USB2.0-CRW" rev 
2.00/58.87 addr 2
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets, initiator 0
sd0 at scsibus0 targ 1 lun 0: <Generic-, Multi-Card, 1.00> removable 
serial.0bda0158114173400000
urtw0 at uhub1 port 4 configuration 1 interface 0 "Realtek 
RTL8187B_WLAN_Adapter" rev 2.00/2.00 addr 3
urtw0: RTL8187B rev E, address 00:17:c4:4d:ea:21
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
pmon bootpath: bootduid=b0c7a9c3d196767f
root on wd0a (b0c7a9c3d196767f.a) swap on wd0b dump on wd0b

usbdevs:
Controller /dev/usb0:
addr 01: 1033:0000 NEC, EHCI root hub
         high speed, self powered, config 1, rev 1.00
         driver: uhub0
Controller /dev/usb1:
addr 01: 1022:0000 AMD, EHCI root hub
         high speed, self powered, config 1, rev 1.00
         driver: uhub1
addr 02: 0bda:0158 Generic, USB2.0-CRW
         high speed, power 500 mA, config 1, rev 58.87, iSerial 
20071114173400000
         driver: umass0
addr 03: 0bda:8189 Realtek, RTL8187B_WLAN_Adapter
         high speed, power 500 mA, config 1, rev 2.00, iSerial 00e04c000001
         driver: urtw0
Controller /dev/usb2:
addr 01: 1033:0000 NEC, OHCI root hub
         full speed, self powered, config 1, rev 1.00
         driver: uhub2
Controller /dev/usb3:
addr 01: 1022:0000 AMD, OHCI root hub
         full speed, self powered, config 1, rev 1.00
         driver: uhub3

Attachment: signature.asc
Description: PGP signature

Reply via email to