From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5053 Path: news.gmane.org!not-for-mail From: Justin Cormack Newsgroups: gmane.linux.lib.musl.general Subject: Re: thumb2 support Date: Sun, 4 May 2014 14:56:49 +0100 Message-ID: References: <20140428120630.GG12324@port70.net> <20140428142714.GX26358@brightrain.aerifal.cx> <20140429005658.GC26358@brightrain.aerifal.cx> <20140430190357.GM26358@brightrain.aerifal.cx> <20140504120123.GB23751@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1399211831 26825 80.91.229.3 (4 May 2014 13:57:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 May 2014 13:57:11 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5057-gllmg-musl=m.gmane.org@lists.openwall.com Sun May 04 15:57:06 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Wgwud-0002FT-71 for gllmg-musl@plane.gmane.org; Sun, 04 May 2014 15:57:03 +0200 Original-Received: (qmail 18070 invoked by uid 550); 4 May 2014 13:57:02 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 18061 invoked from network); 4 May 2014 13:57:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=specialbusservice.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=APXVcHGxAAtQrzgg4OhIqjcj06aLVkAjxt+r7B8K7xY=; b=BnmqE45M+fDqIDI7RwUzmlOI/ctd+pJCteFAoXbCQ7FYVZBsmX+5aXNuQ+ohA05SvI /ZvkKdE+VXBZPLUmICptsyIIFZ64knCPZuPP0hFwQVOIvGqlw3+bzn9IbL3ownFV+W3J SeDSrt1v8sknjnT08JzQkG4SnB2GmsREFEf3k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=APXVcHGxAAtQrzgg4OhIqjcj06aLVkAjxt+r7B8K7xY=; b=YEA4LVEpvQVIa6/EBkO2XpuLlZ2SVGSaI0sOADNGR6cX83oy92YRbOgXZq14j+Yg/O vWcgiZdNz6yWVeOl0OG3fAG4ZvPQBxWOM7mp5loHcGBPvYC51yub4vRuoD8foczKZmuL JQiqcBPSqzDOfS3Omv2zk6SfiJqnbO6CN1LZxRtTo4JbOma8i+PSO2Vi/y0DAcCY1JKB YkuSCLONIfNuA2iOthpotHdEA+YzIyY/cX7pJUiHn61WbsZMD2m6jioXxh+v4QFs9faN +5ZaN0b2CSAYAYKFcmFT1GeJrpOEICzIE6IyxOJaxo93BOQO2zXo56Hjd0ga/MFsjJ7m F3jA== X-Gm-Message-State: ALoCoQnTfZNJv4WSLCIsou0wrx8hkZJ39OJ7WdDmKtzWn1lIpgfDEtftoA00WXlxa+tOZKIUHjiK X-Received: by 10.182.225.137 with SMTP id rk9mr2193125obc.51.1399211809526; Sun, 04 May 2014 06:56:49 -0700 (PDT) In-Reply-To: <20140504120123.GB23751@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:5053 Archived-At: On Sun, May 4, 2014 at 1:01 PM, Rich Felker wrote: > On Sun, May 04, 2014 at 12:54:40PM +0100, Justin Cormack wrote: >> On Wed, Apr 30, 2014 at 8:03 PM, Rich Felker wrote: >> > On Tue, Apr 29, 2014 at 06:09:14PM +0200, Wermut wrote: >> >> Hi >> >> >> >> I have tested the patch from Stephen Thomas at least for gcc 4.6, 4.7 >> >> and 4.8. Seems to work. Would be nice if the 1.1.1 release will >> >> include a fix. >> > >> > It only works for armv7. On armv6k, I'm getting errors that the >> > instructions aren't supported. I think we could simply add !thumb as a >> > condition for the whole block... >> >> The patch has the wrong conditional in, there are no standard >> __thumb__ and __thumb2__ defines, it is __ARM_ARCH_ISA_THUMB being 1 >> or 2 that differentiates. armv6k does not support thumb2. I should >> have enough machines of different flavours to make a working patch. > > I don't see __ARM_ARCH_ISA_THUMB getting defined at all (gcc 4.7.1) so > it doesn't seem reliable. __THUMBEL__ is defined in thumb mode > (presumably the EL is for little endian?) but that's the only thing > I'm getting that seems relevant other than __thumb__. I was wrong, sorry, __thumb__ and __thumb2__ are defined. Maybe __ARM_ARCH_ISA_THUMB does seem to be not defined always. >> We should be able to support just using thumb2, for thumb 1 I guess we >> can support a mixed mode with some files like this compiled for arm >> only, but the rest compiled with thumb, with interop turned on. Not >> sure how messy this will turn out to be. > > armv6 does not seem to have thumb2, does it? And for armv7 I think it > should be reasonable to assume any thumb support is thumb2. Is this > wrong? Aside from the question of the macro name, I think the current > patch covers all cases that can be covered. (BTW as far as I can tell > there's no good reason to ever compile with -mthumb for pre-v7, but it > doesn't hurt to support it. All the asm is arm mode anyway, so -mthumb > doesn't get you the ability to run on obscure hardware that's > thumb-only unless you rewrite all the asm too.) Some armv6 machines have thumb2, but not many (ARMv6T2 apparently, I don't have one I don't think). All v7 machines do have (only) thumb2. So you could test ARM_ARCH_6T2 or __thumb2__. Alternatively it seems you can compile with -Wa,-mimplicit-it=always and you don't need the patch at all. That could make it easier in future. So far all the thumb2-only hardware has no MMU, so less likely to be using musl... Justin