Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp503156pxb; Thu, 30 Sep 2021 10:32:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPtwkTIvxqR3wPZPnipR7WrQ1gfM9fmcohYaE2YF+RD1ld9gRuMTopgUgXaDUn1zGc+b4v X-Received: by 2002:a63:f80a:: with SMTP id n10mr5900846pgh.303.1633023128173; Thu, 30 Sep 2021 10:32:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633023128; cv=none; d=google.com; s=arc-20160816; b=M7TX55vJYZpn7VCvoGnLkUdPZVEk52nU6fVojf17EBVY1pRdKMQ2NqToGPXV/7MjPB yIIBCfBqLNlGWCmUwfRMBlPsBrwbq+GZ/El8V8k25BPkHTmtLKKTffluXHDu7w3MN3Lu 0sWt8LRqS0VMugud5VQIbbXuSZ+arRkFHWmrPkMpUzYsf2BN5YkkxT9MyFZlpddOPcS3 4UtFTrdLQBE5Lw1gv4K5TfhB37LN1gGUXK1Za32TG6e2XaveGIZ39DC/ShRivQ6+0lLE X+JoyIGQdj5i1mS5JvkmPzT5hhmYQBqs39QtBxlKnsIVJb+KBSC9Hx9AVNRBgKBqZF/Q txsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ye/qqO0p8PKVzbuUoEwamPcpYGy0s9HnvVApER+R6kA=; b=Rq2uw/RHX8MyLFi8cgHzEnfIPnyfGLp4IUJ9tG4AHITBmMBd2ta4acXKVHxrjfUdlT zvw+29LICDiBPtNcF4SNDDFVocqL0ltRbvVu+3F4oh1dYQhvrk4OlMSTPgKyPoPS8hby UcHWBpJAGsd1/j3I4zQIFJz4C206JoMGZbjzB8XYp6QqklXmFwozP0ue2w2QMjEnFqt+ 8o59djFFqHylhnNzc+hlXrUuX3sA6L64cSpsEqFD0X7VM0l7HvEhQqkR4fTitEqC24ST dCmiWkxHp1jLdrvAltSamgO8w1QSVmdOf9KCaZ3gK/5JCXmaFA0MB3Gs/NauzaXHBZfo dUxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ftI3Z0SV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id r17si4311994plr.171.2021.09.30.10.31.50; Thu, 30 Sep 2021 10:32:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ftI3Z0SV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1352679AbhI3Rbq (ORCPT + 99 others); Thu, 30 Sep 2021 13:31:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352606AbhI3Rbp (ORCPT ); Thu, 30 Sep 2021 13:31:45 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96090C06176A for ; Thu, 30 Sep 2021 10:30:02 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id y26so28652342lfa.11 for ; Thu, 30 Sep 2021 10:30:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ye/qqO0p8PKVzbuUoEwamPcpYGy0s9HnvVApER+R6kA=; b=ftI3Z0SVqMbhoWdnhg5bUeF+owpQShwFKiFCCXBcdn4RZHbJbc2J0o5nj5aw/QCKc0 Vdv2kgukq9RGNxjvjCA3DkRkCBBBad79JhJxxgNrkccjH4TiJmRBW0i0ltEOb3yFMdev fFeMeE/vjhHmOt6rD9YvGkHtfgRxvfpXrATQ9+w5QnzKHBDo8urSjo0OMyTAAQJAH+zc EwvsOhDC+BRkFf8OyUTq4uGhLOTBNWDzgLni0BSbv5tf0eiZ2g1db+Bz2V5XwFVunwsL zbC/56A/1fmE7NB8Ti2l0dQyedYulC894HG+7anlAY/mFjb5fTXbiZUoIMQ/I8y6CLKy 8uww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ye/qqO0p8PKVzbuUoEwamPcpYGy0s9HnvVApER+R6kA=; b=SEMdb4xB+SWyDJY/KaH4YnWJOcy4CgmdDTSJLSQ3fJ+qfZOvXB7jIxH3byWvhHyT+f dtKorVbANFBL3ccLFebrs7hxZT8KE+OGvSiUGMNzLOxNRSxco6QoYpG8U/NlHP2Hq+17 8EpZxrCxr6wJEAgAqNRKo4NVXC9yCUwQ0NCGpGGjG7u7YdjRZmuDt6gq9RxDZVawR/1s sAMWzBa0jxzoqmOuu/gmGGmKq2jGiyUecE9X/6JMSQohX2z1/2fNPQ/SCT5TaHd4fwbx DKKIZOi0iUt6T4gzvSzmHtFxz+KjWsP+eS034VMu+zgtEz94kTm9h1yVf9mDgg1bjU4Y kq4g== X-Gm-Message-State: AOAM531dppU0BJ78ByK7cezwUFfPZWAx54M1m26BILv39tNgwV83EHxb KDqNBWu1TahLtGxo9+E5a1QFcLeuJKOPhFga4l3LTw== X-Received: by 2002:a05:651c:b20:: with SMTP id b32mr7192491ljr.62.1633023000715; Thu, 30 Sep 2021 10:30:00 -0700 (PDT) MIME-Version: 1.0 References: <20210930160142.2301257-1-nathan@kernel.org> In-Reply-To: <20210930160142.2301257-1-nathan@kernel.org> From: Nick Desaulniers Date: Thu, 30 Sep 2021 10:29:49 -0700 Message-ID: Subject: Re: [PATCH] drm/amd: Guard IS_OLD_GCC assignment with CONFIG_CC_IS_GCC To: Nathan Chancellor Cc: Harry Wentland , Leo Li , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 30, 2021 at 9:02 AM Nathan Chancellor wrote: > > cc-ifversion only works for GCC, as clang pretends to be GCC 4.2.1 for > glibc compatibility, which means IS_OLD_GCC will get set and unsupported > flags will be passed to clang when building certain code within the DCN > files: > > clang-14: error: unknown argument: '-mpreferred-stack-boundary=4' > make[5]: *** [scripts/Makefile.build:277: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn201/dcn201_resource.o] Error 1 > > Guard the call to cc-ifversion with CONFIG_CC_IS_GCC so that everything > continues to work properly. See commit 00db297106e8 ("drm/amdgpu: fix stack > alignment ABI mismatch for GCC 7.1+") for more context. > > Fixes: ff7e396f822f ("drm/amd/display: add cyan_skillfish display support") > Link: https://github.com/ClangBuiltLinux/linux/issues/1468 > Signed-off-by: Nathan Chancellor Thanks for the patch! Reviewed-by: Nick Desaulniers $ grep -rn "ifdef IS_OLD_GCC" drivers/gpu/drm/amd/display/dc/ | wc -l 11 It's probably time to put this pattern in a Makefile under scripts/ and include it in all of these Makefiles. Anything to minimize the amount of code that has to be carried forward to new subdirs. > --- > drivers/gpu/drm/amd/display/dc/dcn201/Makefile | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/gpu/drm/amd/display/dc/dcn201/Makefile b/drivers/gpu/drm/amd/display/dc/dcn201/Makefile > index d98d69705117..96cbd4ccd344 100644 > --- a/drivers/gpu/drm/amd/display/dc/dcn201/Makefile > +++ b/drivers/gpu/drm/amd/display/dc/dcn201/Makefile > @@ -14,9 +14,11 @@ ifdef CONFIG_PPC64 > CFLAGS_$(AMDDALPATH)/dc/dcn201/dcn201_resource.o := -mhard-float -maltivec > endif > > +ifdef CONFIG_CC_IS_GCC > ifeq ($(call cc-ifversion, -lt, 0701, y), y) > IS_OLD_GCC = 1 > endif > +endif > > ifdef CONFIG_X86 > ifdef IS_OLD_GCC > > base-commit: b47b99e30cca8906753c83205e8c6179045dd725 > -- > 2.33.0.591.gddb1055343 > -- Thanks, ~Nick Desaulniers