NetBSD Problem Report #56679

From www@netbsd.org  Tue Feb  1 02:20:21 2022
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 44C631A9239
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  1 Feb 2022 02:20:21 +0000 (UTC)
Message-Id: <20220201022020.15A8A1A923D@mollari.NetBSD.org>
Date: Tue,  1 Feb 2022 02:20:20 +0000 (UTC)
From: david@gutteridge.ca
Reply-To: david@gutteridge.ca
To: gnats-bugs@NetBSD.org
Subject: gcc6/gcc8/gcc9/gcc10 fail to build for NetBSD 32-bit ARM targets
X-Send-Pr-Version: www-1.0

>Number:         56679
>Category:       pkg
>Synopsis:       gcc6/gcc8/gcc9/gcc10 fail to build for NetBSD 32-bit ARM targets
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 01 02:25:00 +0000 2022
>Closed-Date:    
>Last-Modified:  Sun May 15 05:05:01 +0000 2022
>Originator:     David H. Gutteridge
>Release:        -current and 2021Q4
>Organization:
TNF
>Environment:
>Description:
I don't know if this is better split out into different PRs, but most
current GCC versions fail to build for 32-bit ARM targets in TNF pkgsrc
bulk builds. This means some packages that in turn require GCC >7 on
NetBSD 9.x can't build.

Failures seem consistent between evbarm6 and evbarm7.

GCC 8

/pbulk/work/lang/gcc8/work/build/./gcc/libgcc_s.so.1: version GCC_3.4 required by /usr/lib/libbfd.so.16 not defined
gmake[4]: *** [Makefile:1165: install-leaf] Error 1

GCC 9

c++ -std=gnu++98 -no-pie   -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -o xg++ \
  gcc.o gcc-main.o ggc-none.o cp/g++spec.o  libcommon-target.a \
   libcommon.a ../libcpp/libcpp.a ./../intl/libintl.a  ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a 
ld: gcc.o:(.rodata+0x39d8): undefined reference to `host_detect_local_cpu(int, char const**)'
ld: gcc.o:(.rodata+0x39d8): undefined reference to `host_detect_local_cpu(int, char const**)'
gmake[3]: *** [../../gcc-9.3.0/gcc/cp/Make-lang.in:59: xg++] Error 1
gmake[3]: *** Waiting for unfinished jobs....
ld: gcc.o:(.rodata+0x39d8): undefined reference to `host_detect_local_cpu(int, char const**)'
gmake[3]: *** [Makefile:2030: cpp] Error 1

GCC 10

libtool: compile:  /pbulk/work/lang/gcc10/work/build/./gcc/xgcc -shared-libgcc -B/pbulk/work/lang/gcc10/work/build/./gcc -nostdinc++ -L/pbulk/work/lang/gcc10/work/build/armv6--netbsdelf-eabihf/libstdc++-v3/src -L/pbulk/work/lang/gcc10/work/build/armv6--netbsdelf-eabihf/libstdc++-v3/src/.libs -L/pbulk/work/lang/gcc10/work/build/armv6--netbsdelf-eabihf/libstdc++-v3/libsupc++/.libs -B/usr/pkg/gcc10/armv6--netbsdelf-eabihf/bin/ -B/usr/pkg/gcc10/armv6--netbsdelf-eabihf/lib/ -isystem /usr/pkg/gcc10/armv6--netbsdelf-eabihf/include -isystem /usr/pkg/gcc10/armv6--netbsdelf-eabihf/sys-include -fno-checking -I/pbulk/work/lang/gcc10/work/gcc-10.3.0/libstdc++-v3/../libgcc -I/pbulk/work/lang/gcc10/work/build/armv6--netbsdelf-eabihf/libstdc++-v3/include/armv6--netbsdelf-eabihf -I/pbulk/work/lang/gcc10/work/build/armv6--netbsdelf-eabihf/libstdc++-v3/include -I/pbulk/work/lang/gcc10/work/gcc-10.3.0/libstdc++-v3/libsupc++ -D_GLIBCXX_SHARED -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-q
 ual -Wabi=2 -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=eh_alloc.lo -g -O2 -D_FORTIFY_SOURCE=2 -I/usr/include -c ../../../../gcc-10.3.0/libstdc++-v3/libsupc++/eh_alloc.cc  -fPIC -DPIC -D_GLIBCXX_SHARED -o eh_alloc.o
In file included from ../../../../gcc-10.3.0/libstdc++-v3/libsupc++/unwind-cxx.h:36,
                 from ../../../../gcc-10.3.0/libstdc++-v3/libsupc++/eh_arm.cc:26:
/pbulk/work/lang/gcc10/work/build/gcc/include/unwind.h:30:10: fatal error: unwind-arm-common.h: No such file or directory
   30 | #include "unwind-arm-common.h"
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.

GCC 6 (not that significant, but)

/pbulk/work/lang/gcc6/work/build/./gcc/xgcc -B/pbulk/work/lang/gcc6/work/build/./gcc/ -B/usr/pkg/gcc6/armv6--netbsdelf-eabihf/bin/ -B/usr/pkg/gcc6/armv6--netbsdelf-eabihf/lib/ -isystem /usr/pkg/gcc6/armv6--netbsdelf-eabihf/include -isystem /usr/pkg/gcc6/armv6--netbsdelf-eabihf/sys-include    -g -O2 -D_FORTIFY_SOURCE=2 -I/usr/include -O2  -g -O2 -D_FORTIFY_SOURCE=2 -I/usr/include -DIN_GCC    -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector  -fPIC -I. -I. -I../.././gcc -I../../../gcc-6.5.0/libgcc -I../../../gcc-6.5.0/libgcc/. -I../../../gcc-6.5.0/libgcc/../gcc -I../../../gcc-6.5.0/libgcc/../include  -DHAVE_CC_TLS  -o _ucmpdi2_s.o -MT _ucmpdi2_s.o -MD -MP -MF _ucmpdi2_s.dep -DSHARED -DL_ucmpdi2 -c ../../../gcc-6.5.0/libgcc/libgcc2.c
In file included from ../../../gcc-6.5.0/libgcc/unwind-c.c:30:0:
./unwind.h:30:31: fatal error: unwind-arm-common.h: No such file or directory
 #include "unwind-arm-common.h"

>How-To-Repeat:
Observe TNF bulk build reports for 32-bit ARM targets.
>Fix:
Unknown. I tried to look over NetBSD GCC import/merge history, but this
is beyond my ken.

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->feedback
State-Changed-By: mrg@NetBSD.org
State-Changed-When: Wed, 02 Feb 2022 22:11:11 +0000
State-Changed-Why:
should be fixed for gcc 10 now.  the same patches (or very similar)
should also fix the gcc 9 failure.  don't know about gcc 8, and the
gcc 6 one is likely similar to at least part of the gcc 10 patches.


From: "matthew green" <mrg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56679 CVS commit: pkgsrc/lang/gcc10
Date: Wed, 2 Feb 2022 22:07:28 +0000

 Module Name:	pkgsrc
 Committed By:	mrg
 Date:		Wed Feb  2 22:07:28 UTC 2022

 Modified Files:
 	pkgsrc/lang/gcc10: distinfo
 	pkgsrc/lang/gcc10/patches: patch-gcc_config.gcc
 	    patch-libgcc_config.host
 Added Files:
 	pkgsrc/lang/gcc10/patches: patch-gcc_config_arm_arm.h
 	    patch-gcc_config_arm_bpabi.h patch-gcc_config_arm_elf.h
 	    patch-gcc_config_arm_netbsd-eabi.h
 	    patch-gcc_config_arm_netbsd-elf.h

 Log Message:
 pull over the rest of netbsd arm32 configuration from -current.

 fixes PR#56679.  (tested in armv7hf-el chroot on armv8, and also tested
 doesn't break amd64 version.)


 To generate a diff of this commit:
 cvs rdiff -u -r1.12 -r1.13 pkgsrc/lang/gcc10/distinfo
 cvs rdiff -u -r1.2 -r1.3 pkgsrc/lang/gcc10/patches/patch-gcc_config.gcc
 cvs rdiff -u -r0 -r1.1 pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_arm.h \
     pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_bpabi.h \
     pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_elf.h \
     pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_netbsd-eabi.h \
     pkgsrc/lang/gcc10/patches/patch-gcc_config_arm_netbsd-elf.h
 cvs rdiff -u -r1.1 -r1.2 pkgsrc/lang/gcc10/patches/patch-libgcc_config.host

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "David H. Gutteridge" <david@gutteridge.ca>
To: gnats-bugs@netbsd.org, mrg@NetBSD.org
Cc: 
Subject: Re: pkg/56679 (gcc6/gcc8/gcc9/gcc10 fail to build for NetBSD 32-bit
 ARM targets)
Date: Sun, 06 Feb 2022 18:58:50 -0500

 On Wed, 2022-02-02 at 22:11 +0000, mrg@NetBSD.org wrote:
 > Synopsis: gcc6/gcc8/gcc9/gcc10 fail to build for NetBSD 32-bit ARM
 > targets
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: mrg@NetBSD.org
 > State-Changed-When: Wed, 02 Feb 2022 22:11:11 +0000
 > State-Changed-Why:
 > should be fixed for gcc 10 now.  the same patches (or very similar)
 > should also fix the gcc 9 failure.  don't know about gcc 8, and the
 > gcc 6 one is likely similar to at least part of the gcc 10 patches.

 Thanks! I actually don't have any viable (real) hardware to test with,
 I was relying on the TNF bulk builds to detect this (which haven't run
 again yet).

 I noticed it because I'd bumped some packages to require GCC 8 minimum.
 Instead of them failing to build because of missing C++ features, they
 were now blocked by the lack of GCC 8.

 There's more than one way to deal with this, I guess. One would be to
 require GCC 10 for these ports, specifically. This is a deck (or should
 I say house) of cards I reshuffled to try and get Gnome to build for
 NetBSD 9.x. (I don't know how relevant this would generally be for 32-
 bit ARM users.)

 Thanks,

 Dave

State-Changed-From-To: feedback->open
State-Changed-By: gutteridge@NetBSD.org
State-Changed-When: Sun, 03 Apr 2022 00:34:19 +0000
State-Changed-Why:
This is presently under discussion in tech-pkg.

From: "Nia Alarie" <nia@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56679 CVS commit: pkgsrc/mk/compiler
Date: Thu, 7 Apr 2022 07:08:34 +0000

 Module Name:	pkgsrc
 Committed By:	nia
 Date:		Thu Apr  7 07:08:34 UTC 2022

 Modified Files:
 	pkgsrc/mk/compiler: gcc.mk

 Log Message:
 gcc.mk: gcc8 and gcc9 from pkgsrc do not build on 32-bit netbsd arm

 workaround PR pkg/56679


 To generate a diff of this commit:
 cvs rdiff -u -r1.237 -r1.238 pkgsrc/mk/compiler/gcc.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: PR/56679 CVS commit: pkgsrc/mk/compiler
Date: Sun, 15 May 2022 05:00:39 +0000

 On Thu, Apr 07, 2022 at 07:10:01AM +0000, Nia Alarie wrote:
  >  Log Message:
  >  gcc.mk: gcc8 and gcc9 from pkgsrc do not build on 32-bit netbsd arm
  >  
  >  workaround PR pkg/56679

 To clarify going forward: gcc10 is fixed, gcc8 and gcc9 (and gcc6/7
 too) have been hacked so we use gcc10 instead as a workaround.

 Ideally they should be patched as well.

 -- 
 David A. Holland
 dholland@netbsd.org

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.