Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp7642115pxu; Fri, 25 Dec 2020 23:34:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJzD2g8my56een//e4Hwnrb5+oT2XLosg1o5/4xBnrROM2vYfrwwVcfaJ/pqAVfTFSb3nP43 X-Received: by 2002:a17:906:2695:: with SMTP id t21mr29005465ejc.287.1608968059398; Fri, 25 Dec 2020 23:34:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608968059; cv=none; d=google.com; s=arc-20160816; b=cJnDgC+Mf/tl1/uAII5bYd3DobdMy36gpiuLtFSPHXIGjNv2qoNrtpAopcJ2fgSGRi 3C+hh839DZgeyVq+Yp66F11XrLQvENEbKnly+b+Z/695bZVtOjMwG0btGorGx7ha9ZU8 SVjAMy1Urnd11ZAFihqMHbIsOs13Ptf/CSd9rR+9Uj914V/0ICRWxZXQmGy0IyZsevtM e7HJbJhdnXObcg4dqR6jpUyAUJl5rP7fM4odJCVmoZPG7FbQ8Qc/BnLQ9j4GasYbtkmK +l7CaImV14F0dFAbMxQE4k4zos+xqkWDmg4gkAhtcjnGnZFkEWr9QiQGz7rRr77LIuU6 QSQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :mime-version:user-agent:date:message-id:subject:from:cc:to :dkim-signature; bh=PzHOmqPammOF2MuNhpTyx66yMY3XUA9xo83g3YEoVpE=; b=kLds2SLSEQeBhLi373QWfBlXchsIa5QkQ8lXiqAwrX4e/9MzIZDEy8XiAkUcxi4aQa 7U0bDyppH3eFDFM1vuHzGB1bNvg9xtA0U1FJtvh6KZcrL539OJ4gk7xz6JRx+G6alxdP XK2gkklpZpFk3C55mv/AMfnDM0cghzeuzkTbhBCNpjJWPcgSPzUawRlwH4+l4R/+bp1E Awc9lvKU/sWou+lWxOrH8wfjBISrJIjYCOWbyFxX6jo7gr1wu+Y+wQ3MCnFnTPo+eTm5 q2RqRw5E7zR2pqe2/z/npBqJISgEw3UEVOmoVzIJEZQ1PeLstj9AbFzjm35WbiSJLQur oViA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iPhcLSaM; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p31si19024478edd.471.2020.12.25.23.33.57; Fri, 25 Dec 2020 23:34:19 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=iPhcLSaM; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726579AbgLZHaQ (ORCPT + 99 others); Sat, 26 Dec 2020 02:30:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725994AbgLZHaQ (ORCPT ); Sat, 26 Dec 2020 02:30:16 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C20BC061757 for ; Fri, 25 Dec 2020 23:29:36 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id f14so3359714pju.4 for ; Fri, 25 Dec 2020 23:29:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=PzHOmqPammOF2MuNhpTyx66yMY3XUA9xo83g3YEoVpE=; b=iPhcLSaMPxQrkQJRsxB6n6dUFL3oxUYvgd19FWdQ0GSm/Ma6uD4D/TFfEJYW+h0TVQ bjGnPLLbaARz00OJPNIAOpVBs5X2COoy1c2g816Om0K8kVgqZShs7l5KGXw7JvmtdNS6 EquNq0EhOeglRQS58PpDWM+92yR4hHkZIkVTygXDQKjgr/sBL1EbAHbP7s6bJmKPK2Jn hbwIrEyKDuoy9EF2KwyqXAWWG/O8ljZHeozyH6W/jD76NLSK3E6u4ojqsiDreZMHP+3w gXKD742XSwpaPhCHAIk+02vQZUt7LUTXzKnjNOHFqaDcvQJ1b5Wjhh8J62vxwzI/2Hoa xh9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=PzHOmqPammOF2MuNhpTyx66yMY3XUA9xo83g3YEoVpE=; b=h6nMC1K49HEqvj1zNUdjAZfxwW9TDZTZIGVWgoxPNecVWIa0o1rS6lG37m1ip6fUAy deSJOMLCq1ync/qB5Xv+UpNeunizSzJ66xz3hZXOrcL3pgtEZq9sj03nST4/LbpgFpan IcCVZdJmuI7BKvOAbuHrroZrN5r5X2zn86XJ0UFhq5QDqyopZR4eBX2pqEPzBAxgdach Xyx9OsQZnKO65bNbEMwAo8dRvUHHr4LuWchPawEn1/G+h3yP6gjkWo9IdC4Qxf2yV1CB v1BvTkI48KHA73em2HtCS//aeeD9scI4J01xBjQLxvITGWleQEXMtGYyYXrFRJ1O3GC4 iPEA== X-Gm-Message-State: AOAM530fmcP5t7B6XBSPcqNf/F3RMBo6e8rAJHOXSF9eJKqWetySp0ME dCgK60DvRgMfH/AldOXaehY= X-Received: by 2002:a17:90a:e507:: with SMTP id t7mr11740247pjy.26.1608967775790; Fri, 25 Dec 2020 23:29:35 -0800 (PST) Received: from macbook.local (ae142046.dynamic.ppp.asahi-net.or.jp. [14.3.142.46]) by smtp.gmail.com with ESMTPSA id 84sm30959306pfy.9.2020.12.25.23.29.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Dec 2020 23:29:35 -0800 (PST) To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: clang-built-linux@googlegroups.com, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , John Millikin From: John Millikin Subject: [PATCH] arch/x86: Propagate $(CLANG_FLAGS) to $(REALMODE_FLAGS) Message-ID: Date: Sat, 26 Dec 2020 16:29:30 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When compiling with Clang, the `$(CLANG_FLAGS)' variable contains additional flags needed to cross-compile C and Assembly sources: * `-no-integrated-as' tells clang to assemble with GNU Assembler   instead of its built-in LLVM assembler. This flag is set by default   unless `LLVM_IAS=1' is set, because the LLVM assembler can't yet   parse certain GNU extensions. * `--target' sets the target architecture when cross-compiling. This   flag must be set for both compilation and assembly (`KBUILD_AFLAGS')   to support architecture-specific assembler directives. Signed-off-by: John Millikin ---  arch/x86/Makefile | 5 +++++  1 file changed, 5 insertions(+) diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 7116da3980be..725c65532482 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -33,6 +33,11 @@ REALMODE_CFLAGS += -ffreestanding  REALMODE_CFLAGS += -fno-stack-protector  REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -Wno-address-of-packed-member)  REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), $(cc_stack_align4)) + +ifdef CONFIG_CC_IS_CLANG +REALMODE_CFLAGS += $(CLANG_FLAGS) +endif +  export REALMODE_CFLAGS    # BITS is used as extension for files which are available in a 32 bit -- 2.29.2