[PATCH v2] stdio-common: Use clang with bugfix for bug28

H.J. Lu hjl.tools@gmail.com
Tue Dec 24 08:41:36 GMT 2024


On Tue, Dec 24, 2024 at 2:50 PM Dmitry Chestnykh <dm.chestnykh@gmail.com> wrote:
>
> The issue that was the cause of hang
> was fixed in upstream
> ---
>  configure.ac          | 15 +++++++++++++++
>  stdio-common/Makefile |  8 ++++----
>  2 files changed, 19 insertions(+), 4 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index fc5ddb8561..5f60b523bb 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -665,6 +665,21 @@ LIBC_TRY_TEST_CXX_COMMAND([for clang++],
>  )
>  LIBC_CONFIG_VAR([have-test-clangxx], [$libc_cv_test_clangxx])
>
> +if test "$libc_cv_test_clang" = "yes"; then
> +  conftest_code="
> +  #if __clang_major__ > 19
> +  #error clang version > 19
> +  #endif
> +  "
> +  LIBC_TRY_TEST_CC_COMMAND([for clang],
> +    [$conftest_code],
> +    [-c],
> +    libc_cv_test_clang_19_or_less,
> +    [libc_cv_test_clang_19_or_less=yes], [libc_cv_test_clang_19_or_less=no],
> +  )
> +fi
> +LIBC_CONFIG_VAR([have-test-clang-19-or-less], [$libc_cv_test_clang_19_or_less])
> +
>  LIBC_TRY_CC_AND_TEST_CC_OPTION([for -fstack-protector],
>    [-Werror -fstack-protector],
>    libc_cv_ssp,
> diff --git a/stdio-common/Makefile b/stdio-common/Makefile
> index 3f84de3e36..de9e883c03 100644
> --- a/stdio-common/Makefile
> +++ b/stdio-common/Makefile
> @@ -317,10 +317,10 @@ tests := \
>    # tests
>
>  # Clang 19 takes a very long time, it ran more than 27 minutes on Intel
> -# Core i7-1195G7 before the process was killed, to compile bug28.c:
> -# https://github.com/llvm/llvm-project/issues/120462
> -# Exclude it when Clang is used for testing.
> -ifneq ($(have-test-clang),yes)
> +# Core i7-1195G7 before the process was killed, to compile bug28.c

Please add a '.' at the end of the sentence.

> +# The issue was fixed in upstream but check if clang has the version that has the fix
> +# https://github.com/llvm/llvm-project/commit/99dddef340e566e9d303010f1219f7d7d6d37a11
> +ifneq ($(have-test-clang-19-or-less),yes)
>  tests += \
>    bug28 \
>    # tests
> --
> 2.47.1
>

OK with the suggested fix and the regenerated configure.

LGTM.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

Thanks.

-- 
H.J.


More information about the Libc-alpha mailing list