[cairo] error building on AIX
Brent S. Elmer Ph.D.
webe3vt at aim.com
Tue Nov 22 12:28:41 PST 2011
When I build cairo on AIX I get a compile error:
make[1]: Entering directory
`/afs/profit.pok.ibm.com/u3/brente/g2/cairo/cairo-1.10.2/util/cairo-script'
\
source='cairo-script-scanner.c' object='libcairo_script_interpreter_la-cairo-script-scanner.lo' libtool=yes \
DEPDIR=.deps depmode=aix /bin/sh ../../build/depcomp \
/bin/sh ../../libtool --tag=CC --mode=compile xlc_r -DHAVE_CONFIG_H -I. -I../.. -I../../src -I../../src -q64 -D_REENTRANT -I/u3/brente/g1/include/pixman-1 -I/u3/brente/g1/include/libpng15 -Wp,-D_FORTIFY_SOURCE=2 -q64 -O2 -qmaxmem=-1 -c -o libcairo_script_interpreter_la-cairo-script-scanner.lo `test -f 'cairo-script-scanner.c' || echo './'`cairo-script-scanner.c
libtool: compile: xlc_r -DHAVE_CONFIG_H -I. -I../.. -I../../src -I../../src -q64 -D_REENTRANT -I/u3/brente/g1/include/pixman-1 -I/u3/brente/g1/include/libpng15 -Wp,-D_FORTIFY_SOURCE=2 -q64 -O2 -qmaxmem=-1 -c -M cairo-script-scanner.c -DPIC -o .libs/libcairo_script_interpreter_la-cairo-script-scanner.o
"cairo-script-scanner.c", line 193.24: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 199.24: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 435.36: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 440.32: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 448.32: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 464.32: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 474.32: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 481.28: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 486.32: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 504.24: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 525.24: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 534.24: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 582.24: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 591.24: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 599.28: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 607.24: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 635.24: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 664.28: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 671.28: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 681.24: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 758.24: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 767.24: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 777.28: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 795.24: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 1003.28: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 1032.32: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 1123.32: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 1217.20: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 1264.28: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 1267.20: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 1294.20: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 1312.28: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 1319.20: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 1384.44: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 1658.31: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 1704.31: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
"cairo-script-scanner.c", line 1776.40: 1506-022 (S) "__jmpbuf" is not a member of "struct _csi_scanner".
make[1]: *** [libcairo_script_interpreter_la-cairo-script-scanner.lo] Error 1
make[1]: Leaving directory `/afs/profit.pok.ibm.com/u3/brente/g2/cairo/cairo-1.10.2/util/cairo-script'
make: *** [all-recursive] Error 1
Here is my configure line:
CC="xlc_r" CFLAGS="-q64 -O2 -qmaxmem=-1" CXXFLAGS="-q64 -ma -O2 -qmaxmem=-1" LDFLAGS="-q64 " CXX="xlC_r" CPPFLAGS="-q64" AR="ar -X64" NM="/usr/bin/nm
-X64" PKG_CONFIG_PATH=/u3/brente/g1/lib/pkgconfig:/u/brente/lib/pkgconfig:$PKG_CONFIG_PATH ./configure --prefix=/u3/brente/g1 --disable-silent-rules
I have found the root cause of the problem. /usr/include/sys/context.h has the following:
#ifdef _ALL_SOURCE /* { */
#define EXCONTINUE _EXCONTINUE
#define EXRETURN _EXRETURN
#define EXRESUME _EXRESUME
#define EXPGIO _EXPGIO
#define EXTRAP _EXTRAP
#define EXIO _EXIO
#define EXDLOK _EXDLOK
#define EXSIG _EXSIG
#define jmpbuf __jmpbuf
#define context64 __context64
The #define jmpbuf --jmpbuf is the problem util/cairo-script/cairo-script-scanner.c has many references to jmpbuf such as the following:
static void
_buffer_grow (csi_t *ctx, csi_scanner_t *scan)
{
int newsize;
int offset;
char *base;
if (_csi_unlikely (scan->buffer.size > INT_MAX / 2))
longjmp (scan->jmpbuf, _csi_error (CSI_STATUS_NO_MEMORY));
offset = scan->buffer.ptr - scan->buffer.base;
newsize = scan->buffer.size * 2;
base = _csi_realloc (ctx, scan->buffer.base, newsize);
if (_csi_unlikely (base == NULL))
longjmp (scan->jmpbuf, _csi_error (CSI_STATUS_NO_MEMORY));
scan->buffer.base = base;
scan->buffer.ptr = base + offset;
scan->buffer.end = base + newsize;
scan->buffer.size = newsize;
}
cairo-script-private.h has the following:
typedef struct _csi_scanner csi_scanner_t;
.
.
.
struct _csi_scanner {
jmp_buf jmpbuf;
int depth;
int bind;
csi_status_t (*push) (csi_t *ctx, csi_object_t *obj);
csi_status_t (*execute) (csi_t *ctx, csi_object_t *obj);
void *closure;
csi_buffer_t buffer;
csi_stack_t procedure_stack;
csi_object_t build_procedure;
unsigned int accumulator;
unsigned int accumulator_count;
unsigned int line_number;
};
What ends up happening is the jmpbuf references in the .c file are replaced with __jmpbuf from the pound define but the jmpbuf in the _csi_scanner struct is not and hence all of the errors.
I wasn't sure if I could set something in the configure to get around this. What I ended up doing was changing jmpbuf to jmpbuff in cairo-script-private.h and cairo-script-scanner.c and that fixed the problem.
More information about the cairo
mailing list