Received: by 10.223.176.5 with SMTP id f5csp2369692wra; Thu, 8 Feb 2018 12:55:06 -0800 (PST) X-Google-Smtp-Source: AH8x225WIz3Q7zywKsgW+0Q9dbJwTXXpMdefx5DF+Qn0X76tF0vuZzf3l4hBgHkn25Tr6oPdHMEy X-Received: by 2002:a17:902:5303:: with SMTP id b3-v6mr270805pli.133.1518123306382; Thu, 08 Feb 2018 12:55:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518123306; cv=none; d=google.com; s=arc-20160816; b=ZH1GoTYpdzCDcxR6OKlh4eum63py+7/UqJ5lJE9kYYn3u+8XcZriZBMsYFf314iAWE hePKxDVwW/afK4KEdmZLRxyQYfp84EoYdjA9L/U1fJOJHcjT5GvzCpYtiIyKZsIAEK44 gybQC7QVy6m3CEtHtDLvf92hzJTHR78imLt+G2g/NvcFy4st/tXJjuYKvuOCppHuVC+y ddfyT75Jo+KT/1jF7IMp3FEH6h5PVGQajLhN2wD28xLXLJxnlCbdabLA/5d3Oef4HgrB hl/8qy97kZyEmd+MYoqKmZw2e6LlHzgN5JaacZT0IrwrnNR5M59pCgADDWbSHNGaK0BF YhNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=bo63PBNQtQnyBe9LMm/hY/c9I5engeerGTMo5X0yp7I=; b=nTDK865TEYp3tD7YFBkmmNyWXvDUDneaNIo8Zj/uuhjH15bcFR9hjbxW+9y7Lqwt0g ynOblI8ndljsPvLvFKPF4l1r3zK87oj+QwpdKM3Qq9+PY2YEtyUSHMIgPzNsItcxrfOz 89GZBPc96pmwxOoi32XYo6w48d0bbPJR7PbhOlCNPOomsxJTEO0X1QJAFVta1Nppv4Hy IwXWv3Jtf0FEPszp+YdQnUagsEawMOj3pnYpuNJaQEpup91uHXR5Em1ACN4ZF2AYJAcx 4LVcXB6MDLwGXrPB+q7WvOWeKJLHuZdMFNYeyaQ7jLclb9nQZQnffeasvJ/3haQDtDJw FbyQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4-v6si491091plm.163.2018.02.08.12.54.50; Thu, 08 Feb 2018 12:55:06 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752488AbeBHUxw (ORCPT + 99 others); Thu, 8 Feb 2018 15:53:52 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:40284 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752454AbeBHUxs (ORCPT ); Thu, 8 Feb 2018 15:53:48 -0500 Received: by mail-pg0-f65.google.com with SMTP id g2so2138605pgn.7 for ; Thu, 08 Feb 2018 12:53:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bo63PBNQtQnyBe9LMm/hY/c9I5engeerGTMo5X0yp7I=; b=fvHUNj3eZ3pW0exwqgh4iMPtTS2e2BWKRdmNp2ru6QghiqjJCk29YVvG4SvJrVokXh rdwMCG1HzWSHhjZVyl8IVk2sMS8GTp86bf0NcxvGzV1Cu5KP6JzMncYP8cevKCDxCKre 6pEURU9PMZ9SDRsvVMwSKsnZJB8ZhBzlEbIhAQQRvnRKiDe+q7o4t4lTMlGdXO+ls2mu SYHKUKAJ1VXciycD8eMokuYPa0tfLmD/v3eLAZMCZJIzy11u2BG97kQGkeXck/w1v7Vu fQk2zDMfHEml/L89dQJfdd5e2zfFfWBXx0gOjhP4erOLqIPXyEzamcF9+4EhA+J0cXSQ 1YYA== X-Gm-Message-State: APf1xPDoOtqPuBSN7TKflLqWHAZw2uJdG8PR81YsuloT/bXvyI8HyKLR 9MJghsm3YBqrS7N5+vAumyhA1g== X-Received: by 10.98.234.19 with SMTP id t19mr351863pfh.74.1518123227787; Thu, 08 Feb 2018 12:53:47 -0800 (PST) Received: from mka.mtv.corp.google.com ([2620:0:1000:1600:5ff4:666d:2881:a60]) by smtp.gmail.com with ESMTPSA id 205sm33094pfw.77.2018.02.08.12.53.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 12:53:47 -0800 (PST) From: Matthias Kaehlcke To: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Zhou , David Airlie , Harry Wentland , Felix Kuehling , Dmytro Laktyushkin Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Guenter Roeck , Justin TerAvest , Craig Bergstrom , Matthias Kaehlcke Subject: [PATCH v3 3/4] amdgpu/dc/dml: Support clang option for stack alignment Date: Thu, 8 Feb 2018 12:53:15 -0800 Message-Id: <20180208205316.93330-3-mka@chromium.org> X-Mailer: git-send-email 2.16.0.rc1.238.g530d649a79-goog In-Reply-To: <20180208205316.93330-1-mka@chromium.org> References: <20180208205316.93330-1-mka@chromium.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DML uses the compiler option -mpreferred-stack-boundary=4 to configure a stack alignment of 16 bytes. Clang uses the option -mstack-alignment instead, which expects as parameter the alignment in bytes, and not a power of two like -mpreferred-stack-boundary. Probe for both compiler options and use the correct one, similar to what is done in arch/x86/Makefile. Reported-by: Guenter Roeck Signed-off-by: Matthias Kaehlcke --- Changes in v3: - adapted use of variable instead of subdir-ccflags-y drivers/gpu/drm/amd/display/dc/dml/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dml/Makefile b/drivers/gpu/drm/amd/display/dc/dml/Makefile index 96b337a03172..782886cac61c 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/Makefile +++ b/drivers/gpu/drm/amd/display/dc/dml/Makefile @@ -24,7 +24,13 @@ # It provides the general basic services required by other DAL # subcomponents. -dml_ccflags := -mhard-float -msse -mpreferred-stack-boundary=4 +ifneq ($(call cc-option, -mpreferred-stack-boundary=4),) + cc_stack_align := -mpreferred-stack-boundary=4 +else ifneq ($(call cc-option, -mstack-alignment=16),) + cc_stack_align := -mstack-alignment=16 +endif + +dml_ccflags := -mhard-float -msse $(cc_stack_align) CFLAGS_display_mode_vba.o := $(dml_ccflags) CFLAGS_display_mode_lib.o := $(dml_ccflags) -- 2.16.0.rc1.238.g530d649a79-goog