Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

Need "wrapper" to compile the Linux kernel with ICC

TyMac
Beginner
5,000 Views

I am a developer with an idea to start a new kernel source for Gentoo that is specifically for the Intel ICC compiler. Evidentally there is a "wrapper" that is needed to be applied to the kernel source first before ICC can correctly complie the Linux kernel. Where can I get this wrapper? (I have looked all over the web but the only yhing I can find is old documentation)

0 Kudos
131 Replies
Feilong_H_Intel
Employee
870 Views
Quoting - thaidog

Is our kernel able to use IPO at all now?

I didn't get a chance toturn onIPO with 10.1or 11.0 compiler yet. I'll try it for sure some time later. If you see any problem with IPO, please let me know.
0 Kudos
TyMac
Beginner
870 Views
Quoting - (Intel)
Quoting - thaidog

Is our kernel able to use IPO at all now?

I didn't get a chance toturn onIPO with 10.1or 11.0 compiler yet. I'll try it for sure some time later. If you see any problem with IPO, please let me know.

Ok will do! :)
0 Kudos
TyMac
Beginner
870 Views
Quoting - (Intel)

I didn't get a chance toturn onIPO with 10.1or 11.0 compiler yet. I'll try it for sure some time later. If you see any problem with IPO, please let me know.

me and newper were talking... it apeears there have been some changes:

"Something about IPO:
According to intel's doc,icc8 has an option called -ipo_obj,that
forces the compiler to create real object files when used with
-ipo,but now this option disappeared.
I tried to undef inline in the compiler-intel.h,but it seem has no use."

Is that going to be an issue?

0 Kudos
TyMac
Beginner
870 Views
FYI I just started a Google Group for this:

http://groups.google.com/group/linuxdna
0 Kudos
TyMac
Beginner
870 Views
I would also like to announce that our project LinuxDNA now has an offical partnership wth Dream Linux! If you have not tried Dream Linux you should download it. You will never have to go back to Windows once you do! We will be crating an ICC optimized version of Dream Linux for Atom based netbooks like the Asus Eee PC! Since there are no GCC specific optimizations available for the Atom cpu our Dream Linux build will be the fastest thing out there period! Pleas join our Google group if you would like to contribute and be a part of our team!
0 Kudos
TyMac
Beginner
870 Views
Quoting - bustaf

Hi
you have fault syntax in your link
Is wrote http://www.lnuxdna.com/icc_dev_vm.tar.lzma
But are
http://www.linuxdna.com/icc_dev_vm.tar.lzma
Also
I am sorry that i can not make immediately
I have an task with RS/6000 AIX must be finished this week
Best regards


bustaf:

I was wondering if you see ny freexes with SuSE? I have reports that onDemend cpu freq scaling is not available with compiling on SuSE and that they are getting radom freezes. I have no idea why this would be happending... they are a linux newbie however.

Are you seeing anything like that on SuSE or OpenSuSE?
0 Kudos
beartung
Beginner
870 Views
[cpp]my wrapper
ARGS=$@ # Add "-gcc" in the prevention of icc.cfg have "-no-gcc" ICCARGS="-fno-builtin -gcc" if [ -z "$ICC" ] then ICC=icc fi if [ -z "$GCC" ] then GCC=gcc fi for ARG in $@ do case $ARG in -fno-stack-protector ) ICCARGS="$ICCARGS -fno-stack-security-check" ;; -O2 | -O3 ) ICCARGS="$ICCARGS -O2" ;; -v ) $ICC --version 2>&1 | grep "icc" exit 0 ;; */boot/* ) $GCC $ARGS exit $? ;; # ignore these gcc options -fno-unit-at-a-time | -fno-inline | -g | -gstabs |-maccumulate-outgoing-args|-mno-3dnow|-mno-mmx | -mno-sse | -mno-sse2 |-mpreferred-stack-boundary=2 |-msoft-float | -nostdinc | -pipe | -Wall | -Werror | -Wno-pointer-sign ) ;; * ) ICCARGS="$ICCARGS $ARG" ;; esac done $ICC $ICCARGS exit $?
[/cpp]
my kernel is 2.6.28.8, icc is 11.081.

what i have modified:
Makefile
script/Makefile.build
script/Makefile.modpost
add /opt/intel/Compiler/11.0/081/lib/ia32/libirc_s.a

include/linux/compiler-intel.h
add #undef __compiler_offsetof


then i make CC=kicc HOSTCC=kicc LD=xild AR=xiar V=1 bzImage

bzImage is ok, but when i make modules, i got this:
Building modules, stage 2.
make -f /usr/src/linux-2.6.28.8-icc/scripts/Makefile.modpost
scripts/mod/modpost -o /usr/src/linux-2.6.28.8-icc/Module.symvers -S -K /usr/src/linux-2.6.28.8-icc/Module.markers -M /usr/src/linux-2.6.28.8-icc/Module.markers -s
ERROR: "snd_pcm_format_width" [sound/pci/hda/snd-hda-intel.ko] undefined!
ERROR: "kmalloc_caches" [sound/pci/hda/snd-hda-intel.ko] undefined!
ERROR: "pci_bus_read_config_byte" [sound/pci/hda/snd-hda-intel.ko] undefined!
ERROR: "__kmalloc" [sound/pci/hda/snd-hda-intel.ko] undefined!
ERROR: "msleep" [sound/pci/hda/snd-hda-intel.ko] undefined!
....
ERROR: "kmalloc_caches" [arch/x86/kernel/test_nx.ko] undefined!
ERROR: "printk" [arch/x86/kernel/test_nx.ko] undefined!
WARNING: modpost: Found 14 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
make[1]: *** [__modpost] 1
make: *** [modules] 2

so, anyone have got the same problem? need help.

Thanks

Quoting - thaidog

bustaf:

I was wondering if you see ny freexes with SuSE? I have reports that onDemend cpu freq scaling is not available with compiling on SuSE and that they are getting radom freezes. I have no idea why this would be happending... they are a linux newbie however.

Are you seeing anything like that on SuSE or OpenSuSE?

0 Kudos
newper
Beginner
870 Views
Find
#define __EXPORT_SYMBOL(sym, sec)
extern typeof(sym) sym;
__CRC_SYMBOL(sym, sec)
static const char __kstrtab_##sym[]
__attribute__((section("__ksymtab_strings"), aligned(1)))
= MODULE_SYMBOL_PREFIX #sym;
static const struct kernel_symbol __ksymtab_##sym
__used
__attribute__((section("__ksymtab" sec), unused))
= { (unsigned long)&sym, __kstrtab_##sym }
in include/linux/module.h
remove 'static',before const char __kstrtab_##sym[] and const struct kernel_symbol __ksymtab_##sym
0 Kudos
beartung
Beginner
870 Views
thanks!

i tried. bzImage is ok, modules get a new error!

[shell]Building modules, stage 2.
make -f /usr/src/linux-2.6.28.8/scripts/Makefile.modpost
  scripts/mod/modpost   -o /usr/src/linux-2.6.28.8/Module.symvers    -S -K /usr/src/linux-2.6.28.8/Module.markers -M /usr/src/linux-2.6.28.8/Module.markers   -s
ERROR: "__bad_udelay" [drivers/net/e1000e/e1000e.ko] undefined!
WARNING: modpost: Found 14 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
[/shell]


Quoting - newper
Find
#define __EXPORT_SYMBOL(sym, sec)
extern typeof(sym) sym;
__CRC_SYMBOL(sym, sec)
static const char __kstrtab_##sym[]
__attribute__((section("__ksymtab_strings"), aligned(1)))
= MODULE_SYMBOL_PREFIX #sym;
static const struct kernel_symbol __ksymtab_##sym
__used
__attribute__((section("__ksymtab" sec), unused))
= { (unsigned long)&sym, __kstrtab_##sym }
in include/linux/module.h
remove 'static',before const char __kstrtab_##sym[] and const struct kernel_symbol __ksymtab_##sym

0 Kudos
beartung
Beginner
870 Views
i used the icc kernel and gcc modules boot

it looks like everything is ok ....

but i want to know how to build the modules using icc?

Quoting - beartung


0 Kudos
beartung
Beginner
870 Views
i found two symbols which kernel not defined...

nm vmlinux-icc|grep ' U ':
U ____ilog2_NaN
U __bad_udelay

so when i make modules got error:

ERROR: "__bad_udelay" [drivers/net/e1000e/e1000e.ko] undefined!



Quoting - beartung


0 Kudos
newper
Beginner
870 Views
Try this,though it's really not a good solution
Open arch/x86/include/asm/delay.h
Delete these:

extern void __bad_udelay(void);
extern void __bad_ndelay(void);

(n) > 20000 ? __bad_udelay() :

(n) > 20000 ? __bad_ndelay() :
0 Kudos
Feilong_H_Intel
Employee
870 Views
Quoting - newper
Try this,though it's really not a good solution
Open arch/x86/include/asm/delay.h
Delete these:

extern void __bad_udelay(void);
extern void __bad_ndelay(void);

(n) > 20000 ? __bad_udelay() :

(n) > 20000 ? __bad_ndelay() :

newper's workaround should work. Thanks newper.

Feilong
0 Kudos
beartung
Beginner
870 Views
thanks newper and Feilong

i have changed icc to 10.1.022, both kernel and modules built. it works well : )

i will try icc 11 using your way too.

Quoting - Feilong H. (Intel)

newper's workaround should work. Thanks newper.

Feilong

0 Kudos
TyMac
Beginner
870 Views
Feilong we have someone wanting to compile an IA64 kernel... you have done that before right?
0 Kudos
Feilong_H_Intel
Employee
844 Views
Quoting - thaidog
Feilong we have someone wanting to compile an IA64 kernel... you have done that before right?

Didyou meant to say Intel 64 or IA-64 (Itanium)?
0 Kudos
TyMac
Beginner
844 Views
Quoting - thaidog
Feilong we have someone wanting to compile an IA64 kernel... you have done that before right?

Didyou meant to say Intel 64 or IA-64 (Itanium)?

I think he means Itanium.
0 Kudos
Feilong_H_Intel
Employee
844 Views
Quoting - thaidog

I think he means Itanium.

I compiled 2.6.9 kernel for IA-64 with icc 9.1 a few years ago. Due to my resource limitation, I didn't work on IA-64 kernel since then. The most part of the patch file is replacing inline asm code with intrinsics because icc for IA-64 doesn't support inline asm. If you are interested in compiling an IA-64 kernel, i'd be happy to assist you.
0 Kudos
TyMac
Beginner
844 Views
Quoting - thaidog

I think he means Itanium.

I compiled 2.6.9 kernel for IA-64 with icc 9.1 a few years ago. Due to my resource limitation, I didn't work on IA-64 kernel since then. The most part of the patch file is replacing inline asm code with intrinsics because icc for IA-64 doesn't support inline asm. If you are interested in compiling an IA-64 kernel, i'd be happy to assist you.

Well I do not have an Itanium cpu to test on but I will forward this to LuYi since he got the e-mail rom the person who wanted to try :)
0 Kudos
TyMac
Beginner
844 Views
Feilong I have been trying to get in touch with somebody at Intel about our project. We have a full LiveCD based in ICC that is ready to go but we do not have a Professional compiler license so we can not distrbute it. I was hoping that Intel would help us out with this due to the popilarity of the project.

Do you have somebody on the "inside" we could talk to about this project?
0 Kudos
melayuboleh
Beginner
844 Views
Quoting - thaidog

I am a developer with an idea to start a new kernel source for Gentoo that is specifically for the Intel ICC compiler. Evidentally there is a "wrapper" that is needed to be applied to the kernel source first before ICC can correctly complie the Linux kernel. Where can I get this wrapper? (I have looked all over the web but the only yhing I can find is old documentation)


i hope this post will help you,

http://www.gentoo-wiki.info/HOWTO_ICC_and_Portage

and

http://www.intel.com/cd/software/products/asmo-na/eng/compilers/284264.htm

Hope it help as your reference
0 Kudos
Reply