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
>Organization:
>Environment:
System: NetBSD chartplotter 8.0_BETA NetBSD 8.0_BETA (CUBIEBOARD) #0: Fri Sep 1 13:15:30 CEST 2017 bouyer%bop.soc.lip6.fr@localhost:/dsk/l1/misc/bouyer/tmp/earmv7hf/obj/dsk/l1/misc/bouyer/netbsd-8/src/sys/arch/evbarm/compile/CUBIEBOARD evbarm
Architecture: earmv7hf
Machine: evbarm
>Description:
	building a release with
	./build.sh -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 http://www.boost.org/LICENSE_1_0.txt)

//  See http://www.boost.org/libs/config for most recent version.

//  MACRO:         BOOST_NO_EXCEPTIONS
//  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()
{
   try
   {
      throw_it(2);
   }
   catch(int i)
   {
      return (i == 2) ? 0 : -1;
   }
   catch(...)
   {
      return -1;
   }
   return -1;
}

}
int main(){ return boost_no_exceptions::test(); }
EOF
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

>How-To-Repeat:
	see above.
>Fix:
	unkown.



Home | Main Index | Thread Index | Old Index