NetBSD Problem Report #55306

From triaxx@netbsd.org  Wed May 27 09:19:24 2020
Return-Path: <triaxx@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-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 80B311A9227
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 27 May 2020 09:19:24 +0000 (UTC)
Message-Id: <20200527091923.872C51A9247@mollari.NetBSD.org>
Date: Wed, 27 May 2020 09:19:23 +0000 (UTC)
From: triaxx@netbsd.org
Reply-To: triaxx@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: Pkgsrc bootstrap failure with gcc 10
X-Send-Pr-Version: 3.95

>Number:         55306
>Category:       pkg
>Synopsis:       Pkgsrc bootstrap failure with gcc 10, pax fails to build with -fno-common (default in GCC>=10)
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    joerg
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 27 09:20:00 +0000 2020
>Closed-Date:    
>Last-Modified:  Sat Jul 17 08:10:01 +0000 2021
>Originator:     Frédéric Fauberteau
>Release:        Linux 5.6.13-arch1-1 x86_64 | pkgsrc-HEAD
>Organization:
>Environment:
System: Linux guardian 5.6.13-arch1-1 #1 SMP PREEMPT Thu, 14 May 2020 06:52:53 +0000 x86_64 GNU/Linux
Architecture: x86_64
Machine: amd64
Compiler: gcc (GCC) 10.1.0
>Description:
$ ./bootstrap --cwrappers no --prefer-pkgsrc yes --unprivileged --workdir /tmp/pkgsrc

produces the following errors:

===> Building for pax-20080110nb4
[...]
cc -L/tmp/pkgsrc/wrk/archivers/pax/work/libnbcompat -Wl,-R/home/triaxx/pkg/lib -o pax ar_io.o ar_subs.o buf_subs.o file_subs.o ftree.o  gen_subs.o getoldopt.o options.o pat_rep.o pax.o sel_subs.o tables.o  tar.o tty_subs.o  getid.o spec.o misc.o stat_flags.o pack_dev.o cpio.o -lutil -lnbcompat
/usr/bin/ld: ar_subs.o:(.bss+0x24e8): multiple definition of `chdname'; ar_io.o:(.bss+0x20): first defined here
/usr/bin/ld: buf_subs.o:(.bss+0x20): multiple definition of `chdname'; ar_io.o:(.bss+0x20): first defined here
/usr/bin/ld: file_subs.o:(.bss+0x8): multiple definition of `chdname'; ar_io.o:(.bss+0x20): first defined here
/usr/bin/ld: ftree.o:(.bss+0x0): multiple definition of `chdname'; ar_io.o:(.bss+0x20): first defined here
/usr/bin/ld: gen_subs.o:(.bss+0x0): multiple definition of `chdname'; ar_io.o:(.bss+0x20): first defined here
/usr/bin/ld: getoldopt.o:(.bss+0x0): multiple definition of `chdname'; ar_io.o:(.bss+0x20): first defined here
/usr/bin/ld: options.o:(.bss+0x0): multiple definition of `chdname'; ar_io.o:(.bss+0x20): first defined here
/usr/bin/ld: pat_rep.o:(.bss+0x0): multiple definition of `chdname'; ar_io.o:(.bss+0x20): first defined here
/usr/bin/ld: pax.o:(.bss+0x130): multiple definition of `chdname'; ar_io.o:(.bss+0x20): first defined here
/usr/bin/ld: sel_subs.o:(.bss+0x0): multiple definition of `chdname'; ar_io.o:(.bss+0x20): first defined here
/usr/bin/ld: tables.o:(.bss+0x0): multiple definition of `chdname'; ar_io.o:(.bss+0x20): first defined here
/usr/bin/ld: tar.o:(.bss+0x28): multiple definition of `chdname'; ar_io.o:(.bss+0x20): first defined here
/usr/bin/ld: tty_subs.o:(.bss+0x0): multiple definition of `chdname'; ar_io.o:(.bss+0x20): first defined here
/usr/bin/ld: cpio.o:(.bss+0x8): multiple definition of `chdname'; ar_io.o:(.bss+0x20): first defined here
collect2: error: ld returned 1 exit status
*** [pax] Error code 1
>How-To-Repeat:
>Fix:

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 10 Jul 2021 16:53:03 +0000
State-Changed-Why:
I'd expect this to be fixed by now


State-Changed-From-To: feedback->open
State-Changed-By: triaxx@NetBSD.org
State-Changed-When: Thu, 15 Jul 2021 07:14:14 +0000
State-Changed-Why:
Not fixed yet


From: Frederic Fauberteau <triaxx@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/55306 (Pkgsrc bootstrap failure with gcc 10, pax fails to
 build with -fno-common (default in GCC>=10))
Date: Thu, 15 Jul 2021 09:13:43 +0200

 $ uname -mrs
 Linux 5.12.15-arch1-1 x86_64
 $ cc --version
 cc (GCC) 11.1.0

 I get the very same error.

Responsible-Changed-From-To: pkg-manager->joerg
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Sat, 17 Jul 2021 08:04:45 +0000
Responsible-Changed-Why:
over to maintainer


From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/55306 (Pkgsrc bootstrap failure with gcc 10, pax fails to
 build with -fno-common (default in GCC>=10))
Date: Sat, 17 Jul 2021 08:07:09 +0000

 On Thu, Jul 15, 2021 at 07:15:02AM +0000, Frederic Fauberteau wrote:
  >  $ uname -mrs
  >  Linux 5.12.15-arch1-1 x86_64
  >  $ cc --version
  >  cc (GCC) 11.1.0
  >  
  >  I get the very same error.

 The following patch fixes it, but it's not clear how to proceed. It
 looks like archivers/pax was last updated from base in about 2008, and
 while it should be updated that's going to be a big job and probably
 break a bunch of bootstraps. But until that's done, changing files/
 is undesirable. But on the third hand, I don't think it's safe to add
 patches to bootstrap packages either, and that's the only other
 reasonable alternative.


 --- extern.h~	2021-07-17 07:36:58.710288341 +0000
 +++ extern.h
 @@ -214,10 +214,10 @@ OPLIST * opt_next(void);
  int opt_add(const char *);
  int bad_opt(void);
  int mkpath(char *);
 -char *chdname;
 +extern char *chdname;
  #if !HAVE_NBTOOL_CONFIG_H
  #ifdef HAVE_FCHROOT
 -int do_chroot;
 +extern int do_chroot;
  #endif /* HAVE_FCHROOT */
  #endif

 --- options.c~	2021-07-17 07:36:58.720604534 +0000
 +++ options.c
 @@ -107,6 +107,13 @@ __RCSID("$NetBSD: options.c,v 1.11 2010/
  #include "mtree.h"
  #endif	/* SMALL */

 +char *chdname;
 +#if !HAVE_NBTOOL_CONFIG_H
 +#ifdef HAVE_FCHROOT
 +int do_chroot;
 +#endif
 +#endif
 +
  /*
   * Routines which handle command line options
   */


 -- 
 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.