[PATCH 2/4] support: Add support_hardcoded_paths_in_test

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Wed Jan 21 15:48:45 GMT 2026


LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

On 20/01/26 17:57, Florian Weimer wrote:
> It indicates whether glibc was configured with
> --enable-hardcoded-path-in-tests.
> ---
>  support/Makefile        | 6 ++++++
>  support/support.h       | 3 +++
>  support/support_paths.c | 2 ++
>  3 files changed, 11 insertions(+)
> 
> diff --git a/support/Makefile b/support/Makefile
> index 6cef390d5c..3a948c7f7e 100644
> --- a/support/Makefile
> +++ b/support/Makefile
> @@ -253,6 +253,12 @@ CFLAGS-support_paths.c = \
>  		-DCOMPLOCALEDIR_PATH=\"$(complocaledir)\" \
>  		-DSYSCONFDIR_PATH=\"$(sysconfdir)\"
>  
> +ifeq ($(build-hardcoded-path-in-tests),yes)
> +CFLAGS-support_paths.c += -DHARDCODED_PATHS_IN_TEST=true
> +else
> +CFLAGS-support_paths.c += -DHARDCODED_PATHS_IN_TEST=false
> +endif
> +
>  # Build with exception handling and asynchronous unwind table support.
>  CFLAGS-.oS += -fexceptions -fasynchronous-unwind-tables
>  
> diff --git a/support/support.h b/support/support.h
> index 40a2bf878b..3060ff8941 100644
> --- a/support/support.h
> +++ b/support/support.h
> @@ -147,6 +147,9 @@ extern const char support_complocaledir_prefix[];
>  /* Corresponds to the install's etc/ directory.  */
>  extern const char support_sysconfdir_prefix[];
>  
> +/* If true, glibc was configured with --enable-hardcoded-path-in-tests.  */
> +extern const bool support_hardcoded_paths_in_test;
> +
>  /* Copies the file at the path FROM to TO.  If TO does not exist, it
>     is created.  If TO is a regular file, it is truncated before
>     copying.  The file mode is copied, but the permissions are not.  */
> diff --git a/support/support_paths.c b/support/support_paths.c
> index fe4e7034f1..30df0c750c 100644
> --- a/support/support_paths.c
> +++ b/support/support_paths.c
> @@ -99,3 +99,5 @@ const char support_sysconfdir_prefix[] = SYSCONFDIR_PATH;
>  #else
>  # error please -DSYSCONFDIR_PATH=something in the Makefile
>  #endif
> +
> +const bool support_hardcoded_paths_in_test = HARDCODED_PATHS_IN_TEST;



More information about the Libc-alpha mailing list