Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Tue, 3 Apr 2012 16:09:25 -0700
From: Isaac Dunham <idunham@...abit.com>
To: musl@...ts.openwall.com
Subject: FTBFS on i386: aio_cancel.c relies on macro-protected defines in
 aio.h

aio_cancel.c won't build.
It seems one of the _*_SOURCE macros must be defined to build it, and
I'm not sure which one (guessing it's _POSIX_SOURCE or _XOPEN_SOURCE ?).

Following is the relevant output from make:
---
cc -fno-stack-protector -I./src/internal -I./include -I./arch/i386 -c
-o src/aio/aio_cancel.o src/aio/aio_cancel.c src/aio/aio_cancel.c:5:
warning: ‘struct aiocb’ declared inside parameter list
src/aio/aio_cancel.c:5: warning: its scope is only this definition or
declaration, which is probably not what you want src/aio/aio_cancel.c:
In function ‘aio_cancel’: src/aio/aio_cancel.c:13: error:
‘AIO_NOTCANCELED’ undeclared (first use in this function)
src/aio/aio_cancel.c:13: error: (Each undeclared identifier is reported
only once src/aio/aio_cancel.c:13: error: for each function it appears
in.) src/aio/aio_cancel.c:15: error: dereferencing pointer to
incomplete type src/aio/aio_cancel.c:15: error: ‘AIO_ALLDONE’
undeclared (first use in this function) make: ***
[src/aio/aio_cancel.o] Error 1
---
aio_cancel.c #include's aio.h, which does define these macros...if
appropriate defines were passed.
Relevant portions of aio.h:
---
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
/* a few lines omitted */
struct aiocb {
	int aio_fildes, aio_lio_opcode, aio_reqprio;
	volatile void *aio_buf;
	size_t aio_nbytes;
	struct sigevent aio_sigevent;
	void *__td;
	int __lock[2];
	int __err;
	ssize_t __ret;
	off_t aio_offset;
	void *__next, *__prev;
	char __dummy4[32-2*sizeof(void *)];
};

#define AIO_CANCELED 0
#define AIO_NOTCANCELED 1
#define AIO_ALLDONE 2

/* several more lines */
#endif /* _*_SOURCE */
----

Just out of curiosity, is there a reason to macro-protect headers that
are not part of ANSI C when all other flavors support them?

Isaac Dunham

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.