NetBSD Problem Report #52528

From  Tue Sep  5 08:51:10 2017
Return-Path: <>
Received: from ( [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id 5B4487A177
	for <>; Tue,  5 Sep 2017 08:51:10 +0000 (UTC)
Message-Id: <>
Date: Tue,  5 Sep 2017 10:50:04 +0200 (MEST)
Subject: CPUFLAGS=-mfpu=neon-vfpv4 breaks some programs
X-Send-Pr-Version: 3.95

>Number:         52528
>Category:       port-arm
>Synopsis:       CPUFLAGS=-mfpu=neon-vfpv4 breaks some programs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-arm-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 05 08:55:00 +0000 2017
>Originator:     Manuel Bouyer
>Release:        NetBSD 8.0_BETA
System: NetBSD chartplotter 8.0_BETA NetBSD 8.0_BETA (CUBIEBOARD) #0: Fri Sep 1 13:15:30 CEST 2017 evbarm
Architecture: earmv7hf
Machine: evbarm
	building a release with
	./ -m evbarm -a earmv7hf -V CPUFLAGS="-mfpu=neon-vfpv4" 
	(call this a earmv7hf-neonvfpv4 release) cause some programs to
	fail on the target system.
	Here is an example:
cat > /tmp/conftest.cpp << EOF

//  (C) Copyright John Maddock 2001. 
//  Use, modification and distribution are subject to the 
//  Boost Software License, Version 1.0. (See accompanying file 
//  LICENSE_1_0.txt or copy at

//  See for most recent version.

//  TITLE:         exception handling support
//  DESCRIPTION:   The compiler in its current translation mode supports
//                 exception handling.

namespace boost_no_exceptions{

void throw_it(int i)
   throw i;

int test()
   catch(int i)
      return (i == 2) ? 0 : -1;
      return -1;
   return -1;

int main(){ return boost_no_exceptions::test(); }
c++ -o conftest conftest.c

	It doens't matter if the program is built on earmv7hf-neonvfpv4 or
	plain earmv7hf. When run on earmv7hf the program runs as expected,
	on earmv7hf-neonvfpv4 it fails with:
terminate called after throwing an instance of 'int'
terminate called recursively
Abort (core dumped)

	I tracked it down to libc (running on a plain earmv7hf with the
	earmv7hf-neonvfpv4 libc is enough to make it fail), and more
	specifically to libunwind.o in libc: on a earmv7hf-neonvfpv4 system,
c++ -static -o conftest conftest.c
	gives a non-working program, but
c++ -static -o conftest conftest.c libunwind.o
	gives a working one, with libunwind.o extracted from a plain
	earmv7hf libc.a

	see above.

NetBSD Home
NetBSD PR Database Search

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