Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5259970yba; Wed, 10 Apr 2019 15:15:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwcGIRb/lh7WzmikteLX4WKUmnoVjMiRwy0Rxm1x1nWRXBzCX9A5MNYeYrdxmrThkUyrHEB X-Received: by 2002:a65:6148:: with SMTP id o8mr44101524pgv.153.1554934534775; Wed, 10 Apr 2019 15:15:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554934534; cv=none; d=google.com; s=arc-20160816; b=ObgM0MlSwItVQ+ejeDGyZ0tRz2lz2r/0qNO6wKt2eL+04gH84Db+3axGK02i/mAyl3 4a42mmSkJbGuZ8zfbfO9vherPbmtFWmGC5lBJzMgRRB7t+djNtjejcRx9MNoGXeNgtmM peHzWXl/zLGOMnIXpcWFZszDG0fV8oaGZlG4qaOLqBohrLDT5sY7ZI4nMi6+yDS6XEmp x3MvoVkQ609mxbzVfuOnkbnTlqCMCPxE9Am0j9KfSSNJMCci5N4V2MCAuTSWpDqwS66A PWy6ObtTsN4mqHDh6AMZQRJ10v8NBKpzTrgNlPhOysLNzctVndAtEUsyZnEP1xMtdVYS miKw== 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:dkim-signature; bh=uJDWQsEPXS4yDep7NTP0l/HJ1ALL+TiNXczz1789qPs=; b=HO2lDkzD7e1iUE6ubl4rA3uPK2P1u20rhZRvsaKnziLZHtFeDJiYQ3SNtfTeC2bjaM UiBIMDTtaiVtNslFJ534RlGGtP+zmsVthBhVzP0F7AO/OsKS7SSvHyZPcGMF0jNLlbnM VZrqMXQ+mRB2VAX0dsQEV8BZM52v38Hxcw8M2dx79BAGfdRjVxvP44sIWHc2mMBQi/8B Qkvog/X+dCZPtxhZbzQLzm8DyQqETDrYCHndesgbt7jLaEF0L5X2cZg39Vsb2Y0lJ1ju tIMGK6Yco3APovjPoGtgeNY5pc+qrEtjbzXvznifLSI18lod/x4hRGivicG4b3N9Hzq/ stwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Qo+s7jN1; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6si32977703pgk.320.2019.04.10.15.15.19; Wed, 10 Apr 2019 15:15:34 -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=@google.com header.s=20161025 header.b=Qo+s7jN1; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726595AbfDJWOn (ORCPT + 99 others); Wed, 10 Apr 2019 18:14:43 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:40724 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbfDJWOm (ORCPT ); Wed, 10 Apr 2019 18:14:42 -0400 Received: by mail-pg1-f193.google.com with SMTP id d31so2364485pgl.7 for ; Wed, 10 Apr 2019 15:14:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uJDWQsEPXS4yDep7NTP0l/HJ1ALL+TiNXczz1789qPs=; b=Qo+s7jN1bYH9SLxUdHShxvySnyBKCJTooYUXGPVF8JTL+OfHljseT2ZorY4/ebyUin xGqp4YemRIAP2HKolm8onqlSzyUZBuKKb3+ITwQMxkh8+no6D5kviUNynSLIMr3WM2dC m2eEYm2cSbtutlyZOXTms0onJbEtv3fdCNJ3hciAz70RxDZS/uwZOA8cg8HW7q4yM0ZO Q68x2b3dtz7CGfxu6VYp/ubA5VZJ5C7Zh53SvALy5DtAaczfarbBG3QVjzJoZnhVvjxD xKMkRs9U2BKEFBVYdf61RNxh8wvY2OhYDCjWcPFURXn1Z8VlNezS36A1oh7QzB1qnoca diMg== 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=uJDWQsEPXS4yDep7NTP0l/HJ1ALL+TiNXczz1789qPs=; b=SDUL1v4+1QBmRcmk3AN9IankipGPK+TPj/8uHTr3XhQBwCFAbkLwtrt33R5Eqh4oPN k1L1WcmRycx9C7NhgdE9elWSrieelVW8E5EHWCzE6cGNWpVt9blyZikCS5Ut4wKprREI amOXJEas/XJVq+j9bGAJ99s5bKzreYZfE7WoVoxh2JCyYQoO8Lne5WLq42Jwfv/JdkH7 /HDFvxYUPjTlVVHtsIlhQOZ/XbXdKaJm8Xh4B4ZEjzNfoO/aJY0Oz6FJjbxU2eG8eKr4 IzdaO+JXH/nuAC8OTpzI2FSxzEJTn8fmcdpADTUIDfRnKazqTzmsgIhs4ckoyO7WQt4L De6g== X-Gm-Message-State: APjAAAUkr3fXwdXllmJueuY+AB9EX+P2y/+rvYToGxI/2dYJVVV/LKsr 429fCitjIPxWXhVy55SItLsFvDp3V1eWjfEDqko6QQ== X-Received: by 2002:a62:14d7:: with SMTP id 206mr45075168pfu.162.1554934481373; Wed, 10 Apr 2019 15:14:41 -0700 (PDT) MIME-Version: 1.0 References: <20190410201300.3528984-1-arnd@arndb.de> <20190410201300.3528984-2-arnd@arndb.de> In-Reply-To: <20190410201300.3528984-2-arnd@arndb.de> From: Nick Desaulniers Date: Wed, 10 Apr 2019 15:14:30 -0700 Message-ID: Subject: Re: [PATCH 2/2] s390: boot, purgatory: pass $(CLANG_FLAGS) where needed To: Arnd Bergmann 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 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)? > KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-option,-ffreestanding) > KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g) > KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,)) > diff --git a/arch/s390/purgatory/Makefile b/arch/s390/purgatory/Makefile > index ce6a3f75065b..ecd0b3847fef 100644 > --- a/arch/s390/purgatory/Makefile > +++ b/arch/s390/purgatory/Makefile > @@ -22,6 +22,7 @@ KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes > KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare > KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding > KBUILD_CFLAGS += -c -MD -Os -m64 -msoft-float -fno-common > +KBUILD_CFLAGS += $(CLANG_FLAGS) > KBUILD_CFLAGS += $(call cc-option,-fno-PIE) > KBUILD_AFLAGS := $(filter-out -DCC_USING_EXPOLINE,$(KBUILD_AFLAGS)) > > -- > 2.20.0 > -- Thanks, ~Nick Desaulniers