[ltp] two questions -- 600E / X / RAM

Haynie, Michael B linux-thinkpad@www.bm-soft.com
Fri, 19 Apr 2002 09:39:49 -0400


The business of selecting a compiler upon which to build a system involves a
number of fairly separable issues. 

The kernel and core system libraries are written entirely in C. C++ linkage
and run-time startup conventions are sufficiently unstable that creating a
kernel using them would be a dicey proposition - not impossible, but not
entirely straight-forward. So, it's the C compiler and code generator that
are of primary interest on that point.

The compiler should generate decent and stable code for the particular chip.
GCC is pretty flexible, but you need a good RTL description of the chip with
good timing, to make good choices. I also think GCC could use some
code-generator elements that make greater use of modern RISC features like
multiple pipelines and instruction over-laping. That is a particularly hard
thing to do. I could be mistaken about whether GCC has those features
though. One expects that the intel compiler has the required support, but
only for Intel chips, and in some non-extendable framework.

The code base should not rely on particular variations on undefined behavior
or local extensions to the language (C - with a minimum of assembly). The
Linux kernel had that mis-feature at one point. I'm not sure if it still
does or not. That was one of the reasons for the long delay in moving from
2.7.x to 2.9x.

Now, with respect to selecting a C++ compiler, it is only required that it
be link-compatible with the C compiler, when linking in C routines. You may
have seen this during the 2.0.x age, when the kernel required 2.7.x, but
many user-land C++ programs required 2.8 or 2.9. That's another reason to
keep C++ out of the kernel, btw. Had C++ been in the kernel, we'd have a
much harder time changing linkage conventions.

Separately from linkage with the system, you choose a compiler that supports
C++ features in the target code base. At the moment, there are *NO*
standard-conforming C++ compilers. Every compiler has its own set of quirks.
So; making code work on multiple compilers takes some effort. One problem
I've seen is that neophyte C++ coders with limited cross-compiler experience
begin to take the particular compiler features as gospel. After a while, it
becomes really difficult to port the code to another compiler, even on the
same platform.

OK - that's a little longer than I intended, and almost totally off-topic.
Hope it helps.

--Michael
"For every thousand hacking at the leaves of evil, there is one striking at
the root."
		- Henry David Thoreau


	-----Original Message-----
	From:	Tim Prince [SMTP:tprince@computer.org]
	Sent:	Friday, April 19, 2002 9:10 AM
	To:	linux-thinkpad@www.bm-soft.com; Dean L. Hedin; Tino Keitel
	Subject:	Re: [ltp] two questions -- 600E / X / RAM

	On Tuesday 16 April 2002 09:59, Dean L. Hedin wrote:
	> > I read that the recently
	> > released Intel C++ compiler produces code that is 300% faster on
the
	> > average. Unfortunately, the shared libraries compiled with the
Intel
	> > compiler won't work with executables compiled with GCC. You must
	> > recompile your whole C++ stuff to use it, which is hard since
there are
	> > source code incompatibilties between GCC and Intel C++. So you
can only
	> > dream of a KDE that is three times faster. :-)
	>
	> I wonder if there are any efforts underway to make an entire
distro based
	> off of the new Intel compiler.   I understand the same
incompatabilities
	> between the Intel compiler and gcc also prevent builing a linux
kernel with
	> it.
	My impression was the kernel didn't use C++, so the differences
between older 
	g++ compilers and current standards aren't relevant.  I didn't see
any C++ 
	there myself.  Goals have been set to make the linux kernel build
with Intel 
	C on both ia32 and ia64; the older free versions of Intel C won't do
it.  I 
	don't know what you mean by "same incompatabilities."

	-- 
	Tim Prince

	----- The Linux ThinkPad mailing list -----
	The linux-thinkpad mailing list home page is at:
	http://www.bm-soft.com/~bm/tp_mailing.html

----- The Linux ThinkPad mailing list -----
The linux-thinkpad mailing list home page is at:
http://www.bm-soft.com/~bm/tp_mailing.html