From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932676AbbI3Moh (ORCPT ); Wed, 30 Sep 2015 08:44:37 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:41358 "EHLO e06smtp13.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932480AbbI3Moc (ORCPT ); Wed, 30 Sep 2015 08:44:32 -0400 X-IBM-Helo: d06dlp03.portsmouth.uk.ibm.com X-IBM-MailFrom: dingel@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Date: Wed, 30 Sep 2015 14:44:22 +0200 From: Dominik Dingel To: linux-kernel@vger.kernel.org, Stephane Eranian , Arnaldo Carvalho de Melo Subject: perf: Link error on non x86 with sample_reg_masks Message-ID: <20150930144422.46eccb53@BR9TG4T3.de.ibm.com> Organization: IBM X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15093012-0013-0000-0000-000005970A18 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Greetings, With 4.3-rc3 during the build of perf (on s390) I get following error: libperf.a(libperf-in.o): In function `parse_regs': /home/dingel/GIT/linux/tools/perf/util/parse-regs-options.c:28: undefined reference to `sample_reg_masks' /home/dingel/GIT/linux/tools/perf/util/parse-regs-options.c:45: undefined reference to `sample_reg_masks' /home/dingel/GIT/linux/tools/perf/util/parse-regs-options.c:38: undefined reference to `sample_reg_masks' collect2: error: ld returned 1 exit status Makefile.perf:306: recipe for target 'perf' failed make[1]: *** [perf] Error 1 Makefile:68: recipe for target 'all' failed make: *** [all] Error 2 By doing the same thing, as: commit af4aeadd8c04303c0aa2d112145c3627e2ebd026 Author: Stephane Eranian Date: Tue Sep 1 11:30:14 2015 +0200 perf tools: Fix link time error with sample_reg_masks on non x86 does: --- a/tools/perf/util/parse-regs-options.c +++ b/tools/perf/util/parse-regs-options.c @@ -4,6 +4,10 @@ #include "util/parse-options.h" #include "util/parse-regs-options.h" +const struct sample_reg __weak sample_reg_masks[] = { + SMPL_REG_END +}; + I was able to fix the problem, but is it the right thing to do? Thanks, Dominik