Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2489402imm; Thu, 27 Sep 2018 13:49:04 -0700 (PDT) X-Google-Smtp-Source: ACcGV60CgECjixR1cbydf3drDIjZX+rngFX9VvF+qNn3u4+yvQwh1gNSmHUH9Dl12HKqv72IwKJu X-Received: by 2002:a65:66c9:: with SMTP id c9-v6mr8725984pgw.55.1538081344138; Thu, 27 Sep 2018 13:49:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538081344; cv=none; d=google.com; s=arc-20160816; b=atiOFmn/BXYrY42jsj0e4yqYvvB3GTECLvQnBACbvonMF/nhcIpAvg+PYU+R36GxWK HXZZjnNjbfsBaGjCxalRaA6btnkIq1pClqtt6lYHtaZkItJReBIhL5R4/KTyH25I/zDG GC2IbJSr9jvH/vydDsY+lXPumcsWvc8828EG0GcyQVbwMG+gGodfv1ZUy/S8Yfe1c85M +pSYGmt8HitUFrsk7Pa7YTLzjiWG+fpOp9xYTa+loerRMWsS1145aZR4jh/uDRcJPM3G jDaOVzQ7m/LEFVDmdos2xkcEvvcTB6U+Ajwt9j3aikZ2aBC2+FwyjhTcMwn8pnKSqiyS vlUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=ELeHpNLN3fEYycvF2r1VryQWixx5CGAZIMwHEWZKhKQ=; b=wX87ap8KoPon7qFgMoQVDm2Xy6xXmFIChvw4gLF7WVSWo0VzfLhl5BnZrwt9SK85h+ dEGvusnFH6tbZyL3npu0gu1BmNfCmEfErszfbNTbD3lzkTTOfGY00KcnhXQqp8GIFXd3 4hHKGKRHLfmntAts+6syN+gnpBsV8IGvav4r3WZDcYHnJbfKg1E+WWbbO7FTa/hTMbpv Yj/R3F3zQQSOw86pQj8Zjix0/uu8MoLRwt2joKD96BZpJZknpLi8qNLMBpbyZzEZOo4N 0rBOw+F5DJYitUZvfpdIQ2cb6NdxxUfjAr7cvPQTaBPNd3k6kCLRuNi8JgTKci8q02BG Sy3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=nIimAQsf; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2-v6si2643910plo.412.2018.09.27.13.48.48; Thu, 27 Sep 2018 13:49:04 -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=@google.com header.s=20161025 header.b=nIimAQsf; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727520AbeI1DIY (ORCPT + 99 others); Thu, 27 Sep 2018 23:08:24 -0400 Received: from mail-it1-f201.google.com ([209.85.166.201]:56532 "EHLO mail-it1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727294AbeI1DIY (ORCPT ); Thu, 27 Sep 2018 23:08:24 -0400 Received: by mail-it1-f201.google.com with SMTP id i188-v6so159430itf.6 for ; Thu, 27 Sep 2018 13:48:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=ELeHpNLN3fEYycvF2r1VryQWixx5CGAZIMwHEWZKhKQ=; b=nIimAQsfGznz9Mll9zTy0Vp9Ss9P8BSMjQHNbRFTdBUJpsp2Rsw6N+i396SHQ47uRM NHkvvIJdPKoPk+CNL0ARSK6mqZ8Lh91ajeSBiZxoLAGWmKir9RmcSPjWuDRAISN7OgpP 6mFbWpeMgHicvlA0yjTsYeD9pBJ+Pm9LO+ZQmAjE4/dM6p3S3GbCrJNsF+2SscZWzyOf RbX6ysMeht0SdOJcbqlV5InA62J6cotrkIYjNdCHVGSb57YYUroqGvAFqlJ8MokRKrEc 5JFrybuOFdyhatAHdH4rLZfdKGn0gIzGREgb63yuGcljqYeDroIzwE5/PoFECN3jn+gI XleQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=ELeHpNLN3fEYycvF2r1VryQWixx5CGAZIMwHEWZKhKQ=; b=sUfayjOmL8qXRLoLf3tUKccysE4G4u74w1stVmkEOQASr7lhrvvkQpnlWdllt+l7Z3 KLSmzx8QAhVZSeh4fL9/E0VA9P2A5ilFjPDKpKBBaze2BwbQxX00ziICc4oZwG5BxW2q ztvzPe97gIZHCZQ4BWEluDGdAbXqCha3b0UZW5Y30eeS3RKQ1mALAFnxDIYaXsBvuBMd 97atHPJSWSsqqp+dM+36VvWIA6JDRqNkddhgxRQSjeZ21ZpSrPS22QYwYDWbjzOSi6YO eO3mYwocy20QEEyur7qw/psH83zUra68vgRrFuFO/oDApsMJbsNEkOsM58N5YG/8AQQX carg== X-Gm-Message-State: ABuFfoikA6+hH0/CZtht6WSeELf44un19RVarie6R8Nm3QDGQAQi8+q5 zFAUy4WBJRS2pKgbjXEAduMIzsRq7xAG+3cpdXE= X-Received: by 2002:a24:7991:: with SMTP id z139-v6mr245880itc.2.1538081295535; Thu, 27 Sep 2018 13:48:15 -0700 (PDT) Date: Thu, 27 Sep 2018 13:47:58 -0700 Message-Id: <20180927204800.32210-1-ndesaulniers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog Subject: [PATCH v2] x86/boot: define CC_HAVE_ASM_GOTO From: ndesaulniers@google.com To: bp@alien8.de, mingo@redhat.com, tglx@linutronix.de Cc: Nick Desaulniers , "H. Peter Anvin" , x86@kernel.org, "Kirill A. Shutemov" , Masahiro Yamada , Greg Kroah-Hartman , Matthias Kaehlcke , Kees Cook , Cao jin , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Early prototypes of Clang with asm goto support produce 6 instances of the following warning: In file included from arch/x86/boot/compressed/misc.h:20: In file included from ./include/linux/elf.h:5: In file included from ./arch/x86/include/asm/elf.h:8: In file included from ./include/linux/thread_info.h:38: In file included from ./arch/x86/include/asm/thread_info.h:53: ./arch/x86/include/asm/cpufeature.h:150:2: warning: "Compiler lacks ASM_GOTO support. Add -D __BPF_TRACING__ to your compiler arguments" [-W#warnings] your compiler arguments" ^ Since 6 files under arch/x86/boot/compressed/ include arch/x86/boot/compressed/misc.h AND arch/x86/boot/compressed/Makefile happens to redefine KBUILD_CFLAGS, which set these variables in the top level MAKEFILE. Suggested-by: Borislav Petkov Signed-off-by: Nick Desaulniers --- v1 -> v2: Updated commit message to provide more context as per Borislav. arch/x86/boot/compressed/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index 28764dacf018..158c0b4e178a 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -56,6 +56,13 @@ KBUILD_LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \ endif LDFLAGS_vmlinux := -T +# check for 'asm goto' +ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y) + CC_HAVE_ASM_GOTO := 1 + KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO + KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO +endif + hostprogs-y := mkpiggy HOST_EXTRACFLAGS += -I$(srctree)/tools/include -- 2.19.0.605.g01d371f741-goog