NetBSD Problem Report #52326

From john@andromeda.zia.io  Sat Jun 24 06:21:14 2017
Return-Path: <john@andromeda.zia.io>
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 "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id CFE7C7A1FA
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 24 Jun 2017 06:21:14 +0000 (UTC)
Message-Id: <201706240620.v5O6KcCd011830@andromeda.zia.io>
Date: Sat, 24 Jun 2017 06:20:38 GMT
From: john@ziaspace.com
Reply-To: john@ziaspace.com
To: gnats-bugs@NetBSD.org
Subject: devel/cmake fails to build on netbsd-8 on VAX
X-Send-Pr-Version: 3.95

>Number:         52326
>Category:       toolchain
>Synopsis:       devel/cmake fails to build on netbsd-8 on VAX
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    toolchain-manager
>State:          feedback
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 24 06:25:00 +0000 2017
>Closed-Date:    
>Last-Modified:  Sat Apr 14 11:30:04 +0000 2018
>Originator:     John Klos
>Release:        NetBSD 8.0_BETA
>Organization:

>Environment:


System: NetBSD luna.ziaspace.com 8.0_BETA NetBSD 8.0_BETA (LUNA-$Revision: 8.0a $) #0: Tue Jun 20 01:15:32 UTC 2017 john@home.zia.io:/usr/release/obj-vax/sys/arch/vax/compile/LUNA vax
Architecture: vax
Machine: vax
>Description:


NetBSD on vax, netbsd-8 from three days ago, current pkgsrc as of yesterday:

...
[ 88%] Building CXX object Source/CMakeFiles/ccmake.dir/CursesDialog/ccmake.cxx.o
[ 88%] Linking CXX executable ../bin/ccmake
ld: ../bin/ccmake: hidden symbol `__clz_tab' in /usr/lib/libgcc.a(_clz.o) is referenced by DSO
ld: final link failed: Bad value
Source/CMakeFiles/ccmake.dir/build.make:419: recipe for target 'bin/ccmake' failed
gmake[2]: *** [bin/ccmake] Error 1
CMakeFiles/Makefile2:1645: recipe for target 'Source/CMakeFiles/ccmake.dir/all' failed
gmake[1]: *** [Source/CMakeFiles/ccmake.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
gmake: *** [all] Error 2
*** Error code 2

Stop.
make[1]: stopped in /usr/pkgsrc/devel/cmake
*** Error code 1

>How-To-Repeat:

Try to compile devel/cmake.
>Fix:


>Release-Note:

>Audit-Trail:
From: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52326: devel/cmake fails to build on netbsd-8 on VAX
Date: Sun, 25 Jun 2017 04:31:57 +0000

 I am guessing vax is missing an implementation of __builtin_clz
 and cmake is using it (in ./Utilities/cmliblzma/common/tuklib_integer.h).

 It has a fallback for older compilers which you can use

From: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52326: devel/cmake fails to build on netbsd-8 on VAX
Date: Sun, 25 Jun 2017 05:19:34 +0000

 Looking at GCC include/longlong.h, most archs have a
 count_leading_zeros. vax does not.
 the fallback implementation references __clz_tab, which has hidden
 visibility.

Responsible-Changed-From-To: pkg-manager->maya
Responsible-Changed-By: maya@NetBSD.org
Responsible-Changed-When: Sun, 25 Jun 2017 05:37:55 +0000
Responsible-Changed-Why:
Mine.


State-Changed-From-To: open->feedback
State-Changed-By: maya@NetBSD.org
State-Changed-When: Sun, 25 Jun 2017 05:37:55 +0000
State-Changed-Why:
Try the patch


From: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52326: devel/cmake fails to build on netbsd-8 on VAX
Date: Sun, 25 Jun 2017 05:36:46 +0000

 I have made a GCC bug report for this:
 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81199

 Please try the attached patch.

 Index: longlong.h
 ===================================================================
 RCS file: /cvsroot/src/external/gpl3/gcc/dist/include/longlong.h,v
 retrieving revision 1.1.1.1
 diff -u -r1.1.1.1 longlong.h
 --- longlong.h	24 Jan 2016 06:05:54 -0000	1.1.1.1
 +++ longlong.h	25 Jun 2017 05:35:48 -0000
 @@ -57,8 +57,6 @@
  #define attribute_hidden
  #endif

 -extern const UQItype __clz_tab[256] attribute_hidden;
 -
  /* Define auxiliary asm macros.

     1) umul_ppmm(high_prod, low_prod, multiplier, multiplicand) multiplies two
 @@ -164,6 +162,7 @@
  #define count_trailing_zeros(COUNT,X)	((COUNT) = __builtin_ctzl (X))
  #define COUNT_LEADING_ZEROS_0 64
  #else
 +extern const UQItype __clz_tab[256];
  #define count_leading_zeros(COUNT,X) \
    do {									\
      UDItype __xr = (X), __t, __a;					\
 @@ -1705,6 +1704,7 @@
  #endif

  #if !defined (count_leading_zeros)
 +extern const UQItype __clz_tab[256];
  #define count_leading_zeros(count, x) \
    do {									\
      UWtype __xr = (x);							\

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@NetBSD.org
Cc: maya@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,
	john@ziaspace.com
Subject: Re: pkg/52326: devel/cmake fails to build on netbsd-8 on VAX
Date: Sun, 25 Jun 2017 12:11:34 +0200

 On Sun, Jun 25, 2017 at 05:40:01AM +0000, coypu@sdf.org wrote:
 > The following reply was made to PR toolchain/52326; it has been noted by GNATS.
 > 
 > From: coypu@sdf.org
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: pkg/52326: devel/cmake fails to build on netbsd-8 on VAX
 > Date: Sun, 25 Jun 2017 05:36:46 +0000
 > 
 >  I have made a GCC bug report for this:
 >  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81199

 I don't think the patch is correct and the real problem is that we are linking libgcc first (again).

 Joerg

From: John Klos <john@ziaspace.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52326: devel/cmake fails to build on netbsd-8 on VAX
Date: Sun, 25 Jun 2017 23:14:58 +0000 (UTC)

 > >  I have made a GCC bug report for this:
 > >  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81199
 >
 > I don't think the patch is correct and the real problem is that we are 
 > linking libgcc first (again).

 The patch didn't change anything.

 John

From: Thomas Klausner <wiz@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: john@ziaspace.com
Subject: Re: pkg/52326: devel/cmake fails to build on netbsd-8 on VAX
Date: Mon, 26 Jun 2017 06:33:58 +0200

 --q4beu7j2ekcwbaws
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline

 On Sun, Jun 25, 2017 at 11:20:01PM +0000, John Klos wrote:
 > The following reply was made to PR toolchain/52326; it has been noted by GNATS.
 > 
 > From: John Klos <john@ziaspace.com>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: pkg/52326: devel/cmake fails to build on netbsd-8 on VAX
 > Date: Sun, 25 Jun 2017 23:14:58 +0000 (UTC)
 > 
 >  > >  I have made a GCC bug report for this:
 >  > >  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81199
 >  >
 >  > I don't think the patch is correct and the real problem is that we are 
 >  > linking libgcc first (again).
 >  
 >  The patch didn't change anything.

 The attached (untested but straightforward) patch changes the link
 order to verify if joerg's hunch is correct.

 I don't think it should be committed as-is, but please try it out so
 we know.

 It's against -current's src/external/gpl3/gcc/dist/gcc/gcc.c.

 Thanks,
  Thomas

 --q4beu7j2ekcwbaws
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="gcc.diff"

 Index: gcc.c
 ===================================================================
 RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/gcc.c,v
 retrieving revision 1.14
 diff -u -r1.14 gcc.c
 --- gcc.c	14 Feb 2016 19:08:10 -0000	1.14
 +++ gcc.c	26 Jun 2017 04:30:37 -0000
 @@ -1463,8 +1463,8 @@
  		"%{!static:%{!static-libgcc:"
  #if USE_LD_AS_NEEDED
  		"%{!shared-libgcc:",
 -		static_name, " " LD_AS_NEEDED_OPTION " ",
 -		shared_name, " " LD_NO_AS_NEEDED_OPTION
 +		LD_AS_NEEDED_OPTION " ", shared_name, " " LD_NO_AS_NEEDED_OPTION " ",
 +		static_name,
  		"}"
  		"%{shared-libgcc:",
  		"--as-needed ", shared_name, " --no-as-needed ", static_name,

 --q4beu7j2ekcwbaws--

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52326: devel/cmake fails to build on netbsd-8 on VAX
Date: Thu, 29 Jun 2017 15:48:18 +0200

 I am currently testing a slightly simpler variant of the patch for
 the gobject-introspection issue.

 Martin

 Index: gcc.c
 ===================================================================
 RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/gcc.c,v
 retrieving revision 1.14
 diff -u -p -r1.14 gcc.c
 --- gcc.c	14 Feb 2016 19:08:10 -0000	1.14
 +++ gcc.c	29 Jun 2017 13:46:33 -0000
 @@ -1462,13 +1462,8 @@ init_gcc_specs (struct obstack *obstack,
    buf = concat ("%{static|static-libgcc:", static_name, " ", eh_name, "}"
  		"%{!static:%{!static-libgcc:"
  #if USE_LD_AS_NEEDED
 -		"%{!shared-libgcc:",
 -		static_name, " " LD_AS_NEEDED_OPTION " ",
 -		shared_name, " " LD_NO_AS_NEEDED_OPTION
 -		"}"
 -		"%{shared-libgcc:",
 -		"--as-needed ", shared_name, " --no-as-needed ", static_name,
 -		"}"
 +		LD_AS_NEEDED_OPTION " ", shared_name, " " LD_NO_AS_NEEDED_OPTION " ",
 +		static_name,
  #else
  		"%{!shared:"
  		"%{!shared-libgcc:", static_name, " ", eh_name, "}"

Responsible-Changed-From-To: maya->toolchain-manager
Responsible-Changed-By: maya@NetBSD.org
Responsible-Changed-When: Sun, 14 Jan 2018 17:09:12 +0000
Responsible-Changed-Why:
Unassign from myself


From: "Joerg Sonnenberger" <joerg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52326 CVS commit: src/external/gpl3/gcc/dist/gcc/config
Date: Wed, 19 Jul 2017 13:10:29 +0000

 Module Name:	src
 Committed By:	joerg
 Date:		Wed Jul 19 13:10:29 UTC 2017

 Modified Files:
 	src/external/gpl3/gcc/dist/gcc/config: netbsd-elf.h
 	src/external/gpl3/gcc/dist/gcc/config/m68k: netbsd-elf.h

 Log Message:
 PR 51266, PR 52326: Fix GCC specs to always default to -shared-libgcc,
 except on Sun2, which just uses plain -lgcc.


 To generate a diff of this commit:
 cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc/dist/gcc/config/netbsd-elf.h
 cvs rdiff -u -r1.10 -r1.11 \
     src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h

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

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52326 CVS commit: [netbsd-8] src/external/gpl3/gcc/dist/gcc/config
Date: Fri, 1 Sep 2017 08:45:42 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Fri Sep  1 08:45:42 UTC 2017

 Modified Files:
 	src/external/gpl3/gcc/dist/gcc/config [netbsd-8]: netbsd-elf.h
 	src/external/gpl3/gcc/dist/gcc/config/m68k [netbsd-8]: netbsd-elf.h

 Log Message:
 Pull up following revision(s) (requested by joerg in ticket #254):
 	external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h: revision 1.11
 	external/gpl3/gcc/dist/gcc/config/netbsd-elf.h: revision 1.12
 PR 51266, PR 52326: Fix GCC specs to always default to -shared-libgcc,
 except on Sun2, which just uses plain -lgcc.


 To generate a diff of this commit:
 cvs rdiff -u -r1.11 -r1.11.6.1 \
     src/external/gpl3/gcc/dist/gcc/config/netbsd-elf.h
 cvs rdiff -u -r1.10 -r1.10.6.1 \
     src/external/gpl3/gcc/dist/gcc/config/m68k/netbsd-elf.h

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

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.