Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 704254 - dev-util/perf-5.4.6 fails to build due to -Werror: core.c:12:47: error: unused parameter 'level' [-Werror=unused-parameter]
Summary: dev-util/perf-5.4.6 fails to build due to -Werror: core.c:12:47: error: unuse...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Naohiro Aota
Depends on: 704798
Blocks: werror
  Show dependency tree
Reported: 2019-12-30 11:00 UTC by Sergei Trofimovich (RETIRED)
Modified: 2020-01-06 10:57 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---

dev-util:perf-5.4.6:20191230-105538.log (dev-util:perf-5.4.6:20191230-105538.log,34.18 KB, text/x-log)
2019-12-30 11:00 UTC, Sergei Trofimovich (RETIRED)

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Trofimovich (RETIRED) gentoo-dev 2019-12-30 11:00:14 UTC
Created attachment 601832 [details]

I have a few warnings enabled in CFLAGS:

$ portageq envvar CFLAGS
-march=sandybridge -mtune=sandybridge -maes --param=l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=8192 -O2 -pipe -fdiagnostics-show-option -frecord-gcc-switches -Wall -Wextra -Wstack-protector

Relevant build error:

  x86_64-pc-linux-gnu-gcc -Wp,-MD,./.core.o.d -Wp,-MT,core.o -march=sandybridge -mtune=sandybridge -maes --param=l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=8192 -O2 -pipe -fdiagnostics-show-option -frecord-gcc-switches -Wall -Wextra -Wstack-protector -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Wstrict-aliasing=3 -Wshadow -Werror -Wall -fPIC -I/tmp/portage-tmpdir/portage/dev-util/perf-5.4.6/work/linux-5.4/tools/perf/lib/include -I/tmp/portage-tmpdir/portage/dev-util/perf-5.4.6/work/linux-5.4/tools/lib/ -I/tmp/portage-tmpdir/portage/dev-util/perf-5.4.6/work/linux-5.4/tools/include -I/tmp/portage-tmpdir/portage/dev-util/perf-5.4.6/work/linux-5.4/tools/arch/x86/include/ -I/tmp/portage-tmpdir/portage/dev-util/perf-5.4.6/work/linux-5.4/tools/arch/x86/include/uapi -I/tmp/portage-tmpdir/portage/dev-util/perf-5.4.6/work/linux-5.4/tools/include/uapi -fvisibility=hidden -D"BUILD_STR(s)=#s" -c -o core.o core.c
core.c: In function '__base_pr':
core.c:12:47: error: unused parameter 'level' [-Werror=unused-parameter]
   12 | static int __base_pr(enum libperf_print_level level, const char *format,
      |                      ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
cc1: all warnings being treated as errors

perf-5.3.7 was built fine.
Comment 1 Naohiro Aota gentoo-dev 2020-01-04 02:11:46 UTC
Upstream commit 55542113c690 (perf tools: Propagate CFLAGS to libperf) seems to have the fix for it. I will check and add the part of the commit.
Comment 2 Larry the Git Cow gentoo-dev 2020-01-04 21:41:08 UTC
The bug has been closed via the following commit(s):

commit c6f66627b9238efbddc623de273ab1d5bf4874cd
Author:     Naohiro Aota <>
AuthorDate: 2020-01-04 21:17:53 +0000
Commit:     Naohiro Aota <>
CommitDate: 2020-01-04 21:40:14 +0000

    dev-util/perf: fix build with -Werror
    Apply an upstream patch to fix the issue.
    Signed-off-by: Naohiro Aota <>

 dev-util/perf/Manifest                                 | 2 +-
 dev-util/perf/{perf-5.4.6.ebuild => perf-5.4.7.ebuild} | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
Comment 3 Holger Hoffstätte 2020-01-04 22:31:24 UTC
Looks like you forgot to add & commit the actual patch..
Comment 4 Georgy Yakovlev archtester gentoo-dev 2020-01-05 02:07:42 UTC
patch added
Comment 5 Naohiro Aota gentoo-dev 2020-01-06 10:57:30 UTC
Oops, thanks for adding the patch.