NetBSD Problem Report #52817

From o.vd.linden@quicknet.nl  Wed Dec 13 19:35:23 2017
Return-Path: <o.vd.linden@quicknet.nl>
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 D59167A167
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 13 Dec 2017 19:35:23 +0000 (UTC)
Message-Id: <20171213193512.GA27934@sheep>
Date: Wed, 13 Dec 2017 20:35:12 +0100
From: Onno van der Linden <o.vd.linden@quicknet.nl>
To: gnats-bugs@netbsd.org
Subject: devel/lldb build on i386 fails with undefined reference

>Number:         52817
>Category:       pkg
>Synopsis:       lldb build on i386 fails with undefined reference
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 13 19:40:00 +0000 2017
>Last-Modified:  Thu Dec 14 17:25:00 +0000 2017
>Originator:     Onno van der Linden
>Release:        NetBSD 8.99.8
>Organization:
>Environment:
System: NetBSD sheep 8.99.8 NetBSD 8.99.8 (SHEEPKMS) #1: Mon Dec 4 16:43:49 CET 2017 onno@sheep:/usr/src/sys/arch/i386/compile/SHEEPKMS i386
Architecture: i386
Machine: i386
>Description:
Building devel/lldb from pkgsrc results in multiple undefined reference errors while linking  CXX shared library ../../lib/liblldb.so
For example:
Timer.cpp:(.text._ZN12lldb_private5Timer8CategoryC2EPKc+0x39): undefined reference to `__atomic_store_8'
and there's several more with both __atomic_store_8 and __atomic_load_8
>How-To-Repeat:
build devel/lldb on 32-bit intel
	<code/input/activities to reproduce the problem (multiple lines)>
>Fix:
quick & dirty fix is to put an extra -latomic_ops somewhere.

>Audit-Trail:
From: Onno van der Linden <o.vd.linden@quicknet.nl>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52817: devel/lldb build on i386 fails with undefined
 reference
Date: Wed, 13 Dec 2017 21:25:28 +0100

 Probably devel/lldb/Makefile needs something like

 .if ${MACHINE_ARCH} == "i386" 
 CFLAGS+=        -march=i586
 CXXFLAGS+=      -march=i586
 .endif


From: Kamil Rytarowski <n54@gmx.com>
To: gnats-bugs@NetBSD.org, Joerg Sonnenberger <joerg@netbsd.org>
Cc: 
Subject: Re: pkg/52817: devel/lldb build on i386 fails with undefined
 reference
Date: Wed, 13 Dec 2017 22:55:08 +0100

 This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
 --9hdQF52BhoagWHi1WpOKM8BU0AqOEcXEt
 Content-Type: multipart/mixed; boundary="XLleXL8A5fbATlasnHHbwMC3rPdvWHdhi";
  protected-headers="v1"
 From: Kamil Rytarowski <n54@gmx.com>
 To: gnats-bugs@NetBSD.org, Joerg Sonnenberger <joerg@netbsd.org>
 Message-ID: <cbbec9fe-13f2-20c9-6338-d1351a3d339e@gmx.com>
 Subject: Re: pkg/52817: devel/lldb build on i386 fails with undefined
  reference
 References: <pr-pkg-52817@gnats.netbsd.org> <20171213193512.GA27934@sheep>
  <20171213213500.B7C1E7A1FF@mollari.NetBSD.org>
 In-Reply-To: <20171213213500.B7C1E7A1FF@mollari.NetBSD.org>

 --XLleXL8A5fbATlasnHHbwMC3rPdvWHdhi
 Content-Type: text/plain; charset=utf-8
 Content-Language: en-US
 Content-Transfer-Encoding: quoted-printable

 On 13.12.2017 22:35, Onno van der Linden wrote:
 > The following reply was made to PR pkg/52817; it has been noted by GNAT=
 S.
 >=20
 > From: Onno van der Linden <o.vd.linden@quicknet.nl>
 > To: gnats-bugs@NetBSD.org
 > Cc:=20
 > Subject: Re: pkg/52817: devel/lldb build on i386 fails with undefined
 >  reference
 > Date: Wed, 13 Dec 2017 21:25:28 +0100
 >=20
 >  Probably devel/lldb/Makefile needs something like
 > =20
 >  .if ${MACHINE_ARCH} =3D=3D "i386"=20
 >  CFLAGS+=3D        -march=3Di586
 >  CXXFLAGS+=3D      -march=3Di586
 >  .endif
 > =20
 > =20
 >=20

 Joerg has noted this problem and already notified upstream about it,
 however so far nothing has been fixed as far as I can tell.


 --XLleXL8A5fbATlasnHHbwMC3rPdvWHdhi--

 --9hdQF52BhoagWHi1WpOKM8BU0AqOEcXEt
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"

 -----BEGIN PGP SIGNATURE-----

 iQJABAEBCAAqFiEELaxVpweEzw+lMDwuS7MI6bAudmwFAloxocMMHG41NEBnbXgu
 Y29tAAoJEEuzCOmwLnZsMlkP/jsd+t/R7TsRYZkf/JOHNfp0qbo65Rl38l2ztuLF
 pGkyQF8E9HmovjK+enOrQ/nmOzp1iXCnWUcGeFtExDPzTFFYlCWJ9M37G4WAfPr6
 WL5SSREzY0iBJB5IYvZOj0NZhj+tN8ZTZrXb5/tsEcOTwrtiIjniVF20bPbfyV3w
 VZ7iFgibsAxt9AbknL6s4Pe0zMPu4vQhYJGWMGvXbvWVMvh16GWLFjqBaLxgcbUC
 /5tbiZ9zx3FSt4cB8RjRelN1pB1vYFxvQByhNe4lG6NDMzjdrrOAqqxBDIFN3MoU
 g7PaNCdEZ7jSGrZdP01Y/80dLpxCEYGDBd96ZFwPqwkDPOkSvyJ5S/XEul+yzSOd
 FWX79C3Cea8pOUiSjJp4saYUDE73pJc9Oz6IpQWzALi4sE+DdlZuTr5M8NWZNlop
 Ky4sZ5YnHgGUag7Liy6i0FA1+rpHMqyQusz+iBnE1D1Ale6jHsZTjHYbruy8uhFU
 3MXw8udWMUdqFm8A4KCjf387StTobwj7g7lQhTQeivSlkxOc90sTFDMVxKI90SCN
 hPGS+YAx2o1ep0h5FPbkZ4CmQcb/zvGn+M8suFtPFbqjdVSz/pk4rul8TCvsVhJO
 fxixzAKf6Dfkv2R0c1RDi7q/z1j6B6MPAv9brUzQvOylNgS6MEAql4CITBQTiufv
 z3JK
 =bxth
 -----END PGP SIGNATURE-----

 --9hdQF52BhoagWHi1WpOKM8BU0AqOEcXEt--

From: Onno van der Linden <o.vd.linden@quicknet.nl>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52817: devel/lldb build on i386 fails with undefined
 reference
Date: Thu, 14 Dec 2017 17:15:25 +0100

 So the march=i586 hack works for the atomic operation functions
 that had gotten the undefined reference errors.

 However, another case of undefined reference is next:

 [ 90%] Linking CXX executable ../../bin/lldb-server
 /usr/obj/devel/lldb/work/.buildlink/lib/libpython2.7.so: warning: warning: tmpnam() possibly used unsafely, use mkstemp() or mkdtemp()
 /usr/obj/devel/lldb/work/.buildlink/lib/libpython2.7.so: warning: warning: tempnam() possibly used unsafely, use mkstemp() or mkdtemp()
 ../../lib/liblldbPluginProcessNetBSD.a(NativeThreadNetBSD.cpp.o): In function `lldb_private::process_netbsd::NativeThreadNetBSD::GetRegisterContext()':
 NativeThreadNetBSD.cpp:(.text._ZN12lldb_private14process_netbsd18NativeThreadNetBSD18GetRegisterContextEv+0x76): undefined reference to `lldb_private::process_netbsd::NativeRegisterContextNetBSD::CreateHostNativeRegisterContextNetBSD(lldb_private::ArchSpec const&, lldb_private::NativeThreadProtocol&, unsigned int)'

 No idea yet where CreateHostNativeRegisterContextNetBSD should come from.

 Onno

From: Onno van der Linden <o.vd.linden@quicknet.nl>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/52817: devel/lldb build on i386 fails with undefined
 reference
Date: Thu, 14 Dec 2017 18:16:53 +0100

 I wrote:
 >  No idea yet where CreateHostNativeRegisterContextNetBSD should come from.

 From the non existant ./source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_32.cpp or whatever the 32-bit x86 support file should be named.

 Until that one is available a condition in Makefile for 32-bit x86
 not being supported would probably be sufficient.

 Onno

From: Kamil Rytarowski <n54@gmx.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52817: devel/lldb build on i386 fails with undefined
 reference
Date: Thu, 14 Dec 2017 18:21:25 +0100

 This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
 --A6Bh87mCF1sJmWrFCsa6C5PVOHGIUG0sD
 Content-Type: multipart/mixed; boundary="5gR2ONWvM2O0tdcls3Hm58cUfxUVUQNmw";
  protected-headers="v1"
 From: Kamil Rytarowski <n54@gmx.com>
 To: gnats-bugs@NetBSD.org
 Message-ID: <1369f116-5b85-c1e4-e231-fc0eaf26f8cc@gmx.com>
 Subject: Re: pkg/52817: devel/lldb build on i386 fails with undefined
  reference
 References: <pr-pkg-52817@gnats.netbsd.org> <20171213193512.GA27934@sheep>
  <20171214162001.3B31F7A1E7@mollari.NetBSD.org>
 In-Reply-To: <20171214162001.3B31F7A1E7@mollari.NetBSD.org>

 --5gR2ONWvM2O0tdcls3Hm58cUfxUVUQNmw
 Content-Type: text/plain; charset=utf-8
 Content-Language: en-US
 Content-Transfer-Encoding: quoted-printable

 On 14.12.2017 17:20, Onno van der Linden wrote:
 > The following reply was made to PR pkg/52817; it has been noted by GNAT=
 S.
 >=20
 > From: Onno van der Linden <o.vd.linden@quicknet.nl>
 > To: gnats-bugs@NetBSD.org
 > Cc:=20
 > Subject: Re: pkg/52817: devel/lldb build on i386 fails with undefined
 >  reference
 > Date: Thu, 14 Dec 2017 17:15:25 +0100
 >=20
 >  So the march=3Di586 hack works for the atomic operation functions
 >  that had gotten the undefined reference errors.
 > =20
 >  However, another case of undefined reference is next:
 > =20
 >  [ 90%] Linking CXX executable ../../bin/lldb-server
 >  /usr/obj/devel/lldb/work/.buildlink/lib/libpython2.7.so: warning: warn=
 ing: tmpnam() possibly used unsafely, use mkstemp() or mkdtemp()
 >  /usr/obj/devel/lldb/work/.buildlink/lib/libpython2.7.so: warning: warn=
 ing: tempnam() possibly used unsafely, use mkstemp() or mkdtemp()
 >  ../../lib/liblldbPluginProcessNetBSD.a(NativeThreadNetBSD.cpp.o): In f=
 unction `lldb_private::process_netbsd::NativeThreadNetBSD::GetRegisterCon=
 text()':
 >  NativeThreadNetBSD.cpp:(.text._ZN12lldb_private14process_netbsd18Nativ=
 eThreadNetBSD18GetRegisterContextEv+0x76): undefined reference to `lldb_p=
 rivate::process_netbsd::NativeRegisterContextNetBSD::CreateHostNativeRegi=
 sterContextNetBSD(lldb_private::ArchSpec const&, lldb_private::NativeThre=
 adProtocol&, unsigned int)'
 > =20
 >  No idea yet where CreateHostNativeRegisterContextNetBSD should come fr=
 om.
 > =20
 >  Onno
 > =20
 >=20

 The 32-bit x86 support has not been developed so far. It shouldn't be
 far away, mostly reusing the existing x86_64 code.

 Also LLDB isn't finished and there are ptrace(2) issues under the neath
 so better to give this debugger more time.

 Personally, I don't plan to add 32-bit support any time soon. Help in
 development is welcome!


 --5gR2ONWvM2O0tdcls3Hm58cUfxUVUQNmw--

 --A6Bh87mCF1sJmWrFCsa6C5PVOHGIUG0sD
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"

 -----BEGIN PGP SIGNATURE-----

 iQJABAEBCAAqFiEELaxVpweEzw+lMDwuS7MI6bAudmwFAloysx4MHG41NEBnbXgu
 Y29tAAoJEEuzCOmwLnZsPMgP/2T7j68flJzAXI1E8mR/wS5PQBWhRT7bLD28yRQ7
 vq4KSQn44VgBPleqQcyn0O/QcMuACK77+l7882FWnNdknkWzx3txJbQagwQc3pR2
 8/40k9iMgf86YpcGq9IeCA3EUfS8mnZXP6DmVzxY3nmdIEeLQBZNe7BVFKmQdxmt
 DRwmp+LHqG8gqqP+4tz1Xv4u4FLgbRL6ZmpgbRpak29SSZtLbCaoyKNbIRNQfUKS
 24lnczY+D5uJkIfi4FX+AjE31IhLA1QUv5b2zewV/ipshaJuVYLPzrMpezVwHfYo
 ytqEQzIA+NH6OdVSU/Tc4KcY5nL2P9kfr/aNH0riHB1btiWpiMbBIzhbV+Ck4uKT
 4Yg5Zu8wjmTkmGFZZCsdAMPgNI+Mn5y1SGBwP/QplD509JTg5GMupBxl4iV9hBmy
 F7TxxM7H5ITrdgN+NenoTDQ/N/JT2FKUzzWHDmgCL/JkU0OfyvzqAeLWr+xxNfbP
 2xsrhUDcrYdBrLPKITL0BSFKWBY8JI4sYqIQozVaurR5qTgNFfkBHu9Gs1rj1+2c
 QncGBdlg5QxrVWF//oeZRWijGK8gzbqEVO3e987vZrLWvnc1cUoDk+6Rok8kcCXK
 Oo6Hc6uAQWJKeo2JhfJXTROoMxoj2zv8+KMviuoTGnDtvFPMkPO8YA6xwe3elI38
 vnDE
 =UZOo
 -----END PGP SIGNATURE-----

 --A6Bh87mCF1sJmWrFCsa6C5PVOHGIUG0sD--

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.