Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp361682ybi; Fri, 7 Jun 2019 09:14:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXtzKmgqBiV6zIWkll8DRDwvWCpK3T517GcHfardl7WzmU6WmIUR5ilB+AbQlOOBFO1vU1 X-Received: by 2002:a63:e304:: with SMTP id f4mr3504888pgh.187.1559924049906; Fri, 07 Jun 2019 09:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559924049; cv=none; d=google.com; s=arc-20160816; b=SyfJczs1oXaRFWRv7Ail64hiuU+w8r+hylSXb2NO80JGMfW+OlyOTh0BVyVJiLzQqK 3uy2cuRL6Bnr9/IVL+6Vms75Tkexs6eHmnbpmkmT+GaT8coTFZSU8SIA1LONQ+2pGHUK Qg9PGbKpirYe5Yu6eRlL4gRVW4oBggtrS1zCsKuywB5/MoTq1ImM+KHp4+MyAVjuOTKE sBZ8vLzRRORfl8pOhz3y8/O3KV+IkaNs0SerGniw9l3FBqjFVZGooAUKocqgdpeX4tGB CMaz6IhaYi9A5f2Q9aQKZ4zmH++0X2HyOcBOwLF8/TCry1fUg0OKy6Gl9EMsq9wlijnL 7PrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=0JpUdTsOa7EIqirFoRpEdJ3i1kEV+MZYFQgC803VPU4=; b=FZeuv9dDZ4LQ6IWOKgCCF4vF+mDdPKtvWoXcS3XrlNh6WUgIhsFCogkuM0kLGxHsym wY9jm15nkJ6VqY822sq7BG4YeJPneUpJDgt9UcVjhnE3QK7SwVqzgl0LOi1RhOW21LH6 1TOJwzJ+QgAbQ325+jiTbcEmYdBsXyKi9+kBbLS+SQQ/qCl22e1OzDoiE6G/q9PZC4KJ ORYi7jaASVHjqADDY0HSc2npmwRhEsuB0V7hjwNxK4OjRHlIo85rjwJr7VLHvDlHGkoc 8X0/zjdqz9iapTwvlBR67v9sNMNXKA1tVssifoS0tLbffUgGMBGJhEb79A69EwtZIF4z ITSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JqR33tXv; 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 o4si2055935pfo.92.2019.06.07.09.13.52; Fri, 07 Jun 2019 09:14:09 -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=JqR33tXv; 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 S1730216AbfFGQMH (ORCPT + 99 others); Fri, 7 Jun 2019 12:12:07 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:42011 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729440AbfFGQMG (ORCPT ); Fri, 7 Jun 2019 12:12:06 -0400 Received: by mail-ed1-f66.google.com with SMTP id z25so3739363edq.9 for ; Fri, 07 Jun 2019 09:12:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0JpUdTsOa7EIqirFoRpEdJ3i1kEV+MZYFQgC803VPU4=; b=JqR33tXvj7r3SHSdAHfYwNexD3XwyD1ZvtvYnpUh+WuFIqsP+hRuv63fN0FauVOcjj RtW7VNOkguzUN+evgxN0vU5f6Utscp5VDT9uCSvFv9ErP39f1DoZVwUcEudOh1cCg4xf tXEHhviwSiYhRa8OVpLjGGzNq1UZOdWKHbbxVqkr7wucaWqoqdi9VfXzJ2u3vOnrJ6T5 FFQajWDRxOgOQOxXqEJyUwGhAWYf8n9qUP7QiVrxOXxdsH/MO7OnaTDxomnk5pjOseKK yTYkGnLAsm7mvkh4RoLf/xq8TfoJt46ZDhv8N6jrBWO+qUc1gTrp1g6Lf4hKfaVUQ+pg pg6w== 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:mime-version :content-transfer-encoding; bh=0JpUdTsOa7EIqirFoRpEdJ3i1kEV+MZYFQgC803VPU4=; b=W8RmEOfCOgnwTzVzIxSNC367E2WeowWBDcDjR/y8kFVkKYtJAbWMqyx3AjUSWaeuHv kIr8uFyW5EVnQYHW4GVzGb4zUIrysj6+vUHDpkwPTr2PnTTdcr5CXjRFiWoHMuEzqwwE ueNwDk7yraR8VJYTEhrK1GMpMA4uTQx9+F38KVjv7kjhK7Ny8M4OobPWvRxESRR+T5jB EqcGMr9wpAfHkLhd75KQ5RLUvowlfmfRWW4IF3dQATAj+wroeSRVXSXDjCrnZswTRrwE GwpJg73DnbnOQGo+5hetNuNiSHA+naN6LLeeJ+sPC+u+gub/fvFgYpfqFG2hYpanej2e VBPg== X-Gm-Message-State: APjAAAUoka6k2Jpho0wz12P0HLcyd6LpT0Q3w7Ebk7Qo++fLKexG9TLp ObVtlGgq1cmk4k78UK0avUQ= X-Received: by 2002:a17:906:53c8:: with SMTP id p8mr48103973ejo.18.1559923925065; Fri, 07 Jun 2019 09:12:05 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f9:2b:2b15::2]) by smtp.gmail.com with ESMTPSA id q24sm440117ejr.35.2019.06.07.09.12.03 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 07 Jun 2019 09:12:04 -0700 (PDT) From: Nathan Chancellor To: Catalin Marinas , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dave Martin , Nick Desaulniers , clang-built-linux@googlegroups.com, Nathan Chancellor , Qian Cai Subject: [PATCH] arm64: Don't unconditionally add -Wno-psabi to KBUILD_CFLAGS Date: Fri, 7 Jun 2019 09:12:01 -0700 Message-Id: <20190607161201.73430-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.22.0.rc3 MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a GCC only option, which warns about ABI changes within GCC, so unconditionally adding breaks Clang with tons of: warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option] and link time failures: ld.lld: error: undefined symbol: __efistub___stack_chk_guard >>> referenced by arm-stub.c:73 (/home/nathan/cbl/linux/drivers/firmware/efi/libstub/arm-stub.c:73) >>> arm-stub.stub.o:(__efistub_install_memreserve_table) in archive ./drivers/firmware/efi/libstub/lib.a I suspect the link time failure comes from some flags not being added via cc-option, which will always fail when an unknown flag is unconditionally added to KBUILD_CFLAGS because -Werror is added after commit c3f0d0bc5b01 ("kbuild, LLVMLinux: Add -Werror to cc-option to support clang"). $ echo "int main() { return 0; }" | clang -Wno-psabi -o /dev/null -x c - warning: unknown warning option '-Wno-psabi' [-Wunknown-warning-option] 1 warning generated. $ echo $? 0 $ echo "int main() { return 0; }" | clang -Werror -Wno-psabi -o /dev/null -x c - error: unknown warning option '-Wno-psabi' [-Werror,-Wunknown-warning-option] $ echo $? 1 This side effect is user visible (aside from the inordinate amount of -Wunknown-warning-option and build failure), as some warnings that are normally disabled like -Waddress-of-packed-member or -Wunused-const-variable show up. Use cc-disable-warning so that it gets disabled for GCC and does nothing for Clang. Fixes: ebcc5928c5d9 ("arm64: Silence gcc warnings about arch ABI drift") Link: https://github.com/ClangBuiltLinux/linux/issues/511 Reported-by: Qian Cai Signed-off-by: Nathan Chancellor --- arch/arm64/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 8fbd583b18e1..e9d2e578cbe6 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -51,7 +51,7 @@ endif KBUILD_CFLAGS += -mgeneral-regs-only $(lseinstr) $(brokengasinst) KBUILD_CFLAGS += -fno-asynchronous-unwind-tables -KBUILD_CFLAGS += -Wno-psabi +KBUILD_CFLAGS += $(call cc-disable-warning, psabi) KBUILD_AFLAGS += $(lseinstr) $(brokengasinst) KBUILD_CFLAGS += $(call cc-option,-mabi=lp64) -- 2.22.0.rc3