Received: by 2002:a25:2588:0:0:0:0:0 with SMTP id l130csp6071423ybl; Tue, 10 Sep 2019 13:23:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7DqaVxyrIGAuTwCzPMldbswD5Xe9NnF7QV4j1UmTZdMqp0Kj753y6ML1twYWHHMngyVLV X-Received: by 2002:a05:6402:17ae:: with SMTP id j14mr32498103edy.219.1568147022300; Tue, 10 Sep 2019 13:23:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568147022; cv=none; d=google.com; s=arc-20160816; b=lIN8edmrra1xNH1pNLjgVkSrEM5e/FrTT4P+rapSK0+UIwFNg37TGNKJK22/+1Jwpk 5e1pp2V+Zjw7aTME1MH//V4EOl7fBEkod5D3JEB2sXwOFAvsiDQqXG6TxNRbtPNfyyS3 HR8Zmb0x7pn1AGq8A6v39zJTWYNsgr6SzB1AIj54egUrJeFX0VkKf7nYHcxzcN1x3fV4 jwlFzoU1jZrJIbSrEzEu4b4RVtDCOGP0AlAAhzUESIkj3+edIZUhwZq1OwGv5hBpJtg/ AkIOrh+nGhM7+10iBemoOM3NG59YpqFoxiD80dob7K9aeM1HOH/m3cbY/F94vgDnnv9z DNpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Jpk6aWfDsr+wjLXvq2B45mZ3x2l5amVRwHa9kiI1c0I=; b=TnrBNNKxMO/fLT8QKEnf1TGzCkYHqXBia8/S4qP80MTudsrBstBtjswjeunKUXkTw0 fIelIJ1F+cwNvsc5X446hnvwmrnZUaQ5UEwrr5MYbs+eHLFBuVzV2lV2DYIMybbar9Y1 2dVsWvi70GDHdiJnJ9bMs29K5xP1CwVJckOG+5jLfm980UXpz2V9EC2JuShmOBI2WCng TLiYPZ4zF7phT04f4hqw2oZ9V7O9xNku+OFXs1/KKKBJooZkgePtcGmKZgcza4qc/4Uc NyqHXjfEgkIKJ4+XBu14lirB9MSEWi7SRKmMkXpXadjpMLUZpSDTiK67pragqKYNt773 h+tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EqsljV6R; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d29si12021934edb.203.2019.09.10.13.23.18; Tue, 10 Sep 2019 13:23:42 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=EqsljV6R; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728230AbfIJSh6 (ORCPT + 99 others); Tue, 10 Sep 2019 14:37:58 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:52497 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725770AbfIJSh6 (ORCPT ); Tue, 10 Sep 2019 14:37:58 -0400 Received: by mail-wm1-f66.google.com with SMTP id t17so664593wmi.2; Tue, 10 Sep 2019 11:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Jpk6aWfDsr+wjLXvq2B45mZ3x2l5amVRwHa9kiI1c0I=; b=EqsljV6R1Oc8io09+E+9JENgvuhVia+vCgepJpEF5LoHg1IvSODazF1pbnc6Ik5mcZ CP41BRoQpdz4FscoDCzm9koKcGOLU4p4HFeLGKc+OxIoDj2cJ3N92wKM9FMkvQHwGpRR OKvxvWwVvhdbJkwTMzGQ/cdxuYt704h9RfCiPE4cZIy94+HxnN6UJ4BXvjBHJEf2erGF iwE9mckoqYvLxQbzURoSbAMjexskGkQw1khtDcqsd8LivkHoIldnU45INf6I7bbJAg7D rhUoDmSy4ogXq7I3GgqCKxV4ZxdOpx7dwnaYmk72vLN85GnC0Lw9R3TMz25sD4qkWi4t 02rQ== 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:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Jpk6aWfDsr+wjLXvq2B45mZ3x2l5amVRwHa9kiI1c0I=; b=ACw8h2N210o7c0UdvBu7v17GC0kn0uII1Amyilfi5MG7RF/xneOU4izdJHxPaNjL2j fdYXZAyz9Mu0dd0M2bZiNeOfSfRtkftjV6wFHTGjuva5bMPHGWKodn3U2UShBfDX3TsM Yg8tGF14R8bLp+UHi/7Mm2qPvdq2OAwtNy/9CjYPDOcCITKS5k2/o6rnhKan8cLm+2xb mTqdux0kGuGoxReRzNmdRoggj0/pRV09JEEfiZFqvgEueWMFf3Zr1LFKoCjzd60xloa1 RzPboaaQmVHSP0fGt/rcnaYrZUGRAKZq67nv/HYhCe9vcK4Tl/TDq9G0bc8pvlzFIk88 bnRg== X-Gm-Message-State: APjAAAUTI3T1HafI3hgj47sexDCRijFbGiFfAOEpyDXfTNpp3rV1OgWR iex6Wt5zKaOT8Ccq96VpynO+c9k2OZp1Gw== X-Received: by 2002:a1c:a014:: with SMTP id j20mr165157wme.69.1568140676561; Tue, 10 Sep 2019 11:37:56 -0700 (PDT) Received: from archlinux-threadripper ([2a01:4f8:222:2f1b::2]) by smtp.gmail.com with ESMTPSA id y15sm278829wmj.32.2019.09.10.11.37.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2019 11:37:55 -0700 (PDT) Date: Tue, 10 Sep 2019 11:37:54 -0700 From: Nathan Chancellor To: Michael Ellerman Cc: Segher Boessenkool , David Laight , Nick Desaulniers , LKML , "# 3.4.x" , clang-built-linux , Paul Mackerras , linuxppc-dev Subject: Re: [PATCH] powerpc: Avoid clang warnings around setjmp and longjmp Message-ID: <20190910183754.GA42190@archlinux-threadripper> References: <20190828184529.GC127646@archlinux-threadripper> <6801a83ed6d54d95b87a41c57ef6e6b0@AcuMS.aculab.com> <20190903055553.GC60296@archlinux-threadripper> <20190903193128.GC9749@gate.crashing.org> <20190904002401.GA70635@archlinux-threadripper> <1bcd7086f3d24dfa82eec03980f30fbc@AcuMS.aculab.com> <20190904130135.GN9749@gate.crashing.org> <20190904231554.GA42450@archlinux-threadripper> <87mufcypf5.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87mufcypf5.fsf@mpe.ellerman.id.au> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 11, 2019 at 04:30:38AM +1000, Michael Ellerman wrote: > Nathan Chancellor writes: > > On Wed, Sep 04, 2019 at 08:01:35AM -0500, Segher Boessenkool wrote: > >> On Wed, Sep 04, 2019 at 08:16:45AM +0000, David Laight wrote: > >> > From: Nathan Chancellor [mailto:natechancellor@gmail.com] > >> > > Fair enough so I guess we are back to just outright disabling the > >> > > warning. > >> > > >> > Just disabling the warning won't stop the compiler generating code > >> > that breaks a 'user' implementation of setjmp(). > >> > >> Yeah. I have a patch (will send in an hour or so) that enables the > >> "returns_twice" attribute for setjmp (in ). In testing > >> (with GCC trunk) it showed no difference in code generation, but > >> better save than sorry. > >> > >> It also sets "noreturn" on longjmp, and that *does* help, it saves a > >> hundred insns or so (all in xmon, no surprise there). > >> > >> I don't think this will make LLVM shut up about this though. And > >> technically it is right: the C standard does say that in hosted mode > >> setjmp is a reserved name and you need to include to access > >> it (not ). > > > > It does not fix the warning, I tested your patch. > > > >> So why is the kernel compiled as hosted? Does adding -ffreestanding > >> hurt anything? Is that actually supported on LLVM, on all relevant > >> versions of it? Does it shut up the warning there (if not, that would > >> be an LLVM bug)? > > > > It does fix this warning because -ffreestanding implies -fno-builtin, > > which also solves the warning. LLVM has supported -ffreestanding since > > at least 3.0.0. There are some parts of the kernel that are compiled > > with this and it probably should be used in more places but it sounds > > like there might be some good codegen improvements that are disabled > > with it: > > > > https://lore.kernel.org/lkml/CAHk-=wi-epJZfBHDbKKDZ64us7WkF=LpUfhvYBmZSteO8Q0RAg@mail.gmail.com/ > > For xmon.c and crash.c I think using -ffreestanding would be fine. > They're both crash/debug code, so we don't care about minor optimisation > differences. If anything we don't want the compiler being too clever > when generating that code. > > cheers I will send a v2 later today along with another patch to fix this warning and another build error. Cheers, Nathan