[PATCH] benchtests: Create objdir in the bench-%.c generation rule

Florian Weimer fweimer@redhat.com
Tue Jul 28 15:20:17 GMT 2026


* Adhemerval Zanella:

> The $(objpfx)bench-%.c rule writes its output into $(objpfx) without
> ensuring that directory exists.  Serial builds happened to satisfy
> that ordering, with parallel builds the generation recipe can
> run before the directory is created, failing with:
>
>   cannot create .../benchtests/bench-xxx.c-tmp: Directory nonexistent
>
> Add the standard $(make-target-directory).
> ---
>  benchtests/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/benchtests/Makefile b/benchtests/Makefile
> index f407e492cb7..16cc951d195 100644
> --- a/benchtests/Makefile
> +++ b/benchtests/Makefile
> @@ -622,6 +622,7 @@ $(bench-link-targets): %: %.o $(objpfx)json-lib.o \
>  $(bench-link-targets): LDFLAGS += $(link-bench-bind-now)
>  
>  $(objpfx)bench-%.c: %-inputs $(bench-deps)
> +	$(make-target-directory)
>  	{ if [ -n "$($*-INCLUDE)" ]; then \
>  	  cat $($*-INCLUDE); \
>  	fi; \

Looks okay.

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Thanks,
Florian



More information about the Libc-alpha mailing list