From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 111B82C00E3 for ; Sat, 26 Oct 2013 00:03:18 +1100 (EST) Message-ID: <1382706165.9395.63.camel@pasglop> Subject: Re: [PATCH] [RFC] Emulate "lwsync" to run standard user land on e500 cores From: Benjamin Herrenschmidt To: David Laight Date: Fri, 25 Oct 2013 14:02:45 +0100 In-Reply-To: References: <1382081880-6666-1-git-send-email-wd@denx.de> <39CCEB38-1D9B-4918-B8F4-148D4E90FE21@kernel.crashing.org> <1382523314.3926.21.camel@aoeu.buserror.net> <1382607919.9395.56.camel@pasglop> <6BFC8EB0-1A75-41C3-985A-E3ED14846710@kernel.crashing.org> , <26976A96-8DF8-44EB-8B9B-E23200738F4E@kernel.crashing.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Cc: Yang James-RA8135 , linuxppc-dev@lists.ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Fri, 2013-10-25 at 10:58 +0100, David Laight wrote: > > This is not a distro issue. It's a libstdc++ portability issue. libstdc++ > > hardcodes lwsync unless __NO_LWSYNC__ is explicitly defined, > > which you only get with -mcpu=8540/-mcpu=8548. When compiled > > for any powerpc target other than -mcpu=8540/-mcpu=8548, including > > the default -mcpu=common, libstdc++ will end up containing lwsync. > > There is no way to explicitly request libstdc++ to be built without lwsync > > with an -mcpu target other than 8540/8548. > > > > The issue is easily demonstrated by running a program that throws a > > C++ exception: __cxa_throw() is called, which has an lwsync. This > > results in an illegal instruction exception when run on an e500v1/e500v2. > > Perhaps libstc++ should be working out at run time whether lwsync is valid? Do we have enough coats of paint on this bike shed yet ? :-) I'm personally tempted to take Scott's approach since that's what we do for other things as well, it just works and is simple. Cheers, Ben.