Received: by 10.223.176.5 with SMTP id f5csp947147wra; Fri, 2 Feb 2018 08:40:45 -0800 (PST) X-Google-Smtp-Source: AH8x226ZbMzJsrtyepP9wo65u3YjihXd7JzTksZYjXK4pFZ2llknX746u0B/yy/DWYes+6LMoOXI X-Received: by 10.98.19.137 with SMTP id 9mr40353214pft.5.1517589645640; Fri, 02 Feb 2018 08:40:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517589645; cv=none; d=google.com; s=arc-20160816; b=Hn5xSefomtgW35XJ7521XDDAv1IhmH8Iz7/ayXS4sv7KUW027DpI6vvsY7d60aqDXY mleYs82BTdoY7HZ5Xmmeem2GWxjji3L+krwVgCoiELcHNYZvnns8mUn/Hfeikcj3yYsq jjbL6AYuA5BZFEH8eNGSAtxIHjEQ8wfte3cQq5dwkcW88/YdTRZ6d3n9XPGqJtiZbfoo QMb9Anwkdk08lUO0AqhJHy+w3V5B1BkncDQd88y1EExint5rJ2le16jIKF0iQNIU3wo8 IIhNS3oaJZHE8zYjyGHtvYYTxxVgqH9Mer3vFGVWeeOdMByj3lBVuF/3mdL1GoLRkxX5 ICDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=pWDpYtkcV+QA7jaoXcxfvARUltzD3Q+oGHYYoj4AScE=; b=x2FUrAIld2y+4RnnGLT7Hmnp1h2LG8n2pWqSG3gb/kvMDeVr6Kdop9xgO4/AppP51r B+vmSPyjo6drBCEGMEabydt6Kb1EMjNdBRZbnGHqSLZ7wIQjkFHmxB+yiXpubgoRDb0L qDjJRe7GX8xa5fjok+6zkoWUzx7XfyzV63QmDos9X48hHyZJqcrsTzmeCh6pJXf1OsmB 7uRVg0QX81YQDD+xQW3kQxrczHvsZ046cEHN7zJNEAQAqXrktqlNYDcEfHgsypDLGivL AL/eyxXKo7Ltvk/bykWHTihJgbOadPR3w6XCGPqJ2kfrzsT3eNBLB1amtVoh5AFfD9M1 e4KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aNmErXB2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j91-v6si2049403pld.353.2018.02.02.08.40.30; Fri, 02 Feb 2018 08:40:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aNmErXB2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751732AbeBBQjf (ORCPT + 99 others); Fri, 2 Feb 2018 11:39:35 -0500 Received: from mail-qt0-f196.google.com ([209.85.216.196]:37601 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751718AbeBBQj2 (ORCPT ); Fri, 2 Feb 2018 11:39:28 -0500 Received: by mail-qt0-f196.google.com with SMTP id d54so31643614qtd.4 for ; Fri, 02 Feb 2018 08:39:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=pWDpYtkcV+QA7jaoXcxfvARUltzD3Q+oGHYYoj4AScE=; b=aNmErXB2bojh1USt+NBbAss+hrPYXddYhlGXZksqGVP9TOJ0lOncI0L2UoG3jYXGHN FwhyJj4yLog4MpcnSApwGtzttmff4uFJzLwssnY60xaPpVoUlvN3AOxPkqY9+jMQDrO5 eo5GASbgZXNGu10zX4B+4/QOejj25DvJ2lXLk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=pWDpYtkcV+QA7jaoXcxfvARUltzD3Q+oGHYYoj4AScE=; b=KVuVzrhUm2eWi3zJUXPlvmZkcbJmMYY7yLjtc3eiwY/c0JbrNAKeGSZP2PnwFRoPje YMl/nsQT51byiP7+lk0LtdJqjeNrWPT1t5ilg2yOUJXigXPR89PvUyuVQVJQLn3ZnBVT p0vlXRO6JPeqOe8XZmoB5gnl2m1r836VSp9ZZcwGaslW5O7PkVGP2ghhhrlQJIBDPmm7 wD8A09fB92CXQUE48WXmEOPoRSiaKXQFEYQJmvxPFau2MuVTKFCTtWnXuhtTQirspRiv Zqjxo5aGscfQvhpvrXm2sws/c0xZwOQuWAyJEGTVMKsy2UB+otNQALhcT423MWzK/IvQ gxSw== X-Gm-Message-State: APf1xPAZ33PCDNrYOL5AEus8TTAHW6dRTJi4moPqRaMuRnxqaU/We1+j Z+8TH+Xzg9ehD2nV1OMz3/XBGg== X-Received: by 10.200.27.2 with SMTP id y2mr466410qtj.161.1517589567959; Fri, 02 Feb 2018 08:39:27 -0800 (PST) Received: from xanadu.home (modemcable228.104-82-70.mc.videotron.ca. [70.82.104.228]) by smtp.gmail.com with ESMTPSA id x135sm1655512qkx.93.2018.02.02.08.39.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Feb 2018 08:39:27 -0800 (PST) Date: Fri, 2 Feb 2018 11:39:26 -0500 (EST) From: Nicolas Pitre To: Arnd Bergmann cc: Russell King , Andi Kleen , Richard Earnshaw , Tamar Christina , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] ARM: xscale: fix gcc-8 build In-Reply-To: <20180202150756.420422-2-arnd@arndb.de> Message-ID: References: <20180202150756.420422-1-arnd@arndb.de> <20180202150756.420422-2-arnd@arndb.de> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2 Feb 2018, Arnd Bergmann wrote: > We use a hack in xscale-cp0.c to allow building it for ARMv4 while > also using ARMv5TE and iWMMXt specific inline assembly, by > adding a top-level asm statement. > > Unfortunately that hack no longer works with gcc-8, since it will > revert back to the normal architecture. The recommended way of > handling this is to use __attribute__((target("armv5te"))) on the > functions that need it, or #pragma GCC target("arch=armv5te"). > Either of those work with gcc-8, but not earlier versions, and > it seems worse to combine that with the old hack. > > Instead, this adds the .arch statement to each inline assembler > statement that needs it individually. That is also slightly uglier > than the previous hack, but it works with all compiler versions > and documents better why we need the override in the first place. > > Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84129 > Signed-off-by: Arnd Bergmann Acked-by: Nicolas Pitre > --- > arch/arm/kernel/xscale-cp0.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/arch/arm/kernel/xscale-cp0.c b/arch/arm/kernel/xscale-cp0.c > index 77a2eef72115..e06a2f6dac4f 100644 > --- a/arch/arm/kernel/xscale-cp0.c > +++ b/arch/arm/kernel/xscale-cp0.c > @@ -17,11 +17,10 @@ > #include > #include > > -asm(" .arch armv5te\n"); > - > static inline void dsp_save_state(u32 *state) > { > __asm__ __volatile__ ( > + ".arch armv5te\n\t" > "mrrc p0, 0, %0, %1, c0\n" > : "=r" (state[0]), "=r" (state[1])); > } > @@ -29,6 +28,7 @@ static inline void dsp_save_state(u32 *state) > static inline void dsp_load_state(u32 *state) > { > __asm__ __volatile__ ( > + ".arch armv5te\n\t" > "mcrr p0, 0, %0, %1, c0\n" > : : "r" (state[0]), "r" (state[1])); > } > @@ -134,7 +134,8 @@ static int __init cpu_has_iwmmxt(void) > * tmrrc %0, %1, wR0 > */ > __asm__ __volatile__ ( > - "mcrr p0, 0, %2, %3, c0\n" > + ".arch armv5te\n\t" > + "mcrr p0, 0, %2, %3, c0\n\t" > "mrrc p0, 0, %0, %1, c0\n" > : "=r" (lo), "=r" (hi) > : "r" (0), "r" (0x100)); > -- > 2.9.0 > >