lkml.org 
[lkml]   [2003]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Why do some net drivers require __OPTIMIZE__?
On 6 Jan 2003, Alex Bennee wrote:

> Hi,
>
> I've been doing a bring up on an embedded kernel and to prevent gdb
> making me go google eyed I notched the optimization level down to -O0
> for the time being. This broke the natsemi network driver and I noticed
> this stanza appears in a few places:
>
> #if !defined(__OPTIMIZE__)
> #warning You must compile this file with the correct options!
> #warning See the last lines of the source file.
> #error You must compile this driver with "-O".
> #endif
>
> Despite the comments I couldn't see an explanation at the bottom of the
> source file and a quick google showed a few patches where this was
> removed but no explanation.
>
> Does anybody know the history behind those lines? Do they serve any
> purpose now or in the past? Should I be nervous about compiling the
> kernel at a *lower* than normal optimization level? After all
> optimizations are generally processor specific and shouldn't affect the
> meaning of the C.
>
> --
> Alex Bennee
> Senior Hacker, Braddahead Ltd
> The above is probably my personal opinion and may not be that of my
> employer

You need to optimize in order enable inline code generation. It is
essential to use in-line code in many places because, if the compiler
actually calls these functions they would have to be protected
from reentry.

Cheers,
Dick Johnson
Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).
Why is the government concerned about the lunatic fringe? Think about it.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.051 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site