[PATCH v2] configure: define TARGET_LIBC_GNUSTACK on musl

Dragan Mladjenovic Dragan.Mladjenovic@syrmia.com
Tue Nov 16 14:40:00 GMT 2021


Hi,

Looks fine to me. If possible, maybe it should even be back-ported to 
stable branches.

Not sure if MIPS assembly sources (if any) in musl would need explicit 
.note.GNU-stack

to complement this?

Best regards,

Dragan

On 16-Nov-21 06:13, Ilya Lipnitskiy wrote:
> musl only uses PT_GNU_STACK to set default thread stack size and has no
> executable stack support[0], so there is no reason not to emit the
> .note.GNU-stack section on musl builds.
>
> [0]: https://lore.kernel.org/all/20190423192534.GN23599@brightrain.aerifal.cx/T/#u
>
> gcc/ChangeLog:
>
> 	* configure: Regenerate.
> 	* configure.ac: define TARGET_LIBC_GNUSTACK on musl
>
> Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
> ---
>   gcc/configure    | 3 +++
>   gcc/configure.ac | 3 +++
>   2 files changed, 6 insertions(+)
>
> diff --git a/gcc/configure b/gcc/configure
> index 74b9d9be4c85..7091a838aefa 100755
> --- a/gcc/configure
> +++ b/gcc/configure
> @@ -31275,6 +31275,9 @@ fi
>   # Check if the target LIBC handles PT_GNU_STACK.
>   gcc_cv_libc_gnustack=unknown
>   case "$target" in
> +  mips*-*-linux-musl*)
> +    gcc_cv_libc_gnustack=yes
> +    ;;
>     mips*-*-linux*)
>   
>   if test $glibc_version_major -gt 2 \
> diff --git a/gcc/configure.ac b/gcc/configure.ac
> index c9ee1fb8919e..8a2d34179a75 100644
> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -6961,6 +6961,9 @@ fi
>   # Check if the target LIBC handles PT_GNU_STACK.
>   gcc_cv_libc_gnustack=unknown
>   case "$target" in
> +  mips*-*-linux-musl*)
> +    gcc_cv_libc_gnustack=yes
> +    ;;
>     mips*-*-linux*)
>       GCC_GLIBC_VERSION_GTE_IFELSE([2], [31], [gcc_cv_libc_gnustack=yes], )
>       ;;


More information about the Gcc-patches mailing list