Linux Perf Users
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: linux-perf-users@vger.kernel.org,
	Adrian Hunter <adrian.hunter@intel.com>,
	Ian Rogers <irogers@google.com>,
	James Clark <james.clark@linaro.org>,
	Jiri Olsa <jolsa@kernel.org>,
	Dmitrii Dolgov <9erthalion6@gmail.com>
Subject: Re: [PATCH 1/1] perf test workload: Use unsigned int in code_with_type instead of uint
Date: Fri, 25 Sep 2026 08:41:22 -0700	[thread overview]
Message-ID: <araWImOoVxsvDGrz@z2> (raw)
In-Reply-To: <araUAt-S6YM_bbAf@x2>

On Fri, Sep 25, 2026 at 05:32:18PM +0200, Arnaldo Carvalho de Melo wrote:
> The declaration of the Rust helper test_rs() uses "uint", a BSD-ism
> that lives in <sys/types.h>, so on glibc it is only visible by
> accident: glibc's <stdlib.h> includes <sys/types.h>, where uint is
> exposed under __USE_MISC, which is on by default.
> 
> musl does none of that: its <stdlib.h> doesn't include <sys/types.h>
> and it typedefs uint there only when _GNU_SOURCE/_BSD_SOURCE is
> defined, while nothing else in this translation unit includes
> <sys/types.h>. Building it on Alpine therefore fails with:
> 
>   tests/workloads/code_with_type.c:9:21: error: unknown type name 'uint'; did you mean 'int'?
>   tests/workloads/code_with_type.c:39:17: error: implicit declaration of function 'test_rs' [-Wimplicit-function-declaration]
> 
> The second error is a consequence of the first one: with the
> declaration at line 9 rejected, the call at line 39 has no prototype,
> which is an error since gcc 14.
> 
> The breakage is only visible when rustc is present, because
> tests/workloads/Build adds code_with_type.o when CONFIG_RUST_SUPPORT
> is detected, and tools/build/feature only checks for "rustc
> --version". That is why alpine:3.23 and alpine:3.24 fail while
> alpine:3.22 and alpine:edge, lacking rustc, build fine and hide it.
> 
> Use unsigned int, which needs no header at all.
> 
> Fixes: 2e05bb52a12d3 ("perf test workload: Add code_with_type test workload")
> Cc: Dmitrii Dolgov <9erthalion6@gmail.com>
> Assisted-by: LLM
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

> ---
>  tools/perf/tests/workloads/code_with_type.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/tests/workloads/code_with_type.c b/tools/perf/tests/workloads/code_with_type.c
> index 65d7be7dac24d411..d2d437b86e0c6dbd 100644
> --- a/tools/perf/tests/workloads/code_with_type.c
> +++ b/tools/perf/tests/workloads/code_with_type.c
> @@ -6,7 +6,7 @@
>  #include <linux/compiler.h>
>  #include "../tests.h"
>  
> -extern void test_rs(uint count);
> +extern void test_rs(unsigned int count);
>  
>  static volatile sig_atomic_t done;
>  
> -- 
> 2.55.0
> 

      parent reply	other threads:[~2026-09-25 15:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25 15:32 [PATCH 1/1] perf test workload: Use unsigned int in code_with_type instead of uint Arnaldo Carvalho de Melo
2026-09-25 15:34 ` sashiko-bot
2026-09-25 15:36 ` Ian Rogers
2026-09-25 15:41 ` Namhyung Kim [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=araWImOoVxsvDGrz@z2 \
    --to=namhyung@kernel.org \
    --cc=9erthalion6@gmail.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox