Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2853410ima; Mon, 22 Oct 2018 17:48:11 -0700 (PDT) X-Google-Smtp-Source: ACcGV62/Oj5Nngh8rkRZooP1O9z4gC7XIw9TH3WOtRHb3XhjJ67HztmKkyz3jj7ftDgQJ21rkuaX X-Received: by 2002:a63:a902:: with SMTP id u2-v6mr45048189pge.207.1540255691843; Mon, 22 Oct 2018 17:48:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540255691; cv=none; d=google.com; s=arc-20160816; b=vqpzOPfAmx/8bL7rpKLzwkQ3VhSdK4qY2MoMNjSnH3XD2a7aLC6ug2MWpFwFJei3rp qyN7IhZp9KPL5C/zcG+m8tJ0IQxgJqUF8wW9Q68TKORI8ELnEA4Jp89WCtMjG75NblFk H/7nwkJ0m9YLQqoTu4V0WfgObeQiukOlyMMHDNzKPhwzvBJi2eaUdT0cBXQkqXEUpQsa BZdYldGZ3d6sIFKbZLeod0kvwJSFa5D7O9ubBmpFjswu7LKJRzbaTfYEc0pEpJgYZ2Gl S4s5g/ZKpSw53jnix1iJqaCPH/YUSH0iRyTjkzE63c7+Fjt5EDkIj4Z3Sg09vYwv5zKq 5meQ== 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=aGCpIF7CviiST/QOdxQ5gL9es39WZiaffX36WFY2hZ4=; b=MIwMkWbODK/fTEVvsrbI1CfmI79q7YZMTQCfXNe7Q8apTht7oO6FZdnOjFovTayG8e cUy890oBPKrOzhiD976HNqR9LDgoT1athWozB+DOKfyrL0kfHIYp3NvzDJVO6R2Av6el 1eKU9skN6YBNZ7fFyIdauneyF2H5TCYRWkLYQfd+hfuAKzBKbb+M/Hz14EXIAJXA90yB rXgbEKCo5DGtHsl5st9nMk7KzoECh67j2cyCapDlsdzRFz7fHi4plbE6vmuxt2oKV5DT 9Ru0JxjuTXgol48S19QNP800C3DwOIFQ8NgW78J5weG5fL/ZnLtW97i897YCMrZr125M ocJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZeLVqzax; 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 b4-v6si36521754pfg.90.2018.10.22.17.47.56; Mon, 22 Oct 2018 17:48:11 -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=ZeLVqzax; 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 S1727090AbeJWJIa (ORCPT + 99 others); Tue, 23 Oct 2018 05:08:30 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:55613 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725768AbeJWJI3 (ORCPT ); Tue, 23 Oct 2018 05:08:29 -0400 Received: by mail-wm1-f68.google.com with SMTP id x6-v6so706989wmc.5 for ; Mon, 22 Oct 2018 17:47:34 -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=aGCpIF7CviiST/QOdxQ5gL9es39WZiaffX36WFY2hZ4=; b=ZeLVqzaxrJd96dmqGeJUe4iBQiY7L+SN/poVNJln5dgy62U3z0f/oqcrU2aYmXkSn4 NzR5w1luZKuCmPgj8RNmt70o6qP4FamVJBiCPEge5TLRk9HcIXRGCRNKST89/YPqBQ3U Zhr6wi9DFGVqNU0p7IuvmcSQH6mCjMj2oizwKV1dEx4LZi5oQFVFyMuenqgu+cKwHXjj IiHVBdbnsT4lt9mx4gBuCi1leRgRylyQmXCa5likk/UV45MoU1snIeA9MRvGBlMTcPlb 1sS205IwmP3/Uji7Bm0dnZ9awQpvakIkoVx7x9ZCMyBb5ttBO6nFYuhgIwH4ozINV81J bMDQ== 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=aGCpIF7CviiST/QOdxQ5gL9es39WZiaffX36WFY2hZ4=; b=mDBxYyi1UAwoxfHCaUuZ7x2TcfVp+MVAmRY3GDJRjbrqgcO++bHi94U3vyllnqsXSe raZC/MFl/Zbx8jwgFctU0PnctCCV/lToodmPtLZdHgbC2bq0LFb6wowsISVe1eSk0ID/ 6HBYz0VC14vklab2Dw2NcD6Q2PawPspJGlQZQXeRzgJi9qbh6m128hnkTBOJGqMjp+5G Qf1p81C6dxKJJwIAMoDrzso7c7z53hNoSO6YV8KcilINlrW41827KgCamHYL5x6oMo8o Moyj5p8O1YyCToxalMbDOkX4PPYTYBTGLwT71sRvV8+goACNh7mS0xTzCuO/e3s9e25G WbFw== X-Gm-Message-State: ABuFfohmcFNEuS5oUOo+7KVc1SKpwJ30OSInq40RzoSJf5CSbflFFTxx gaTQ842nwhi0g8mlRYRLA88= X-Received: by 2002:a1c:1694:: with SMTP id 142-v6mr18366094wmw.113.1540255653625; Mon, 22 Oct 2018 17:47:33 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id v184-v6sm9788275wme.3.2018.10.22.17.47.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 17:47:32 -0700 (PDT) From: Nathan Chancellor To: Thomas Gleixner , Ingo Molnar , Borislav Petkov Cc: "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, Nadav Amit , Kees Cook , Masahiro Yamada , Nick Desaulniers , Nathan Chancellor Subject: [PATCH RFC] x86: Don't include '-Wa,-' when building with Clang Date: Mon, 22 Oct 2018 17:37:26 -0700 Message-Id: <20181023003725.21463-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 77b0bf55bc67 ("kbuild/Makefile: Prepare for using macros in inline assembly code to work around asm() related GCC inlining bugs") added this flag to KBUILD_CFLAGS, where it works perfectly fine with GCC. However, when building with Clang, all of the object files compile fine but the build hangs indefinitely at init/main.o, right before the linking stage. Don't include this flag when building with Clang. The kernel builds and boots to a shell in QEMU with both GCC and Clang with this patch applied. Link: https://github.com/ClangBuiltLinux/linux/issues/213 Signed-off-by: Nathan Chancellor --- The reason this patch is labeled RFC is while I can verify that this fixes the issue, I'm not entirely sure why the '-Wa,-' works for GCC and not Clang. I looked into what the flag means and I couldn't really find anything so I just assume it's taking input from stdin? The issue could stem from how GCC forks gas versus how Clang does it. If this isn't of concern and the maintainers are happy with this patch as is, feel free to take it. arch/x86/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 5b562e464009..4736dcc1caec 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -239,7 +239,10 @@ archheaders: archmacros: $(Q)$(MAKE) $(build)=arch/x86/kernel arch/x86/kernel/macros.s -ASM_MACRO_FLAGS = -Wa,arch/x86/kernel/macros.s -Wa,- +ASM_MACRO_FLAGS = -Wa,arch/x86/kernel/macros.s +ifneq ($(cc-name),clang) +ASM_MACRO_FLAGS += -Wa,- +endif export ASM_MACRO_FLAGS KBUILD_CFLAGS += $(ASM_MACRO_FLAGS) -- 2.19.1