Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2297614pxu; Mon, 7 Dec 2020 02:57:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJyruXnkXBeiN0fxEs1zzRqzKD1ZFrG30hYlq1r6iLsp3yjepF7BZMVkb03NEIXPJxiz1KwP X-Received: by 2002:a50:d4cd:: with SMTP id e13mr19373759edj.117.1607338653716; Mon, 07 Dec 2020 02:57:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607338653; cv=none; d=google.com; s=arc-20160816; b=k3v4RoIpsh0j5aqZPeyvP5HR7D8A7QO33ZsloZQKeDoGNZLv2/JKj6bryITxlW0EKr OKY8iedEWruL70bdsDmNNKLj4pmT55fJmnunqF6aMySI4YulLohw7ACeMF4WdCVRcVwo iMkTaDVOwab1dO4Mx2GXwurWLgph+rXOGdKBMW4CzzJ0amwFCwQ2mOWzuKXM16+M9od+ juqzbOrbOWszPz95Fpf1wj+swYEnQ88osz2JiiLf8X0GBYbmh4Y+m+NYFD1qodtUj56Q 2HbeO14O810ozP9l8Dtgjy8CZ2RcHc4FOE1EQclZukihpoz30M6hSQCyVZb57BKzIs03 +IvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from :dkim-signature:date; bh=S9X5GV2FeKLTAc+cX1+Hlb+/nDIJxJPjJIOOH+1cfiU=; b=WABBdmEeCgrcS0sYN1hu+IdFRBdhdc8lLnsRrsHd6+VHpjfSHG0Kj5YVk/1ENL8kMB sff6NmAZUU61v0GkMa8BwY3jAK1CaGoMlFirp5Qv+/6CTq4HPEuKWpApEeeXYgwDVI4a Fd6+H29cowZssXk6LVdj8LyTmyrSpBJ0BDR6yM27mNBatVCWgtLkHmwh6fHFDKBVTbXN 88LNhInnHkdf5QXGxE7JgGPxqS0zGeosHbFsDfgHRRk7QuAxDUupUnqo2KzhHtV/6QNk tGt5MGJB+Pxm3/dOIKQGKkLy6W2jOGt1gEWxeIavAZy4W/VkdBCtUSutEqdE+u8sG9t2 oEWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WwNHFxC2; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t1si7886463edy.153.2020.12.07.02.57.11; Mon, 07 Dec 2020 02:57:33 -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=@kernel.org header.s=k20201202 header.b=WwNHFxC2; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726471AbgLGKys (ORCPT + 99 others); Mon, 7 Dec 2020 05:54:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:40116 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725842AbgLGKyr (ORCPT ); Mon, 7 Dec 2020 05:54:47 -0500 Date: Mon, 7 Dec 2020 10:53:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607338446; bh=1oou2RFP/SKwiJkBvHYPfbfrjSBKYsSmyIsovvwhrcQ=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=WwNHFxC2ppcoTe2xqpFwZMHqqkbdNDlPaUPPsivySCHE1x7htTD8AezIRtMQC8Xqk mx0rbCRLYPCgemajWzSjJsI5v8lddp1pxLoTa1PPGDLjqUnEAFDqlzrq2HNoH+mE3s z9kTKLRHQfX8hR0X0CfYVmp/t86IiNLY1J2nyeCX4CbAtO+RimMSrSEzVnNEv4iZ0o L4CHOd+T2hsh2IfiYkwidgvJdbT68AOvTVFUDEKoCutxEQUQTLBMMlLkxl9BAl/zVG OjfZB52wRaGT6MU2BuhtqGu/zDT2SXAgXJm4LwC+bSBDv8Vt2Os5jcrlc6IRHR6wYJ XgfdP8PJlp6cg== From: Will Deacon To: Chanho Park Cc: mathieu.poirier@linaro.org, suzuki.poulose@arm.com, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Chanho Park , Mike Leach , Leo Yan , John Garry , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Jiri Olsa , Namhyung Kim , Khem Raj Subject: Re: [PATCH] perf arm pmu: fix build error on MUSL libc Message-ID: <20201207105359.GA4198@willie-the-truck> References: <20201206144527.1670483-1-chanho61.park@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201206144527.1670483-1-chanho61.park@samsung.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 06, 2020 at 11:45:27PM +0900, Chanho Park wrote: > __always_inline can cause build error on musl libc. The fix patch has > submitted but not merged yet[1]. To build perf tool with musl libc, > inclusion is necessary and it should be included before > perf_event.h. > > from /usr/include/linux/byteorder/little_endian.h:13, > from /usr/include/asm/byteorder.h:23, > from tools/include/uapi/linux/perf_event.h:20, > from arch/arm64/util/../../arm/util/pmu.c:9: > > /usr/include/linux/swab.h:171:8: error: unknown type name '__always_inline' > 171 | static __always_inline __u16 __swab16p(const __u16 *p) > | ^~~~~~~~~~~~~~~ > > [1]: https://lkml.org/lkml/2018/9/13/78 > Cc: Mathieu Poirier > Cc: Suzuki K Poulose > Cc: Mike Leach > Cc: Leo Yan > Cc: John Garry > Cc: Will Deacon > Cc: Peter Zijlstra > Cc: Ingo Molnar > Cc: Arnaldo Carvalho de Melo > Cc: Mark Rutland > Cc: Jiri Olsa > Cc: Namhyung Kim > Cc: Khem Raj > Signed-off-by: Chanho Park > --- > tools/perf/arch/arm/util/pmu.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/tools/perf/arch/arm/util/pmu.c b/tools/perf/arch/arm/util/pmu.c > index bbc297a7e2e3..4c0357e8c0ab 100644 > --- a/tools/perf/arch/arm/util/pmu.c > +++ b/tools/perf/arch/arm/util/pmu.c > @@ -6,6 +6,9 @@ > > #include > #include > +#if !defined(__GLIBC__) > +#include > +#endif Looks like other files just include this unconditionally, but have a comment explaining why. See util/branch.h and util/event.h. Maybe we should do the same for util/pmu.h, which is already included here? Will