Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5616386yba; Thu, 11 Apr 2019 01:54:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzkl1bSnLJ7tBrR6tFkGq2BumoX+wjVsNqZpMibkSQvt5WOVP1Xo3xE2ate8yzcI0wxsL/E X-Received: by 2002:a17:902:44a4:: with SMTP id l33mr49157574pld.292.1554972872878; Thu, 11 Apr 2019 01:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554972872; cv=none; d=google.com; s=arc-20160816; b=GMBteYlBUeWZX5KJm8UUX/GQOWY/4NnNfLtC8NfkA2qi/01QfIVf1cxoJnGQ1ENl/s wZVd3krAr36WMS1DrnbOM7BjP5E8uXGI3e5t56/Ao05dvP0+TmxZhMLY/wMX1okiVHin HFu33lw7u6PIwaA/yEp98iKkPTmgPSL0xt5DFZ+fm8aeqiBGwZMPpH5TRRTGyfRoHvqo UEpEuR4hIEE0/U235xM1/8PW8mLPKGWXswCqywYOBWs1JER2F3Tan4nTj8WV+qDXdsIM eEmnOraPTs0+05R5BW4Emcb6asx6wfPfkgE+eW24zP58yg2NGezxc1CUURhZEdonMqqo nkUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=Zy5eU/X8uvoizIixQhEjfBDwS0KODN980Otb5tvnTB8=; b=o7qs8xiw1z78kSQs/ILJXLa+KFHIef6FzaKJqaYpSH7xJqE93DXIfGu7WjD8sM1iFv WP8IDYn0gJxLfNpO9vELyjIZ3OZKL5BF1s+w9dAiW37tc9OY0F24qryqztIwnBLCZYS1 bTbELoSxf1naut3MRUQAZqVcTfQHJgUpvWc73l8sWtvf0KqnHNJ7kUtn6SpopYmusAc9 XGM7tGv/pUM7uPR8cZiZFv7Pu21AvYjTjZcVxvjiGGSQbD3+mAn6RgXJbThDBfaZvrva y9IIl/6iUJ+05wp97ujWR+kLFT4FoeF0k2f9QiWY17yOjptB0d15Hyx7Va3YzLiW6727 cuAA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l34si33391916pgb.574.2019.04.11.01.54.17; Thu, 11 Apr 2019 01:54:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726965AbfDKIwX (ORCPT + 99 others); Thu, 11 Apr 2019 04:52:23 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:36141 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725793AbfDKIwW (ORCPT ); Thu, 11 Apr 2019 04:52:22 -0400 Received: by mail-qt1-f195.google.com with SMTP id s15so6195922qtn.3; Thu, 11 Apr 2019 01:52:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Zy5eU/X8uvoizIixQhEjfBDwS0KODN980Otb5tvnTB8=; b=LzZdlU29O1VSiwgoVEi3jetHYh+a6ghndQ2U0exx01dIBMZMo7gTPUBQCE7sd76Sx/ 2d1jKD67Lwu6CKfJui+qhO4ZBqZMtvaiyb3cJNSYrmmnP3zs9d21WfRRkR8S6Gjq0Cwk ceuzGWmwkqSqwXTyrwCpvMlVR339SGhDEhOC9L6JALeMiiRjLB8Lpx9/KGczy74+sXIm 3LQU3BrW0hkQk5XwZ3R1zLB39xlT5upO3BOUawYoPA+oqnmtBUSRbCMW1q/8SJprRmBh bvPWXn9LBRYmBAsRziYPgFmL74GqppWD66E/vXShiQa1/sD6h18RcT55EZqp/RZ3dw+S KZ+g== X-Gm-Message-State: APjAAAX1HRlLkkehPBF+3aC7ULOd5sG4O2THPTs+DtWzDmy/uco04Ppa TLkYeCd4iefaI7Ror6A3qhah4D6mIzBfJdTUVYk= X-Received: by 2002:ac8:8b9:: with SMTP id v54mr41886760qth.64.1554972741726; Thu, 11 Apr 2019 01:52:21 -0700 (PDT) MIME-Version: 1.0 References: <20190410201300.3528984-1-arnd@arndb.de> <20190410201300.3528984-2-arnd@arndb.de> In-Reply-To: From: Arnd Bergmann Date: Thu, 11 Apr 2019 10:52:05 +0200 Message-ID: Subject: Re: [PATCH 2/2] s390: boot, purgatory: pass $(CLANG_FLAGS) where needed To: Nick Desaulniers Cc: Martin Schwidefsky , Heiko Carstens , clang-built-linux@googlegroups.com, Nathan Chancellor , linux-s390 , Vasily Gorbik , Masahiro Yamada , Philipp Rudo , Hendrik Brueckner , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 11, 2019 at 12:14 AM 'Nick Desaulniers' via Clang Built Linux wrote: > On Wed, Apr 10, 2019 at 1:13 PM Arnd Bergmann wrote: > > > > The purgatory and boot Makefiles do not inherit the original cflags, > > so clang falls back to the default target architecture when building it, > > typically this would be x86 when cross-compiling. > > > > Add $(CLANG_FLAGS) everywhere so we pass the correct --target=s390x-linux > > option when cross-compiling. > > > > Signed-off-by: Arnd Bergmann > > --- > > arch/s390/Makefile | 5 +++-- > > arch/s390/purgatory/Makefile | 1 + > > 2 files changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/arch/s390/Makefile b/arch/s390/Makefile > > index 9c079a506325..443990791099 100644 > > --- a/arch/s390/Makefile > > +++ b/arch/s390/Makefile > > @@ -17,12 +17,13 @@ KBUILD_CFLAGS_MODULE += -fPIC > > KBUILD_AFLAGS += -m64 > > KBUILD_CFLAGS += -m64 > > aflags_dwarf := -Wa,-gdwarf-2 > > -KBUILD_AFLAGS_DECOMPRESSOR := -m64 -D__ASSEMBLY__ > > +KBUILD_AFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -D__ASSEMBLY__ > > KBUILD_AFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),$(aflags_dwarf)) > > -KBUILD_CFLAGS_DECOMPRESSOR := -m64 -O2 > > +KBUILD_CFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -O2 > > KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY > > KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float > > KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables > > Thanks for the respin with Nathan's suggestion. > > > +KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning,pointer-sign) > > What's up with this ^ ? Seems like the top level sets it (without > cc-disable-warning :( ), but then KBUILD_CFLAGS_DECOMPRESSOR discards > it. Does Clang actually flag code in this arch (that GCC doesn't)? Oops, that should have been a separate patch. I think what happens is that clang warns more aggressively about pointer sign bugs than gcc in some cases, and some of those cases happen in s390 header files that are included by both the kernel and the decompressor. The full warning log without this change is rather long, see https://pastebin.com/KG9xaTNB I also tried patching the code to avoid the warnings, but I'm not entirely happy with that result either, see https://pastebin.com/pSMz5eZA Arnd