lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250611092542.F4ooE2FL@linutronix.de>
Date: Wed, 11 Jun 2025 11:25:42 +0200
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Namhyung Kim <namhyung@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
	acme@...nel.org
Subject: Re: [BUG] perf tools: Build failure in v6.16-rc1

On 2025-06-10 11:34:44 [-0700], Namhyung Kim wrote:
> Hello,
Hi,

> I've updated the perf-tools-next to v6.16-rc1 and found a build error
> like below on alpine linux 3.18.
> 
>   In file included from bench/futex.c:6:
>   /usr/include/sys/prctl.h:88:8: error: redefinition of 'struct prctl_mm_map'
>      88 | struct prctl_mm_map {
>         |        ^~~~~~~~~~~~
>   In file included from bench/futex.c:5:
>   /linux/tools/include/uapi/linux/prctl.h:134:8: note: originally defined here
>     134 | struct prctl_mm_map {
>         |        ^~~~~~~~~~~~
>   make[4]: *** [/linux/tools/build/Makefile.build:86: /build/bench/futex.o] Error 1
> 
> git bisect says it's the first commit introduced the failure.

Hmm. So your /usr/include/sys/prctl.h and
/linux/tools/include/uapi/linux/prctl.h both provide struct
prctl_mm_map but their include guard must be different.

My /usr/include/sys/prctl.h is provided by glibc and contains the
prctl() declaration. It includes also linux/prctl.h.
The tools/include/uapi/linux/prctl.h is the same as
/usr/include/linux/prctl.h.

The /usr/include/sys/prctl.h on alpine linux is different. This is
probably coming from musl. It contains the PR_* definition and the
prctl() declaration. So it clashes here because now the one struct is
available twice.

The man page for prctl(2) says:
|       #include <linux/prctl.h>  /* Definition of PR_* constants */
|       #include <sys/prctl.h>

so musl doesn't follow this.

To align with the other builds, I guess the following help:

diff --git a/tools/perf/bench/futex.c b/tools/perf/bench/futex.c
index 26382e4d8d4ce..540261f299b1d 100644
--- a/tools/perf/bench/futex.c
+++ b/tools/perf/bench/futex.c
@@ -2,7 +2,6 @@
 #include <err.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <linux/prctl.h>
 #include <sys/prctl.h>
 
 #include "futex.h"

Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ