WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

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

To: "XEN Mailing List" <xen-users@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-users] implicit declaration of function `posix_memalign'
From: "Nick Couchman" <Nick.Couchman@xxxxxxxxx>
Date: Fri, 09 Apr 2010 15:17:27 -0600
Delivery-date: Fri, 09 Apr 2010 14:18:45 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-users] implicit declaration of function `posix_memalign', Nick Couchman <=