From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753565AbbIQGb0 (ORCPT ); Thu, 17 Sep 2015 02:31:26 -0400 Received: from mga14.intel.com ([192.55.52.115]:12349 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752696AbbIQGbY (ORCPT ); Thu, 17 Sep 2015 02:31:24 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,544,1437462000"; d="scan'208";a="807009139" Subject: =?UTF-8?Q?Re:_Linux_4.3-rc1_build_error_with_older_elfutils_=22util?= =?UTF-8?Q?/symbol-elf.c:41:5:_error:_no_previous_prototype_for_=e2=80=98elf?= =?UTF-8?B?X2dldHBoZHJudW3igJki?= To: Vinson Lee , Arnaldo Carvalho de Melo References: Cc: Peter Zijlstra , Ingo Molnar , Namhyung Kim , Jiri Olsa , "Naveen N. Rao" , Srikar Dronamraju , Wang Nan , Victor Kamensky , LKML , linux-perf-users@vger.kernel.org From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <55FA5D8F.6000502@intel.com> Date: Thu, 17 Sep 2015 09:28:31 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/09/15 01:10, Vinson Lee wrote: > With Linux 4.3-rc1 I get a perf build error using toolchains with > older elfutils. > > The following build error occurs on both CentOS 5.11 (elfutils 0.137) > and Ubuntu 10.04.4 (elfutils 0.143). > > CC util/symbol-elf.o > cc1: warnings being treated as errors > util/symbol-elf.c:41: error: no previous prototype for ‘elf_getphdrnum’ commit f785f2357673d520a0b7b468973cdd197f336494 removed the 'static' qualifier, presumably because there are cases where the prototype is in the header but the function is not in the library. AFAICT gcc accepts multiple prototypes so long as they are the same so just adding the prototype should be ok i.e. diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 53bb5f59ec58..d9abb0307cc5 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -38,6 +38,7 @@ static inline char *bfd_demangle(void __maybe_unused *v, #endif #ifndef HAVE_ELF_GETPHDRNUM_SUPPORT +int elf_getphdrnum(Elf *elf, size_t *dst); int elf_getphdrnum(Elf *elf, size_t *dst) { GElf_Ehdr gehdr;