NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-arm/52528: CPUFLAGS=-mfpu=neon-vfpv4 breaks some programs

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

Home | Main Index | Thread Index | Old Index