NetBSD Problem Report #53659

From tsutsui@ceres.dti.ne.jp  Mon Oct  8 03:10:14 2018
Return-Path: <tsutsui@ceres.dti.ne.jp>
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 245F17A156
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  8 Oct 2018 03:10:14 +0000 (UTC)
Message-Id: <201810080310.w983A7a4009819@ceres.dti.ne.jp>
Date: Mon, 8 Oct 2018 12:10:07 +0900 (JST)
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: pkgsrc-2018Q3 devel/protobuf build failure on NetBSD/i386 8.0
X-Send-Pr-Version: 3.95

>Number:         53659
>Category:       pkg
>Synopsis:       pkgsrc-2018Q3 devel/protobuf build failure on NetBSD/i386 8.0
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 08 03:15:00 +0000 2018
>Closed-Date:    Mon Dec 24 13:35:33 +0000 2018
>Last-Modified:  Mon Dec 24 13:35:33 +0000 2018
>Originator:     Izumi Tsutsui
>Release:        NetBSD 8.0
>Organization:
>Environment:
System: NetBSD mirage 8.0 NetBSD 8.0 (GENERIC) #0: Tue Jul 17 14:59:51 UTC 2018 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
pkgsrc-2018Q3 pkgsrc/devel/protobuf build fails on NetBSD/i386 8.0:

---
 :

/bin/sh ../libtool  --tag=CXX   --mode=link c++ -pthread  -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1 -Wall -Wno-sign-compare  -O2 -D_FORTIFY_SOURCE=2 -I/usr/pkg/include -I/usr/include -pthread  -L/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -o protoc google/protobuf/compiler/main.o  libprotobuf.la libprotoc.la -lz 
libtool: link: c++ -pthread -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1 -Wall -Wno-sign-compare -O2 -D_FORTIFY_SOURCE=2 -I/s/obj.i386/pkgsrc/devel/protobuf/work.i386/.buildlink/include -pthread -Wl,-rpath -Wl,/usr/pkg/lib -o .libs/protoc google/protobuf/compiler/main.o  -L/s/obj.i386/pkgsrc/devel/protobuf/work.i386/protobuf-3.6.0/src/.libs -L/s/obj.i386/pkgsrc/devel/protobuf/work.i386/.buildlink/lib -L./.libs -lprotoc -lprotobuf -lz -pthread -Wl,-rpath,/usr/pkg/lib
/s/obj.i386/pkgsrc/devel/protobuf/work.i386/protobuf-3.6.0/src/.libs/libprotobuf.so: undefined reference to `__atomic_fetch_add_8'
gmake[2]: *** [Makefile:3480: protoc] Error 1
gmake[2]: Leaving directory '/s/obj.i386/pkgsrc/devel/protobuf/work.i386/protobuf-3.6.0/src'
gmake[1]: *** [Makefile:1537: all-recursive] Error 1
gmake[1]: Leaving directory '/s/obj.i386/pkgsrc/devel/protobuf/work.i386/protobuf-3.6.0'
gmake: *** [Makefile:1444: all] Error 2
*** Error code 2

---

A full build log is in the following gist:
 https://gist.github.com/tsutsui/8f7e96edec02ef3f3441574890f90497

Note build on NetBSD/amd64 8.0 works.

>How-To-Repeat:
Build pkgsrc/devel/protobuf on NetBSD/i386 8.0

>Fix:

>Release-Note:

>Audit-Trail:
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: Re: pkg/53659: pkgsrc-2018Q3 devel/protobuf build failure on NetBSD/i386
	 8.0
Date: Mon, 8 Oct 2018 12:49:12 +0900

 It seems there is a pullup request in upstream.
 https://github.com/protocolbuffers/protobuf/pull/5227

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: Re: pkg/53659: pkgsrc-2018Q3 devel/protobuf build failure on NetBSD/i3868.0
Date: Sun, 23 Dec 2018 07:45:04 +0900

 For NetBSD/i386 builds, the following change (like firefox etc.)
 seems enough.


 Index: devel/protobuf/Makefile
 ===================================================================
 RCS file: /cvsroot/pkgsrc/devel/protobuf/Makefile,v
 retrieving revision 1.16
 diff -u -p -d -r1.16 Makefile
 --- devel/protobuf/Makefile	4 Aug 2018 21:19:39 -0000	1.16
 +++ devel/protobuf/Makefile	22 Dec 2018 22:43:26 -0000
 @@ -20,6 +20,11 @@ PKGCONFIG_OVERRIDE+=	protobuf.pc.in

  TEST_TARGET=	check

 +.if ${MACHINE_ARCH} == "i386"
 +# 64 bit atomic ops are required
 +CXXFLAGS+=	-march=i586
 +.endif
 +
  pre-configure:
  	${RUN} cd ${WRKSRC} && ./autogen.sh


 ---
 Izumi Tsutsui

From: "Izumi Tsutsui" <tsutsui@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53659 CVS commit: pkgsrc/devel/protobuf
Date: Sun, 23 Dec 2018 23:51:26 +0000

 Module Name:	pkgsrc
 Committed By:	tsutsui
 Date:		Sun Dec 23 23:51:26 UTC 2018

 Modified Files:
 	pkgsrc/devel/protobuf: Makefile

 Log Message:
 protobuf: fix build failure on NetBSD/i386 8.0.  PR pkg/53659

 Assume and specify -march=i586 for 64 bit atomic ops, as firefox does.
 "Looks ok" by wiz@.


 To generate a diff of this commit:
 cvs rdiff -u -r1.16 -r1.17 pkgsrc/devel/protobuf/Makefile

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

State-Changed-From-To: open->closed
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Mon, 24 Dec 2018 13:35:33 +0000
State-Changed-Why:
Patch committed!


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