GNU bug report logs - #18368
HYBRID_MALLOC broke AIX build

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Sat, 30 Aug 2014 22:52:01 UTC

Severity: normal

Fixed in version 25.1

Done: Ken Brown <kbrown <at> cornell.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Paul Eggert <eggert <at> cs.ucla.edu>
Subject: bug#18368: closed (Re: bug#18368: HYBRID_MALLOC broke AIX build)
Date: Sun, 31 Aug 2014 02:43:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#18368: HYBRID_MALLOC broke AIX build

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 18368 <at> debbugs.gnu.org.

-- 
18368: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18368
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Ken Brown <kbrown <at> cornell.edu>
To: Paul Eggert <eggert <at> cs.ucla.edu>, 18368-done <at> debbugs.gnu.org
Subject: Re: bug#18368: HYBRID_MALLOC broke AIX build
Date: Sat, 30 Aug 2014 22:42:21 -0400
Version: 24.5

On 8/30/2014 10:21 PM, Paul Eggert wrote:
> Thanks, I verified that that patch works on AIX.

I've installed the patch in the trunk as bzr revision 117787.

Ken

[Message part 3 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Emacs bug reports and feature requests <bug-gnu-emacs <at> gnu.org>
Cc: Ken Brown <kbrown <at> cornell.edu>
Subject: HYBRID_MALLOC broke AIX build
Date: Sat, 30 Aug 2014 15:50:30 -0700
The trunk's recent HYBRID_MALLOC changes broke the build on AIX.  Here 
are the first couple of compile-time diagnostics:

xlc -c  -Demacs  -I. -I. -I../lib -I../lib -g3 -O  gmalloc.c
"/usr/include/unistd.h", line 201.17: 1506-343 (S) Redeclaration of 
lseek64 differs from previous declaration on line 199 of 
"/usr/include/unistd.h".
"/usr/include/unistd.h", line 201.17: 1506-050 (I) Return type "long 
long" in redeclaration is not compatible with the previous return type 
"long".

The culprit is this part of gmalloc.c:

/* If HYBRID_MALLOC is defined in config.h, then conf_post.h #defines
   malloc and friends as macros before including stdlib.h.  In this
   file we will need the prototypes for the system malloc, so we must
   include stdlib.h before config.h.  And we have to do this
   unconditionally, since HYBRID_MALLOC hasn't been defined yet.  */
#include <stdlib.h>

#include <config.h>


This doesn't work, as <config.h> must come first for various reasons; I 
suspect the AIX breakage is just the tip of the iceberg.

One possible fix is to declare the system malloc directly, if 
HYBRID_MALLOC is defined.  Another one, which might be safer, is to 
modify config.h to capture the system malloc before it's redefined.

Since AIX does not define HYBRID_MALLOC, I have temporarily worked 
around the problem on my AIX host by using this in gmalloc.c:

#ifdef HYBRID_MALLOC
#include <stdlib.h>
#endif

#include <config.h>

#include <stdlib.h>

but I suspect this is not the right way to fix the problems on platforms 
that need HYBRID_MALLOC but have AIX-like problems with redefinitions.



This bug report was last modified 10 years and 317 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.