From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12033 Path: news.gmane.org!.POSTED!not-for-mail From: Adhemerval Zanella Newsgroups: gmane.linux.lib.musl.general Subject: Re: How to handle attempts to combine ARM Thumb with frame pointers? Date: Thu, 26 Oct 2017 14:48:11 -0200 Message-ID: References: <20171008032153.GH1627@brightrain.aerifal.cx> <20171025211623.GU15263@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1509036517 14734 195.159.176.226 (26 Oct 2017 16:48:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 26 Oct 2017 16:48:37 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 To: musl@lists.openwall.com Original-X-From: musl-return-12046-gllmg-musl=m.gmane.org@lists.openwall.com Thu Oct 26 18:48:32 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1e7lKV-0002di-4P for gllmg-musl@m.gmane.org; Thu, 26 Oct 2017 18:48:27 +0200 Original-Received: (qmail 18199 invoked by uid 550); 26 Oct 2017 16:48:29 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 18169 invoked from network); 26 Oct 2017 16:48:28 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=Ii1MX1U/vbJjhfu/MlaP7Zh3Ur8tnRoVU5k6w5ZvAZs=; b=SKjz2dWWur2/BeneYohJ+fpmPGiS3tx7Gzrdchx04Xnz3xmkkNqQ0QQpk2HcMUMoku PgiqZ7gQ13RnC78aqkfgbiqeHfnBzlC+dRIXurpVWeFZKFf8R9LPtfuAySNosaJow5Z7 XuZ9m8q/iasjl0NHMNQ5iHl9wss3jRraIhwmM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Ii1MX1U/vbJjhfu/MlaP7Zh3Ur8tnRoVU5k6w5ZvAZs=; b=J5ctGtviIKo/opBmadkRD9x+n5giQyzjIV2ePX2GEN7oqVhlRQecOrxjvMnc8Q56zK xXUAydTPz4wFdZratqpQ8g4WNJXUnzRBxl0Vsfwu8KPjb66+ftOnnosXR2sJI6HflC2/ 5etsdAwseHHzd2H+07b9Z3emckDSEY190stS2Hn+sZ/9e2DTH7o+q0BayLmL4eXLIk6b 7WyTrYHAkpkdGTecpIxKuhNgHDBmtno4bhWCdCnmnT9/AkR62iRV/i2222vpWLuHVnL3 i1Dvxx0F1Uup/7RoAY/qwm9A9PCgWqbTVFOEuevzfJGDQ//mOJkCF6KRrW15WyKSM8Jv u1NQ== X-Gm-Message-State: AMCzsaXHNXODUjRdUSSRfHWG2AcDQyWltTqEr8Irg8WrcEl4zpLF+ejR oqE6B9C6Xr/cZE77cYGFczvqn/597MU= X-Google-Smtp-Source: ABhQp+TWHGs6pkAPW0vIGd8sdFXu5bq78rQzZbsco8oyw9PMkcDM2Hlmt/Napcs3PeY2kASGXCWy4w== X-Received: by 10.55.214.143 with SMTP id p15mr5553697qkl.298.1509036496219; Thu, 26 Oct 2017 09:48:16 -0700 (PDT) In-Reply-To: <20171025211623.GU15263@port70.net> Content-Language: en-GB Xref: news.gmane.org gmane.linux.lib.musl.general:12033 Archived-At: On 25/10/2017 19:16, Szabolcs Nagy wrote: > * Andre McCurdy [2017-10-09 09:48:29 -0700]: >> On Sat, Oct 7, 2017 at 8:21 PM, Rich Felker wrote: >>> On Fri, Oct 06, 2017 at 05:53:38PM -0700, Andre McCurdy wrote: >>> If you do want to test for broken configurations, rather than >>> hard-coding an assumption that some configuration is broken, you >>> should test for it. This would look something like, if ARCH is arm, >>> try compiling a trivial function with inline asm using r7 and see if >>> it fails. >> >> Yes, I came to the same conclusion after seeing the clang bug, which >> seems to suggest that clang uses a frame pointer even with >> optimisation enabled. >> >>> If so, exit with an error or perhaps try adding >>> -fomit-frame-pointer and retrying. >> >> If we over-ride the user supplied CFLAGS then there's probably no need >> to test the behaviour of the compiler - we can just force >> -fomit-frame-pointer unconditionally when compiling for Thumb/Thumb2. >> >> There's a slight complication though that if -fno-omit-frame-pointer >> is present in the user supplied CFLAGS then adding >> -fomit-frame-pointer to CFLAGS_AUTO won't over-ride it (since CFLAGS >> appears on the final compiler command line after CFLAGS_AUTO). >> >> Would it be OK for the configure script to append to CFLAGS? Or should >> the configure script perhaps setup a new variable (CFLAGS_FORCE?) >> which the Makefile would then add to CFLAGS_ALL after CFLAGS? >> > > glibc works this around in thumb mode by extern syscall asm > (of course it cannot guarantee that r7 is a frame pointer at > all times, an interrupt can observe r7 with syscall num in it, > i'm not sure if that's acceptable for users who compile with > frame-pointers, in musl there is some asm code which wont > have fp setup anyway). > > http://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/arm/sysdep.h;h=6a64351cdd87c2041d639a17efc9f681262d5e3f;hb=HEAD#l335 > Why do you mean by glibc strategy might not be acceptable? What kind of issue are you referring on interrupt case?