Subrahmanian, Raj
2005-Mar-21 20:37 UTC
[Xen-devel] cross compiling 32 bit Xen on an x86_64 system
All, I am trying to cross-compile 32 Xen on my x86_64 box. I turned on XEN_TARGET_ARCH=x86_32 There are problems with incompatible header files while compiling the python subdirectory. Is anyone else running into similar problems? thanks Raj ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Jerone Young
2005-Mar-21 21:55 UTC
Re: [Xen-devel] cross compiling 32 bit Xen on an x86_64 system
This is a python issue that I can''t see a way around. The issue you are seeing is because we are using the setup function in "distutils.core" module http://python.fyxm.net/doc/2.4/dist/module-distutils.core.html and it does not pass all the correct flags when compiling xen/lowlevel/xc/xc.c Here is the gcc line it comes up with: gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -m64 - D_GNU_SOURCE -fPIC -m32 -march=i686 -fPIC - I../../tools/python/xen/lowlevel/xu -I../../tools/libxc - I../../tools/libxutil -I../../tools/xcs -Ixen/lowlevel/xc - I/usr/include/python2.3 -c xen/lowlevel/xc/xc.c -o build/temp.linux- x86_64-2.3/xen/lowlevel/xc/xc.o -fno-strict-aliasing -Wall -Werror In file included from /usr/include/python2.3/Python.h:48, from xen/lowlevel/xc/xc.c:7: /usr/include/python2.3/pyport.h:554:2: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?). You will notice both "-m64" & "-m32 -march=i686" ("-m32 & -march=i686" are the CFLAGS we are specifying). This is were the problem is. The first set of CFLAGS with "-m64" are assumed by python. On a normal x86-64 compile you get: gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -m64 - D_GNU_SOURCE -fPIC -m64 -fPIC -I../../tools/python/xen/lowlevel/xu - I../../tools/libxc -I../../tools/libxutil -I../../tools/xcs - Ixen/lowlevel/xc -I/usr/include/python2.3 -c xen/lowlevel/xc/xc.c -o build/temp.linux-x86_64-2.3/xen/lowlevel/xc/xc.o -fno-strict-aliasing - Wall -Werror So it''s figuring out where python is getting these CFLAGS. On Mon, 2005-03-21 at 15:37 -0500, Subrahmanian, Raj wrote:> All, > > I am trying to cross-compile 32 Xen on my x86_64 box. > > I turned on XEN_TARGET_ARCH=x86_32 > > There are problems with incompatible header files while compiling the python subdirectory. > Is anyone else running into similar problems? > > thanks > Raj > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_ide95&alloc_id396&op=click > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/xen-devel >-- Jerone Young IBM Linux Technology Center jyoung5@us.ibm.com 512-838-1157 (T/L: 678-1157) ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Ian Pratt
2005-Mar-21 23:00 UTC
RE: [Xen-devel] cross compiling 32 bit Xen on an x86_64 system
> Here is the gcc line it comes up with: > gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -m64 - > D_GNU_SOURCE -fPIC -m32 -march=i686 -fPIC - > I../../tools/python/xen/lowlevel/xu -I../../tools/libxc - > I../../tools/libxutil -I../../tools/xcs -Ixen/lowlevel/xc - > I/usr/include/python2.3 -c xen/lowlevel/xc/xc.c -o build/temp.linux- > x86_64-2.3/xen/lowlevel/xc/xc.o -fno-strict-aliasing -Wall -Werror > In file included from /usr/include/python2.3/Python.h:48, > from xen/lowlevel/xc/xc.c:7: > /usr/include/python2.3/pyport.h:554:2: #error "LONG_BIT definition > appears wrong for platform (bad gcc/glibc config?). > > You will notice both "-m64" & "-m32 -march=i686" ("-m32 & -march=i686" > are the CFLAGS we are specifying). This is were the problem is. The > first set of CFLAGS with "-m64" are assumed by python. > > On a normal x86-64 compile you get: > gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -m64 - > D_GNU_SOURCE -fPIC -m64 -fPIC -I../../tools/python/xen/lowlevel/xu - > I../../tools/libxc -I../../tools/libxutil -I../../tools/xcs - > Ixen/lowlevel/xc -I/usr/include/python2.3 -c xen/lowlevel/xc/xc.c -o > build/temp.linux-x86_64-2.3/xen/lowlevel/xc/xc.o > -fno-strict-aliasing - > Wall -Werror > > So it''s figuring out where python is getting these CFLAGS.Interesting. It seems to be coming from the following lines in /usr/lib64/python2.3/config/Makefile Not sure how to fix it... # Compiler options OPT= -DNDEBUG -O2 -g -pipe -m64 -D_GNU_SOURCE -fPIC BASECFLAGS= -fno-strict-aliasing CFLAGS= $(BASECFLAGS) $(OPT) Ian ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Michal Ostrowski
2005-Mar-21 23:42 UTC
RE: [Xen-devel] cross compiling 32 bit Xen on an x86_64 system
I came across a variant of this problem trying to cross-compile myself. Python''s distutils.core package seem to have "gcc" hardcoded in it, and there is no way to redirect it to another compiler when trying to build these modules. In other words, python seems not to be able to cross-compile these things. On Mon, 2005-03-21 at 23:00 +0000, Ian Pratt wrote:> > Here is the gcc line it comes up with: > > gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -m64 - > > D_GNU_SOURCE -fPIC -m32 -march=i686 -fPIC - > > I../../tools/python/xen/lowlevel/xu -I../../tools/libxc - > > I../../tools/libxutil -I../../tools/xcs -Ixen/lowlevel/xc - > > I/usr/include/python2.3 -c xen/lowlevel/xc/xc.c -o build/temp.linux- > > x86_64-2.3/xen/lowlevel/xc/xc.o -fno-strict-aliasing -Wall -Werror > > In file included from /usr/include/python2.3/Python.h:48, > > from xen/lowlevel/xc/xc.c:7: > > /usr/include/python2.3/pyport.h:554:2: #error "LONG_BIT definition > > appears wrong for platform (bad gcc/glibc config?). > > > > You will notice both "-m64" & "-m32 -march=i686" ("-m32 & -march=i686" > > are the CFLAGS we are specifying). This is were the problem is. The > > first set of CFLAGS with "-m64" are assumed by python. > > > > On a normal x86-64 compile you get: > > gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -m64 - > > D_GNU_SOURCE -fPIC -m64 -fPIC -I../../tools/python/xen/lowlevel/xu - > > I../../tools/libxc -I../../tools/libxutil -I../../tools/xcs - > > Ixen/lowlevel/xc -I/usr/include/python2.3 -c xen/lowlevel/xc/xc.c -o > > build/temp.linux-x86_64-2.3/xen/lowlevel/xc/xc.o > > -fno-strict-aliasing - > > Wall -Werror > > > > So it''s figuring out where python is getting these CFLAGS. > > Interesting. > > It seems to be coming from the following lines in > /usr/lib64/python2.3/config/Makefile > Not sure how to fix it... > > # Compiler options > OPT= -DNDEBUG -O2 -g -pipe -m64 -D_GNU_SOURCE -fPIC > BASECFLAGS= -fno-strict-aliasing > CFLAGS= $(BASECFLAGS) $(OPT) > > > > Ian-- Michal Ostrowski <mostrows@watson.ibm.com> ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Jacob Gorm Hansen
2005-Mar-22 00:12 UTC
Re: [Xen-devel] cross compiling 32 bit Xen on an x86_64 system
Michal Ostrowski wrote:> I came across a variant of this problem trying to cross-compile myself. > Python''s distutils.core package seem to have "gcc" hardcoded in it, and > there is no way to redirect it to another compiler when trying to build > these modules. In other words, python seems not to be able to > cross-compile these things.One option would be to use vm-tools instead of xend (search this list for announcements and URL), as the former does not (yet) depend on Python. Jacob ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Anthony Liguori
2005-Mar-22 01:57 UTC
Re: [Xen-devel] cross compiling 32 bit Xen on an x86_64 system
Jacob Gorm Hansen wrote:> Michal Ostrowski wrote: > >> I came across a variant of this problem trying to cross-compile >> myself. Python''s distutils.core package seem to have "gcc" hardcoded >> in it, and >> there is no way to redirect it to another compiler when trying to build >> these modules. In other words, python seems not to be able to >> cross-compile these things. > > > One option would be to use vm-tools instead of xend (search this list > for announcements and URL), as the former does not (yet) depend on > Python.I found the best way to deal with building python modules is the following: PYINC=`python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_inc()"` PYLIB=`python -c "import distutils.sysconfg; print distutils.sysconfig.get_python_lib(prefix='''')"` CFLAGS += -I$(PYINC) And then to use $(DESTDIR)$(prefix)/$(PYLIB) for the install path of the module. You have to write your own rules to build the shared object but at least you don''t have these cross-compiling issues. This is how the python bindings are built in libxen. Regards, Anthony Liguori> Jacob > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/xen-devel >------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Keir Fraser
2005-Mar-22 09:07 UTC
Re: [Xen-devel] cross compiling 32 bit Xen on an x86_64 system
On 21 Mar 2005, at 20:37, Subrahmanian, Raj wrote:> I am trying to cross-compile 32 Xen on my x86_64 box. > > I turned on XEN_TARGET_ARCH=x86_32 > > There are problems with incompatible header files while compiling the > python subdirectory. > Is anyone else running into similar problems?I haven''t managed a successful build of the Python tools from a x86_64 environment. I instead set myself up a 32-bit filesystem which I chroot to. -- Keir ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Keir Fraser
2005-Mar-22 09:18 UTC
Re: [Xen-devel] cross compiling 32 bit Xen on an x86_64 system
On 21 Mar 2005, at 23:00, Ian Pratt wrote:> It seems to be coming from the following lines in > /usr/lib64/python2.3/config/Makefile > Not sure how to fix it...Use a chroot environment. Mount a 32-bit filesystem and then chroot to it to do your builds. I have a small setuid-root program I use to do this safely from an unprivileged login. -- Keir ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Jerone Young
2005-Mar-22 15:44 UTC
Re: [Xen-devel] cross compiling 32 bit Xen on an x86_64 system
On Tue, 2005-03-22 at 09:07 +0000, Keir Fraser wrote:> On 21 Mar 2005, at 20:37, Subrahmanian, Raj wrote: > > > I am trying to cross-compile 32 Xen on my x86_64 box. > > > > I turned on XEN_TARGET_ARCH=x86_32 > > > > There are problems with incompatible header files while compiling the > > python subdirectory. > > Is anyone else running into similar problems? > > I haven''t managed a successful build of the Python tools from a x86_64 > environment. I instead set myself up a 32-bit filesystem which I chroot > to.Works fine once you have libxc building :-) . I''ve got a patch on the list to allow libxc to build.> > -- Keir > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/xen-devel >-- Jerone Young IBM Linux Technology Center jyoung5@us.ibm.com 512-838-1157 (T/L: 678-1157) ------------------------------------------------------- This SF.net email is sponsored by: 2005 Windows Mobile Application Contest Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones for the chance to win $25,000 and application distribution. Enter today at http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel