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

[Xen-users] implicit declaration of function `posix_memalign'



I'm attempting to compile Xen 4 on RHEL4.  Yes, I know RHEL4 is old and I 
should upgrade, but certain application vendors who cannot seem to stay current 
within 5 years are forcing me to stick with some older versions.  Anyway, I'm 
getting the following error:

make -C xenpaging install
make[3]: Entering directory `/usr/src/redhat/BUILD/xen-4.0.0/tools/xenpaging'
gcc  -O2 -fomit-frame-pointer -m64 -fno-strict-aliasing -std=gnu99 -Wall 
-Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement  
-D__XEN_TOOLS__ -MMD -MF .xenpaging.o.d  -D_LARGEFILE_SOURCE 
-D_LARGEFILE64_SOURCE  -I ../../tools/python/xen/lowlevel/xc -I ./ 
-I../../tools/libxc -I../../tools/include -I../../tools/xenstore 
-I../../tools/include -Werror -Wno-unused -g -D__USE_XOPEN2K 
-Wp,-MD,.xenpaging.o.d -c -o xenpaging.o xenpaging.c
xenpaging.c: In function `init_page':
xenpaging.c:51: warning: implicit declaration of function `posix_memalign'
make[3]: *** [xenpaging.o] Error 1
make[3]: Leaving directory `/usr/src/redhat/BUILD/xen-4.0.0/tools/xenpaging'
make[2]: *** [subdir-install-xenpaging] Error 2
make[2]: Leaving directory `/usr/src/redhat/BUILD/xen-4.0.0/tools'
make[1]: *** [subdirs-install] Error 2
make[1]: Leaving directory `/usr/src/redhat/BUILD/xen-4.0.0/tools'
make: *** [install-tools] Error 2

The posix_memalign function is declared in /usr/include/stdlib.h (which is 
included in xenpaging.c):

#ifdef __USE_XOPEN2K
/* Allocate memory of SIZE bytes with an alignment of ALIGNMENT.  */
extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __THROW __nonnull ((1));
#endif

So, I edit the Makefile in tools/xenpaging and add the line:
CFLAGS += -D__USE_XOPEN2K

However, when I recompile, I get the same error.  There also seems to be 
another condition in stdlib.h that must be satisfied before the __USE_XOPEN2K 
one will be checked:
#ifndef __need_malloc_and_calloc

I'm not sure whether this is defined (or not defined) somewhere else in Xen - 
anyone have any ideas?

Thanks - Nick



--------
This e-mail may contain confidential and privileged material for the sole use 
of the intended recipient.  If this email is not intended for you, or you are 
not responsible for the delivery of this message to the intended recipient, 
please note that this message may contain SEAKR Engineering (SEAKR) 
Privileged/Proprietary Information.  In such a case, you are strictly 
prohibited from downloading, photocopying, distributing or otherwise using this 
message, its contents or attachments in any way.  If you have received this 
message in error, please notify us immediately by replying to this e-mail and 
delete the message from your mailbox.  Information contained in this message 
that does not relate to the business of SEAKR is neither endorsed by nor 
attributable to SEAKR.

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.