tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: -current gcc optimizations and XEmacs



In article <f7205af1-9f8f-019e-7a4e-fa20ed5b63a5%spg.tu-darmstadt.de@localhost>,
Hauke Fath  <hf%spg.tu-darmstadt.de@localhost> wrote:
>All,
>
>I am having problems building editors/xemacs on a -current amd64 system
>
>% uname -a
>NetBSD Anscharte.nt.e-technik.tu-darmstadt.de 7.99.39 NetBSD 7.99.39 
>(HP2170P) #1: Mon Oct 17 13:36:49 CEST 2016 
>hauke%Anscharte.nt.e-technik.tu-darmstadt.de@localhost:/var/obj/netbsd-builds/developer/amd64/sys/arch/amd64/compile/HP2170P 
>amd64
>% fgrep GCC /etc/release
>             HAVE_GCC = '53'
>                MKGCC = 'yes'
>            MKGCCCMDS = 'yes'
>%
>
>Built with -O2 (the default), the freshly built xemacs will hang 
>indefinitely at
>
><snip from gmalloc.c>
>    1175 /* Allocate an array of NMEMB elements each SIZE bytes long.
>    1176    The entire array is initialized to zeros.  */
>    1177 __ptr_t
>    1178 calloc (__malloc_size_t nmemb, __malloc_size_t size)
>    1179 {
>    1180   __ptr_t result = malloc (nmemb * size);
>    1181
>    1182   if (result != NULL)
>    1183     (void) memset (result, 0, nmemb * size);
>    1184
>    1185   return result;
>    1186 }
></snip>
>
>Building with "-Os" or "-O1" via a hacks.mk file gets me over this hang, 
>but the resulting xemacs then fails compiling an elisp file further down 
>the package build:

Delete the function. gcc detects 

    ptr = malloc(nmemb * size);
    memset(ptr, 0, nmemb * size);

and changes it into:

    calloc(nmemb, size);

so the function ends up being:

    __ptr_t
    calloc (__malloc_size_t nmemb, __malloc_size_t size)
    {
	    return calloc(nmemb, size);
    }

and that does not work very will as you noticed :-)

christos



Home | Main Index | Thread Index | Old Index