Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752530AbdLHKBJ (ORCPT ); Fri, 8 Dec 2017 05:01:09 -0500 Received: from mail-qt0-f193.google.com ([209.85.216.193]:45445 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753917AbdLHJ5V (ORCPT ); Fri, 8 Dec 2017 04:57:21 -0500 X-Google-Smtp-Source: AGs4zMb9ltI8NIRxLEL1T2w31QYWvS6Ynnsn/qn/UKdrDI/xBYcD8Qt+7mdqZH1+SkBs7gEmtWT9kKKdzYjpP3bpb5g= MIME-Version: 1.0 In-Reply-To: <5edaedc3-17e4-2aff-2cda-f00351e1498c@zytor.com> References: <20171207224154.4687-1-adobriyan@gmail.com> <5edaedc3-17e4-2aff-2cda-f00351e1498c@zytor.com> From: Alexey Dobriyan Date: Fri, 8 Dec 2017 11:57:20 +0200 Message-ID: Subject: Re: [PATCH v0 1/5] x86_64: march=native support To: "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, x86@kernel.org, tglx@linutronix.de, mingo@redhat.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1028 Lines: 25 On 12/8/17, H. Peter Anvin wrote: > One more thing: you HAVE to make > arch/x86/include/asm/required-features.h aware of any features that the > kernel unconditionally depend on. Yes, this is foolprof part I have to think through. > Again, using the gcc cpp macros that reflect what bits gcc itself > broadcast. However, this is perhaps where CONFIG flags become > important, since required-features.h has to be able to be compiled in > the bootcode environment, which is different from the normal kernel > compiler environment. > > We could, however, automagically generate a reflection of these as a > header file: > > echo '#ifndef __LINUX_CC_DEFINES__' > echo '#define __LINUX_CC_DEFINES__' > $(CC) $(c_flags) -x c -E -Wp,-dM /dev/null | sort | \ > sed -nr -e 's/^#define __([^[:space]]+)__$/#define __KERNEL_CC_\1/p' > echo '#endif A lot of then aren't interesting and duplicate each other. Another thing: clang. It detects machine I'm typing this as __corei7__ while gcc does it as __core_avx2__.