[iPAQ] Re: Compiling Programs

From: Erik Mouw <J.A.K.Mouw.a.t.ITS.TUDelft.NL>
Date: Tue Jun 12 2001 - 19:41:43 EDT

On Tue, Jun 12, 2001 at 10:30:56PM +0100, Philip Blundell wrote:
> Unless and until somebody tries to build a kernel with -Os and reports on what
> goes wrong, we can only speculate. But, in my view, adding "hand
> optimisations" that presuppose a particular set of compiler options is fairly
> inexcusable.

Here is a kernel compiled with -O2:

-rwxr-xr-x 1 erik users 1230818 Jun 12 00:31 vmlinux-O2*
-rwxr-xr-x 1 erik users 438128 Jun 12 00:31 zImage-O2*

And here the same kernel with -Os:

-rwxr-xr-x 1 erik users 1214434 Jun 13 01:31 vmlinux*
-rwxr-xr-x 1 erik users 427104 Jun 13 01:31 zImage*

So uncompressed size is 16K (1.3%) smaller, and the compressed size is
11K (2.5%) smaller. Not really a big gain, and certainly not the gain
that Edward got for userland.

> Can you give specific examples of the constructs you think will
> work with -O2 but fail with -Os?

It's a well known issue that lots of macros in include/linux and
include/asm-arm will fail when not compiled with -O2. I haven't tried
this size optimised kernel yet, I'll give it a shot tomorrow. But in my
opinion using 16K less memory is not worth risking an unstable system.

Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2783635  Fax: +31-15-2781843  Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/
Received on Tue Jun 12 16:44:10 2001

This archive was generated by hypermail 2.1.8 : Tue May 04 2004 - 09:44:01 EDT