Hi all,
I just finished compiling Geany on AIX v5.3 and it now works after little tinkering.
The problem I encountered was that AIX doesn't have a 'malloc' conforming to 'GNU malloc', so configure defines 'malloc' as 'rpl_malloc'. Geany doesn't provide this replacement function so the compiling fails at link time.
I bypassed this by editing config.h and Geany seems to work fine with native AIX malloc. But I think the right solution is to provide the replacement function as autoconf documentation suggests. Here's a sample, copy-pasted from the autoconf manual:
###snip###
#if HAVE_CONFIG_H # include <config.h> #endif #undef malloc
#include <sys/types.h>
void *malloc (size_t);
/* Allocate an N-byte block of memory from the heap. If N is zero, allocate a 1-byte block. */
void * rpl_malloc (size_t n) { if (n == 0) n = 1; return malloc (n); }
###snip###
Best regards, -Harri
On Mon, 04 Jun 2007 10:21:38 +0300, Harri Koskinen geany_fi@fastmonkey.org wrote:
Hi,
I just finished compiling Geany on AIX v5.3 and it now works after little tinkering.
Cool.
Ok, I committed the code in SVN r1596. No idea whether it works because I only have a GNU compatible malloc ;-) (at least it compiled cleanly after changing HAVE_MALLOC to 0 and defining malloc to rpl_malloc in config.h).
Please test it and many thanks for reporting this.
Regards, Enrico
On Mon, 4 Jun 2007 15:26:01 +0200 Enrico Tröger enrico.troeger@uvena.de wrote:
Hello!
I have little comment here, but first i will say that i didn't looked at sources when writing this.
Geany uses glib and gtk+ that have some extended memory allocation routines. I think that instead of such malloc override it would be better to use these provided routines: * http://developer.gnome.org/doc/API/2.0/glib/glib-Memory-Allocation.html
Sorry for bothering.
Regards, Enrico
On Mon, 4 Jun 2007 10:39:14 -0600, Michal Kurgan michal.kurgan@moloh.net wrote:
Hi,
Of course. A grep for malloc in src/ shows that we only use g_malloc. Only in tagmanager there are a few malloc calls. I'm going to remove them.
Harri: the linker error you got came from tagmanager code or from Geany code? (if unsure just post the error message)
Regards, Enrico
On Mon, 4 Jun 2007 18:44:50 +0200 Enrico Tröger enrico.troeger@uvena.de wrote:
Sorry for comment then, i wasn't aware of that. Quick grep for me shows that malloc is only used in tagmanager.
Regards, Enrico
On Mon, 4 Jun 2007 10:58:41 -0600, Michal Kurgan michal.kurgan@moloh.net wrote:
No need for a sorry ;-).
Regards, Enrico
On Mon, 04 Jun 2007 20:09:56 +0300, Harri Koskinen geany_fi@fastmonkey.org wrote:
Ok, so it is double fixed ;-) because all malloc calls used in tagmanager were replaced by g_malloc.
Regards, Enrico