Subject: Re: bug#28308: Build failure on FreeBSD/aarch64

From: Gergely Czuczy <[email-masked]>
Date: Wed, 1 Nov 2017 17:14:20 +0100

On 2017. 10. 31. 18:31, Noam Postavsky wrote:
> tags 28308 + patch
> quit
>
> On Tue, Oct 24, 2017 at 2:43 PM, Noam Postavsky
> <[email-masked]> wrote:
>
>> It seems that the memory pointer to by float_block->floats becomes
>> invalid following the dumping process.
> The following patch which makes FreeBSD use the hybrid malloc scheme fixes it:
>
> diff --git a/configure.ac b/configure.ac
> index d294412dc4..2e690987a6 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -2206,7 +2206,7 @@ AC_DEFUN
>   case "$opsys" in
>     ## darwin ld insists on the use of malloc routines in the System framework.
>     darwin | mingw32 | nacl | sol2-10) ;;
> -  cygwin) hybrid_malloc=yes
> +  freebsd | cygwin) hybrid_malloc=yes
>             system_malloc= ;;
>     *) test "$ac_cv_func_sbrk" = yes &&
> system_malloc=$emacs_cv_sanitize_address;;
>   esac
> diff --git a/src/gmalloc.c b/src/gmalloc.c
> index baaff58050..8fd05fe845 100644
> --- a/src/gmalloc.c
> +++ b/src/gmalloc.c
> @@ -1509,9 +1509,13 @@ gdefault_morecore (ptrdiff_t increment)
>         return bss_sbrk (increment);
>       }
>   #endif
> +#ifdef HAVE_SBRK
>     result = (void *) __sbrk (increment);
>     if (result == (void *) -1)
>       return NULL;
> +#else
> +  result = NULL;
> +#endif
>     return result;
>   }
Is 2e690987a6 the commit id I can try? I would like to test it.

Thanks,
-czg