| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| Hi all, I'm writing a module for Linux Kernel. That module is compiled from many files. General gcc optimization option for the hole kernel is - Os, but I want to use -O2 for one of my module's file source. How can I do it ? Thank you |
|
#2
|
| bossdboss-at-gmail.com wrote: > Hi all, > > I'm writing a module for Linux Kernel. That module is compiled from > many files. General gcc optimization option for the hole kernel is - > Os, but I want to use -O2 for one of my module's file source. > > How can I do it ? Would you care to tell why? What are you attempting to achieve? It seems to me that the code is sick in some way if it is dependent of the optimization level. -- Tauno Voipio tauno voipio (at) iki fi |
|
#3
|
| bossdboss-at-gmail.com writes: > Hi all, > > I'm writing a module for Linux Kernel. That module is compiled from > many files. General gcc optimization option for the hole kernel is - > Os, but I want to use -O2 for one of my module's file source. > > How can I do it ? By subscribing to the linux-kernel mailing list, where all your questions regarding kernel module building will be read by thousands of people who, for the most part of their day, do nothing except build kernel modules. See http://www.kernel.org/pub/linux/docs/lkml/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBHDVQGx9p3GYHlUOIRAo9pAJ9VBq+0mmCAtRRbr0PHFu UHFAmDmQCfa+N4 gItofnyyYZfcKSDHSqlnl2U= =Paeo -----END PGP SIGNATURE----- |
|
#4
|
| On 10 oct, 23:10, Tauno Voipio > bossdb...@gmail.com wrote: > > Hi all, > > > I'm writing a module for Linux Kernel. That module is compiled from > > many files. General gcc optimization option for the hole kernel is - > > Os, but I want to use -O2 for one of my module's file source. > > > How can I do it ? > > Would you care to tell why? What are you > attempting to achieve? > > It seems to me that the code is sick in some > way if it is dependent of the optimization > level. > > -- > > Tauno Voipio > tauno voipio (at) iki fi Why I need to do so is not very important, but if you want to know, the performances of code in that file is critical and works better compiled with -O2 rather than -Os. |
|
#5
|
| bossdboss-at-gmail.com wrote: > On 10 oct, 23:10, Tauno Voipio > >>bossdb...@gmail.com wrote: >> >>>Hi all, >> >>>I'm writing a module for Linux Kernel. That module is compiled from >>>many files. General gcc optimization option for the hole kernel is - >>>Os, but I want to use -O2 for one of my module's file source. >> >>>How can I do it ? >> >>Would you care to tell why? What are you >>attempting to achieve? >> >>It seems to me that the code is sick in some >>way if it is dependent of the optimization >>level. >> >>-- >> >>Tauno Voipio >>tauno voipio (at) iki fi > > > Why I need to do so is not very important, but if you want to know, > the performances of code in that file is critical and works better > compiled with -O2 rather than -Os. If it is so critical, use the embedded assembler for the innermost loop and let the rest compile as usual. Do you realize that even a driver code may be interfered with an interrupt if the interrupts are not disabled? You are probably doing something in the wrong way, or the something is not actually doable in software only (needs hardware assistance). -- Tauno Voipio tauno voipio (at) iki fi |
![]() |
| Thread Tools | |
| Display Modes | |