Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp2147982rwa; Mon, 22 Aug 2022 03:03:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR5OSR4L3pq3lQTPjg67lL+vleeWDTVuwe9xBPgZHX8jTQgGyVOD6JxZdTF13Arog4eENe1c X-Received: by 2002:a17:907:9806:b0:739:99c:7732 with SMTP id ji6-20020a170907980600b00739099c7732mr12618434ejc.508.1661162601382; Mon, 22 Aug 2022 03:03:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661162601; cv=none; d=google.com; s=arc-20160816; b=B6GmSH7H7DC4kIM1BGBtxsk+pEmyZzjHxQtrgH3c7TJ86sgtVnYH5/VQDRGh6FU+XV sWL2Lb49yWduC1RrktjDLQeCAG7RX6jfR5sQX5z1MK9dSVjRs6CbilcFRkkVbf63B/EO tGqLR5NTndEIb6vQ2fFWqYxE7uRkUJup8xsbIaklpxzlC2n2TdKYJYvQd+6oW9WcYBTX 6Gjc9ynGwyOxSotofmn1NXphATMtMxB0gb2OMl5D7HJCShSWFRVCEMVQHl0eMw+cDQBt Z/GOLIS7rXxU4Fwr4ZQ2c2TXQT1yUaVG6etqPWQ8P+PZBFzkdGWeh2ETOO1dys6EImbN k3tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from; bh=n9BqBxhxvx0KWH1Cmog+yceW/GlKa0h7UkwhiwdCRk4=; b=qmipk982cYMpOiyR4pjCVyTEEbgrkFdRCSuar2c12BkdszstTSwHdzCCmBRvTQLjv8 JqIiMEfGAE1LFFGT59ActRJLj+oocyeWg9A4FdmvaKDvMa7ucNS3184V1tpIA6qA9Lao JOps7+OMRjgf6twwKfOUFenVmlBJUnBqJoMRcca4C0SQ5fYltY3ReIQiXMJxU3E6DU4D q+KSlnL9010K+joxYsHY94bUPyikr4WAOJtsfdlajk7C/CqprankLOtcPsKlaOSTC1kb f3NRn0NlEJH0FyD2ZcPu+tkaJEXPWeJCdA7bK86j9IfeBbWj+Dn8e5OT8+sxJdJcExng jp8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i1-20020a05640242c100b0043e8006a816si10833452edc.30.2022.08.22.03.02.56; Mon, 22 Aug 2022 03:03:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234418AbiHVJ30 (ORCPT + 99 others); Mon, 22 Aug 2022 05:29:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229565AbiHVJ3Y (ORCPT ); Mon, 22 Aug 2022 05:29:24 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53B8F1CB36; Mon, 22 Aug 2022 02:29:22 -0700 (PDT) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MB6Rj0qsBzlWWC; Mon, 22 Aug 2022 17:26:09 +0800 (CST) Received: from kwepemm600003.china.huawei.com (7.193.23.202) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 22 Aug 2022 17:29:06 +0800 Received: from ubuntu1804.huawei.com (10.67.174.61) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 22 Aug 2022 17:29:05 +0800 From: Yang Jihong To: , , , , , , , , , Subject: [PATCH] perf tools: Fix compile error for x86 Date: Mon, 22 Aug 2022 17:25:57 +0800 Message-ID: <20220822092557.210209-1-yangjihong1@huawei.com> X-Mailer: git-send-email 2.30.GIT MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.174.61] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit a0a12c3ed057 ("asm goto: eradicate CC_HAS_ASM_GOTO") eradicates CC_HAS_ASM_GOTO, perf on x86 call asm_volatile_goto when compiling __GEN_RMWcc. However, asm_volatile_goto is not declared, which causes compilation error: In file included from /home/linux/tools/include/asm/../../arch/x86/include/asm/atomic.h:7, from /home/linux/tools/include/asm/atomic.h:6, from /home/linux/tools/include/linux/atomic.h:5, from /home/linux/tools/include/linux/refcount.h:41, from /home/linux/tools/lib/perf/include/internal/cpumap.h:5, from /home/linux/tools/perf/util/cpumap.h:7, from /home/linux/tools/perf/util/env.h:7, from /home/linux/tools/perf/util/header.h:12, from pmu-events/pmu-events.c:9: /home/linux/tools/include/asm/../../arch/x86/include/asm/atomic.h: In function ‘atomic_dec_and_test’: /home/linux/tools/include/asm/../../arch/x86/include/asm/rmwcc.h:7:2: error: implicit declaration of function ‘asm_volatile_goto’ [-Werror=implicit-function-declaration] asm_volatile_goto (fullop "; j" cc " %l[cc_label]" \ ^~~~~~~~~~~~~~~~~ Solution: Define asm_volatile_goto in compiler_types.h if not declared. Currently, only x86 architecture uses asm_volatile_goto. Theoretically, this patch affects only the x86 architecture. Fixes: a0a12c3ed057 ("asm goto: eradicate CC_HAS_ASM_GOTO") Signed-off-by: Yang Jihong --- tools/include/linux/compiler_types.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/include/linux/compiler_types.h b/tools/include/linux/compiler_types.h index 24ae3054f304..1bdd834bdd57 100644 --- a/tools/include/linux/compiler_types.h +++ b/tools/include/linux/compiler_types.h @@ -36,4 +36,8 @@ #include #endif +#ifndef asm_volatile_goto +#define asm_volatile_goto(x...) asm goto(x) +#endif + #endif /* __LINUX_COMPILER_TYPES_H */ -- 2.30.GIT