Skip to contentSkip to conversation

Build process

DISCUSSION Philip Taylor 3 participants 6 messages Nov 7, 2004 – Nov 15, 2004 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

I've been playing a little with Xen on Gentoo (just out of interest,
rather than for any productive reason), and considered making an ebuild to allow a simple "emerge xen-utilities xen-sources" method of compiling the tools and kernel (probably equivalent to "emerge usermode-utilities usermode-sources" for UML). (It would be easier if I knew what I was doing, and I haven't actually got much working yet, but it should be theoretically possible.)

One small (but annoying) problem was that I couldn't change the
compiler. Some of the Makefiles set 'CC=gcc' and 'HOSTCC=gcc', which referred to GCC 3.4 (which doesn't work -- I think it died while compiling the kernel), and I wanted to explicitly use the GCC 3.3 binary. The GCC problem was relatively easily fixed by swapping my system's default gcc; but I also fancied using ccache, which usually works by just changing CC, and couldn't find any way to do that without altering the makefiles (and I'd prefer to build from a clean copy of the source).
Would it be possible/safe to use something like 'CC ?= gcc' and
'HOSTCC ?= $(CC)' (I hope that does what I expect) in all the relevant makefiles, so the compiler can be easily overriden? Or is there some other solution that I've missed?

Thanks,

Signature · 9 lines
Philip Taylor
[email protected]


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
#1 lore raw

Even if we fixed our Makefiles (and I'm not sure we can -- if we use '?=' then we don't get 'gcc' by default because it appears CC is set to 'cc' already) your beef is with the Linux build system. In the Linux build system there is no way to change the compiler name to anything other than $(CROSS_COMPILE)gcc [you can set CROSS_COMPILE though].

Have you tried tricks like creating a symlink in a local directory to your preferred compiler and adding it to your PATH? e.g.,

 # ln -sf `which ccache' gcc
 # PATH=`pwd`:$PATH make

-- Keir

Quoted 22 lines

I've been playing a little with Xen on Gentoo (just out of interest,
rather than for any productive reason), and considered making an ebuild to allow a simple "emerge xen-utilities xen-sources" method of compiling the tools and kernel (probably equivalent to "emerge usermode-utilities usermode-sources" for UML). (It would be easier if I knew what I was doing, and I haven't actually got much working yet, but it should be theoretically possible.)

One small (but annoying) problem was that I couldn't change the
compiler. Some of the Makefiles set 'CC=gcc' and 'HOSTCC=gcc', which referred to GCC 3.4 (which doesn't work -- I think it died while compiling the kernel), and I wanted to explicitly use the GCC 3.3 binary. The GCC problem was relatively easily fixed by swapping my system's default gcc; but I also fancied using ccache, which usually works by just changing CC, and couldn't find any way to do that without altering the makefiles (and I'd prefer to build from a clean copy of the source).
Would it be possible/safe to use something like 'CC ?= gcc' and
'HOSTCC ?= $(CC)' (I hope that does what I expect) in all the relevant makefiles, so the compiler can be easily overriden? Or is there some other solution that I've missed?

Quoted 15 lines

Thanks,

Signature · 13 lines
Philip Taylor
[email protected]


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xen-devel

-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click

#2 lore raw

Keir Fraser wrote on 08/11/2004 08:05:

...

Quoted 2 lines

Would it be possible/safe to use something like 'CC ?= gcc' and

Quoted 1 line

'HOSTCC ?= $(CC)' (I hope that does what I expect) in all the relevant makefiles, so the compiler can be easily overriden? Or is there some other solution that I've missed?

...

Quoted 4 lines

Have you tried tricks like creating a symlink in a local directory to your preferred compiler and adding it to your PATH? e.g.,

 # ln -sf `which ccache' gcc
 # PATH=`pwd`:$PATH make

Ah, that worked (after I apparently fork-bombed my machine and also corrupted python). But it turns out that Gentoo's Portage automatically makes ccache handle calls to 'gcc' anyway, and the problems with GCC 3.4 were straightforward to fix (see patch at http://zaynar.demon.co.uk/misc2/blkfront.patch - it needs inline functions to be defined before they're first called).

I believe my attempt at a kernel ebuild is generally working (using the 2.0 source release plus the above patch for GCC 3.4), though currently only for 2.6.9-xen0 and with a little too much manual intervention. It also compiles the rest of Xen + tools + docs without any problems, but doesn't quite know how to install them. Anyway, I should end up with something useful soon, so I'd be interested to know if anybody with Gentoo would be interested in testing/using it.

Quoted 2 lines

-- Keir

Signature · 9 lines
Philip Taylor
[email protected]


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
#3 lore raw

I'm running Gentoo and would be very happy to test etc - I have been thinking about writing an ebuild myself, but haven't got around to it.

If your interested, post on the Gentoo-Server mailing list and ask there
there are a few interested parties from memory.

Jerome

Quoted 16 lines · Philip Taylor

Keir Fraser wrote on 08/11/2004 08:05:

...

Quoted 3 lines

Would it be possible/safe to use something like 'CC ?= gcc' and

Quoted 1 line

'HOSTCC ?= $(CC)' (I hope that does what I expect) in all the relevant makefiles, so the compiler can be easily overriden? Or is there some other solution that I've missed?

...

Quoted 4 lines

Have you tried tricks like creating a symlink in a local directory to your preferred compiler and adding it to your PATH? e.g.,

 # ln -sf `which ccache' gcc
 # PATH=`pwd`:$PATH make
Quoted 8 lines

Ah, that worked (after I apparently fork-bombed my machine and also corrupted python). But it turns out that Gentoo's Portage automatically makes ccache handle calls to 'gcc' anyway, and the problems with GCC 3.4 were straightforward to fix (see patch at http://zaynar.demon.co.uk/misc2/blkfront.patch - it needs inline functions to be defined before they're first called).

I believe my attempt at a kernel ebuild is generally working (using the 2.0 source release plus the above patch for GCC 3.4), though currently only for 2.6.9-xen0 and with a little too much manual intervention. It also compiles the rest of Xen + tools + docs without any problems, but doesn't quite know how to install them. Anyway, I should end up with something useful soon, so I'd be interested to know if anybody with Gentoo would be interested in testing/using it.

Quoted 2 lines

-- Keir

-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click

#4 lore raw

Jerome Brown wrote on 10/11/2004 01:38:

Quoted 1 line

I'm running Gentoo and would be very happy to test etc - I have been thinking about writing an ebuild myself, but haven't got around to it.

I've uploaded my current attempt at ebuilds to http://people.pwf.cam.ac.uk/pjt47/xentoo/ (and mentioned it at http://bugs.gentoo.org/show_bug.cgi?id=70161). I'm not sure whether anyone else has tried it yet, but it compiles fine for me and only crashes one in three times ;-)

Quoted 1 line

Jerome

Thanks,

Signature · 9 lines
Philip Taylor
[email protected]


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
#7 lore raw
In reply to a message not in the archive

I'm guessing you meant the kernel Makefile? If so, then that should solve the issue as I understand it - probably better to ask the devel list that question.

Jerome

Quoted 21 lines · Philip Taylor

I made the ebuild add "ARCH=xen" to the top of Makefile, which seems to remove the need for specifying it on the command line (because otherwise I forget and mess everything up, every single time I try to reconfigure it...) -- is that a safe/sensible thing to do, or would it be better to have users explicitly set ARCH when building?

Jerome Brown wrote on 14/11/2004 20:26:

Quoted 15 lines

A note on the install document - add ARCH="xen" to the xconfig line so it reads:
ARCH="xen" make xconfig
the compile may b0rk without it.

Jerome

Quoted 6 lines · Philip Taylor

Jerome Brown wrote on 10/11/2004 01:38:

Quoted 1 line

I'm running Gentoo and would be very happy to test etc - I have been thinking about writing an ebuild myself, but haven't got around to it.

I've uploaded my current attempt at ebuilds to http://people.pwf.cam.ac.uk/pjt47/xentoo/ (and mentioned it at http://bugs.gentoo.org/show_bug.cgi?id=70161). I'm not sure whether anyone else has tried it yet, but it compiles fine for me and only crashes one in three times ;-)

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8