Forum Jump

Select Group :
Select Forum :
Sorted By :
Sort Order :
From The :
 
Thread Tools  Search this thread 
thaidog
Total Points:
1,430
Status Points:
930
Brown Belt
November 14, 2008 12:16 PM PST
Need "wrapper" to compile the Linux kernel with ICC

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)

zhenhua.zhang
Total Points:
80
Status Points:
30
Green Belt
November 14, 2008 7:16 PM PST
Rate
 
#1
You could find 'Linux kernel build white paper with 10.0 compiler' in below URLs. In the bottom of that page, there is another paper discussion the compatibility with GNU Compilers may be also useful for you.

http://www.intel.com/support/performancetools/c/linux/sb/cs-007713.htm



thaidog
Total Points:
1,430
Status Points:
930
Brown Belt
November 15, 2008 2:29 PM PST
Rate
 
#2 Reply to #1
Quoting - zhenhua.zhang
You could find 'Linux kernel build white paper with 10.0 compiler' in below URLs. In the bottom of that page, there is another paper discussion the compatibility with GNU Compilers may be also useful for you.

http://www.intel.com/support/performancetools/c/linux/sb/cs-007713.htm

Yes I have read this paper... it deos not give a link to the wrapper it talks about however. Here is a link that has sme older wrappers:

 

http://www.pyrillion.org/index.html?showframe=linuxkernelpatch.html

 

I have not tried them however because I think they are too old to work with a 2.6.2* kernel.



YannGolanski
Total Points:
640
Status Points:
140
Brown Belt
November 17, 2008 5:29 AM PST
Rate
 
#3
Quoting - thaidog

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

 


--------
Nescire autem quid ante quam natus sis acciderit, id est semper esse puerum. Quid enim est aetas hominis, nisi ea memoria rerum veterum cum superiorum aetate contexitur?


thaidog
Total Points:
1,430
Status Points:
930
Brown Belt
November 17, 2008 2:01 PM PST
Rate
 
#4 Reply to #3
Quoting - nanometrics

 

Looks like your post did not go through...



Feilong H. (Intel)
Total Points:
1,697
Status Points:
1,197
Brown Belt
November 17, 2008 10:04 PM PST
Rate
 
#5
Quoting - thaidog

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

Hi thaidog, were you asking for a wrapper for 2.6.xx kernel on IA32?  I can share one for 10.x compiler with you.  I didn't test with 11.0 compiler yet.



thaidog
Total Points:
1,430
Status Points:
930
Brown Belt
November 18, 2008 6:55 AM PST
Rate
 
#6 Reply to #5

Hi thaidog, were you asking for a wrapper for 2.6.xx kernel on IA32?  I can share one for 10.x compiler with you.  I didn't test with 11.0 compiler yet.

That would be awsome! I am using the 10 version right now since that is what is available in portage. That is the exact one I am looking for... IA32.



Feilong H. (Intel)
Total Points:
1,697
Status Points:
1,197
Brown Belt
November 18, 2008 11:41 PM PST
Rate
 
#7 Reply to #6

The following is an example of wrapper script.  Please try it with a newer update of icc 10.1.

 

#--------------------------------------------------------

# This is a wrapper script for icc 10.1 on IA-32

#--------------------------------------------------------

ARGS=$@

ICCARGS="-fno-builtin"

 

# For loop to change options of icc

for ARG in $@

do

case $ARG in

-fno-stack-protector  )

     ICCARGS="$ICCARGS -fno-stack-security-check"

     ;;

 

-Wno-pointer-sign | -msoft-float | -ffreestanding )

     ;;

 

* )

     ICCARGS="$ICCARGS $ARG"

     ;;

esac

done

 

icc $ICCARGS

 

exit $?



YannGolanski
Total Points:
640
Status Points:
140
Brown Belt
November 19, 2008 7:45 AM PST
Rate
 
#8 Reply to #3
Quoting - nanometrics

 

Bummer.

 

I tried to compile the linux kernel with ICC and got into a horrible mess.  I think it is way too embedded with GCC for it to work but if you managed to get it working, I would be VERY interested.

If you need a hand, please ask.


--------
Nescire autem quid ante quam natus sis acciderit, id est semper esse puerum. Quid enim est aetas hominis, nisi ea memoria rerum veterum cum superiorum aetate contexitur?


thaidog
Total Points:
1,430
Status Points:
930
Brown Belt
November 19, 2008 8:21 AM PST
Rate
 
#9 Reply to #7

The following is an example of wrapper script.  Please try it with a newer update of icc 10.1.

#--------------------------------------------------------

# This is a wrapper script for icc 10.1 on IA-32

#--------------------------------------------------------

ARGS=$@

ICCARGS="-fno-builtin"

# For loop to change options of icc

for ARG in $@

do

case $ARG in

-fno-stack-protector )

ICCARGS="$ICCARGS -fno-stack-security-check"

;;

-Wno-pointer-sign | -msoft-float | -ffreestanding )

;;

* )

ICCARGS="$ICCARGS $ARG"

;;

esac

done

icc $ICCARGS

exit $?

Well I've got version 10.0. Not sure where to find 10.1. I got this error when trying to do it with 10.0:

gentoo_x86_32 ~ # cd /usr/src/linux
gentoo_x86_32 linux # nano intelwrapper
gentoo_x86_32 linux # make HOSTCC=intelwrapper CC=intelwrapper
/usr/src/linux-2.6.25-gentoo-r7/scripts/gcc-version.sh: line 25: intelwrapper: command not found
/usr/src/linux-2.6.25-gentoo-r7/scripts/gcc-version.sh: line 26: intelwrapper: command not found
make: intelwrapper: Command not found
CHK     include/linux/version.h
CHK     include/linux/utsrelease.h
HOSTCC  scripts/basic/fixdep
/bin/sh: intelwrapper: command not found
make[1]: *** [scripts/basic/fixdep] Error 127
make: *** [scripts_basic] Error 2
gentoo_x86_32 linux #

EDIT: whoops... I did not put it in my path... that's what that error is.



thaidog
Total Points:
1,430
Status Points:
930
Brown Belt
November 19, 2008 4:33 PM PST
Rate
 
#10 Reply to #8
Quoting - nanometrics
Quoting - nanometrics

 

Bummer.

 

I tried to compile the linux kernel with ICC and got into a horrible mess.  I think it is way too embedded with GCC for it to work but if you managed to get it working, I would be VERY interested.

If you need a hand, please ask.

A hand would be great. I have version 10 not 10.1. Do you know where to get 10.1? I got the wrapper working... but after a few min it errored:


make[1]: *** [arch/x86/vdso/vdso32-int80.so.dbg] Error 1
make: *** [arch/x86/vdso] Error 2

Other people at the gentoo forums are trying it but they are running in to similar issues.



Feilong H. (Intel)
Total Points:
1,697
Status Points:
1,197
Brown Belt
November 19, 2008 6:45 PM PST
Rate
 
#11 Reply to #10
Login to https://registrationcenter.intel.com, then download 10.1 compiler.
 
I successfully built a kernel (that is very close to RHEL5 kernel) with the above wrapper script.  A few source code patches are needed.  Could you please show me a few more lines in your build log, so that I can see what the problem is?
 
Let me try to list all patches you might need to apply to your kernel source code.
  • add the following line at the end of include/linux/compiler-intel.h.
    #undef __compiler_offsetof
  • arch/i386/kernel/apm.c, remove "static"
    staticstruct {
      unsigned long offset;
      unsigned short segment;
     }    apm_bios_entry;
  • include/linux/module.h, remove "static"
    staticconst unsigned long __kcrctab_##sym \
    __attribute_used__ \
    __attribute__((section("__kcrctab" sec), unused)) \
    = (unsigned long) &__crc_##sym;
    ...
    #define __EXPORT_SYMBOL(sym, sec) \
    extern typeof(sym) sym; \
    __CRC_SYMBOL(sym, sec) \
    staticconst char __kstrtab_##sym[] \
    __attribute__((section("__ksymtab_strings"))) \
    = MODULE_SYMBOL_PREFIX #sym; \
    staticconst struct kernel_symbol __ksymtab_##sym \
    __attribute_used__ \
    __attribute__((section("__ksymtab" sec), unused)) \
    = { (unsigned long)&sym, __kstrtab_##sym }
  • Makefile, add libirc_s.a as follow.
    --start-group $(vmlinux-main) /opt/intel/cc/10.1.021/lib/libirc_s.a --end-group                  \


thaidog
Total Points:
1,430
Status Points:
930
Brown Belt
November 20, 2008 8:56 AM PST
Rate
 
#12 Reply to #11
Login to https://registrationcenter.intel.com, then download 10.1 compiler.
I successfully built a kernel (that is very close to RHEL5 kernel) with the above wrapper script.  A few source code patches are needed.  Could you please show me a few more lines in your build log, so that I can see what the problem is?
Let me try to list all patches you might need to apply to your kernel source code.
  • add the following line at the end of include/linux/compiler-intel.h.
    #undef __compiler_offsetof
  • arch/i386/kernel/apm.c, remove "static"
    staticstruct {
    unsigned long offset;
    unsigned short segment;
    }    apm_bios_entry;
  • include/linux/module.h, remove "static"
    staticconst unsigned long __kcrctab_##sym \
    __attribute_used__ \
    __attribute__((section("__kcrctab" sec), unused)) \
    = (unsigned long) &__crc_##sym;
    ...
    #define __EXPORT_SYMBOL(sym, sec) \
    extern typeof(sym) sym; \
    __CRC_SYMBOL(sym, sec) \
    staticconst char __kstrtab_##sym[] \
    __attribute__((section("__ksymtab_strings"))) \
    = MODULE_SYMBOL_PREFIX #sym; \
    staticconst struct kernel_symbol __ksymtab_##sym \
    __attribute_used__ \
    __attribute__((section("__ksymtab" sec), unused)) \
    = { (unsigned long)&sym, __kstrtab_##sym }
  • Makefile, add libirc_s.a as follow.
    --start-group $(vmlinux-main) /opt/intel/cc/10.1.021/lib/libirc_s.a --end-group                  \

I got the update to 10.1 but it died again (I have not had a chance to try those changes you added in the post above yet though) Here is the build log about 50 lines to the bottom:

 

kernel/pid.c(215): warning #1419: external declaration in primary source file
EXPORT_SYMBOL_GPL(put_pid);
^

kernel/pid.c(266): warning #188: enumerated type mixed with another type
for (type = 0; type < PIDTYPE_MAX; ++type)
^

kernel/pid.c(297): error: subscript must be constant
return container_of(pnr, struct pid,
^

kernel/pid.c(302): warning #1419: external declaration in primary source file
EXPORT_SYMBOL_GPL(find_pid_ns);
^

kernel/pid.c(308): warning #1419: external declaration in primary source file
EXPORT_SYMBOL_GPL(find_vpid);
^

kernel/pid.c(314): warning #1419: external declaration in primary source file
EXPORT_SYMBOL_GPL(find_pid);
^

kernel/pid.c(366): error: subscript must be constant
result = hlist_entry(first, struct task_struct, pids[(type)].node);
^

kernel/pid.c(370): warning #1419: external declaration in primary source file
EXPORT_SYMBOL(pid_task);
^

kernel/pid.c(378): warning #188: enumerated type mixed with another type
return pid_task(find_pid_ns(nr, ns), type);
^

kernel/pid.c(381): warning #1419: external declaration in primary source file
EXPORT_SYMBOL(find_task_by_pid_type_ns);
^

kernel/pid.c(387): warning #1419: external declaration in primary source file
EXPORT_SYMBOL(find_task_by_pid);
^

kernel/pid.c(394): warning #1419: external declaration in primary source file
EXPORT_SYMBOL(find_task_by_vpid);
^

kernel/pid.c(400): warning #1419: external declaration in primary source file
EXPORT_SYMBOL(find_task_by_pid_ns);
^

kernel/pid.c(450): warning #1419: external declaration in primary source file
EXPORT_SYMBOL_GPL(pid_vnr);
^

kernel/pid.c(456): warning #1419: external declaration in primary source file
EXPORT_SYMBOL(task_pid_nr_ns);
^

kernel/pid.c(462): warning #1419: external declaration in primary source file
EXPORT_SYMBOL(task_tgid_nr_ns);
^

kernel/pid.c(468): warning #1419: external declaration in primary source file
EXPORT_SYMBOL(task_pgrp_nr_ns);
^

kernel/pid.c(474): warning #1419: external declaration in primary source file
EXPORT_SYMBOL(task_session_nr_ns);
^

kernel/pid.c(494): warning #1419: external declaration in primary source file
EXPORT_SYMBOL_GPL(find_get_pid);
^

kernel/pid.c(501): warning #1418: external function definition with no prior declaration
void __init pidhash_init(void)
^

kernel/pid.c(512): remark #181: argument is incompatible with corresponding format string conversion
pidhash_size * sizeof(struct hlist_head));
^

kernel/pid.c(521): warning #1418: external function definition with no prior declaration
void __init pidmap_init(void)
^

compilation aborted for kernel/pid.c (code 2)
make[1]: *** [kernel/pid.o] Error 2
make: *** [kernel] Error 2



thaidog
Total Points:
1,430
Status Points:
930
Brown Belt
November 20, 2008 10:26 AM PST
Rate
 
#13 Reply to #11

 

For the following line:

  • arch/i386/kernel/apm.c, remove "static"
    staticstruct {
    unsigned long offset;
    unsigned short segment;
    }    apm_bios_entry;

I do not have that directory: /usr/src/linux/arch/i386/kernel/

I have:

/usr/src/linux/arch/i386/boot

 

(Where bzImage is storred)

I made the other modifications and the kernel seemsed to compile to the very end and then it errored:

compilation aborted for arch/x86/boot/mca.c (code 2)
make[1]: *** [arch/x86/boot/mca.o] Error 2
make: *** [bzImage] Error 2

#################################################################################

Here is build log about 50 lines to the bottom:

static inline int memcmp(const void *s1, const void *s2, size_t len)
^

arch/x86/boot/boot.h(174): remark #593: parameter "len" was set but never used
static inline int memcmp(const void *s1, const void *s2, size_t len)
^

arch/x86/boot/boot.h(182): remark #593: parameter "s1" was set but never used
static inline int memcmp_fs(const void *s1, addr_t s2, size_t len)
^

arch/x86/boot/boot.h(182): remark #593: parameter "s2" was set but never used
static inline int memcmp_fs(const void *s1, addr_t s2, size_t len)
^

arch/x86/boot/boot.h(182): remark #593: parameter "len" was set but never used
static inline int memcmp_fs(const void *s1, addr_t s2, size_t len)
^

arch/x86/boot/boot.h(189): remark #593: parameter "s1" was set but never used
static inline int memcmp_gs(const void *s1, addr_t s2, size_t len)
^

arch/x86/boot/boot.h(189): remark #593: parameter "s2" was set but never used
static inline int memcmp_gs(const void *s1, addr_t s2, size_t len)
^

arch/x86/boot/boot.h(189): remark #593: parameter "len" was set but never used
static inline int memcmp_gs(const void *s1, addr_t s2, size_t len)
^

arch/x86/boot/main.c(66): remark #593: variable "ax" was set but never used
u16 ax = 0x0305;
^

arch/x86/boot/main.c(67): remark #593: variable "bx" was set but never used
u16 bx = 0;
^

arch/x86/boot/main.c(122): warning #1079: return type of function "main" must be "int"
void main(void)
^

IPO: WARNING: File scope asm disables -ipo
CC      arch/x86/boot/mca.o
icc: command line warning #10006: ignoring unknown option '-fno-toplevel-reorder'
arch/x86/boot/boot.h(174): remark #593: parameter "s1" was set but never used
static inline int memcmp(const void *s1, const void *s2, size_t len)
^

arch/x86/boot/boot.h(174): remark #593: parameter "s2" was set but never used
static inline int memcmp(const void *s1, const void *s2, size_t len)
^

arch/x86/boot/boot.h(174): remark #593: parameter "len" was set but never used
static inline int memcmp(const void *s1, const void *s2, size_t len)
^

arch/x86/boot/boot.h(182): remark #593: parameter "s1" was set but never used
static inline int memcmp_fs(const void *s1, addr_t s2, size_t len)
^

arch/x86/boot/boot.h(182): remark #593: parameter "s2" was set but never used
static inline int memcmp_fs(const void *s1, addr_t s2, size_t len)
^

arch/x86/boot/boot.h(182): remark #593: parameter "len" was set but never used
static inline int memcmp_fs(const void *s1, addr_t s2, size_t len)
^

arch/x86/boot/boot.h(189): remark #593: parameter "s1" was set but never used
static inline int memcmp_gs(const void *s1, addr_t s2, size_t len)
^

arch/x86/boot/boot.h(189): remark #593: parameter "s2" was set but never used
static inline int memcmp_gs(const void *s1, addr_t s2, size_t len)
^

arch/x86/boot/boot.h(189): remark #593: parameter "len" was set but never used
static inline int memcmp_gs(const void *s1, addr_t s2, size_t len)
^

arch/x86/boot/mca.c(29): error: register "ax" used more than once
: "=acd" (err), "=acdSD" (es), "=b" (bx)
^

arch/x86/boot/mca.c(29): error: register "cx" used more than once
: "=acd" (err), "=acdSD" (es), "=b" (bx)
^

arch/x86/boot/mca.c(29): error: register "dx" used more than once
: "=acd" (err), "=acdSD" (es), "=b" (bx)
^

compilation aborted for arch/x86/boot/mca.c (code 2)
make[1]: *** [arch/x86/boot/mca.o] Error 2
make: *** [bzImage] Error 2

#####################################################################

Also I had to use:

*Makefile, add libirc_s.a as follow.

--start-group $(vmlinux-main) /opt/intel/cc/10.1.018/lib/libirc_s.a --end-group                  \

 

Instead of:

*Makefile, add libirc_s.a as follow.

--start-group $(vmlinux-main) /opt/intel/cc/10.1.021/lib/libirc_s.a --end-group                  \

 



Feilong H. (Intel)
Total Points:
1,697
Status Points:
1,197
Brown Belt
November 21, 2008 12:32 AM PST
Rate
 
#14 Reply to #13
I don't have arch/x86/boot/main.c in my source code.  It looks the error are coming from an inline assembly code.  If you can extract that piece of code and create a small test case for me to reproduce the error, that'll be great.
If there is no way to create a smaller test case, could you please preprocess it with proper command line and upload the preprocessed code, so that I can look into it?
In order to extract the command line for arch/x86/boot/main.c, just issue "make HOSTCC=intelwrapper CC=intelwrapper V=1".  It will print command lines along with various warnings & errors.  Find the command line for arch/x86/boot/main.c and replace -c with -E.  Re-run the command line and the compiler will print preprocessed C code.

 



thaidog
Total Points:
1,430
Status Points:
930
Brown Belt
November 21, 2008 11:24 AM PST
Rate
 
#15 Reply to #14
I don't have arch/x86/boot/main.c in my source code.  It looks the error are coming from an inline assembly code.  If you can extract that piece of code and create a small test case for me to reproduce the error, that'll be great.
If there is no way to create a smaller test case, could you please preprocess it with proper command line and upload the preprocessed code, so that I can look into it?
In order to extract the command line for arch/x86/boot/main.c, just issue "make HOSTCC=intelwrapper CC=intelwrapper V=1".  It will print command lines along with various warnings & errors.  Find the command line for arch/x86/boot/main.c and replace -c with -E.  Re-run the command line and the compiler will print preprocessed C code.

 

Are these the lines you are talking about?

arch/x86/boot/main.c(66): remark #593: variable "ax" was set but never used
u16 ax = 0x0305;
^

arch/x86/boot/main.c(67): remark #593: variable "bx" was set but never used
u16 bx = 0;
^

arch/x86/boot/main.c(122): warning #1079: return type of function "main" must be "int"
void main(void)
^
############################################

I did a: cat arch/x86/boot/main.c but I did not see a -c to replace with the -E

 

Maybe I am not understanding you correcty?

EDIT: If you would like I can give you access to the development box via ssh and sudo acct?



Feilong H. (Intel)
Total Points:
1,697
Status Points:
1,197
Brown Belt
November 24, 2008 1:57 AM PST
Rate
 
#16 Reply to #15
thaidog,
You need to do "make HOSTCC=intelwrapper CC=intelwrapper V=1".  In the build log, try to find a command line like
intelwrapper <a lot of compiler options> arch/x86/boot/main.c
change -c to -E in the above command line and append > main-prep.c at the end.  Re-run it.  main-prep.c should contain preprocessed source code, which is what I need.
intelwrapper <a lot of compiler options> -E arch/x86/boot/main.c > main-prep.c
Thanks,
Feilong


thaidog
Total Points:
1,430
Status Points:
930
Brown Belt
November 24, 2008 9:25 AM PST
Rate
 
#17 Reply to #16
thaidog,
You need to do "make HOSTCC=intelwrapper CC=intelwrapper V=1".  In the build log, try to find a command line like
intelwrapper <a lot of compiler options> arch/x86/boot/main.c
change -c to -E in the above command line and append > main-prep.c at the end.  Re-run it.  main-prep.c should contain preprocessed source code, which is what I need.
intelwrapper <a lot of compiler options> -E arch/x86/boot/main.c > main-prep.c
Thanks,
Feilong

I do not see that line from your command - here is the output:

gentoo_x86_32 bin # cd /usr/src/linux
gentoo_x86_32 linux # make HOSTCC=intelwrapper CC=intelwrapper V=1
/usr/src/linux-2.6.25-gentoo-r7/scripts/gcc-version.sh: line 25: intelwrapper: command not found
/usr/src/linux-2.6.25-gentoo-r7/scripts/gcc-version.sh: line 26: intelwrapper: command not found
make: intelwrapper: Command not found
rm -f include/config/kernel.release
echo 2.6.25-gentoo-r7 > include/config/kernel.release
set -e; :; mkdir -p include/linux/;     (echo \#define LINUX_VERSION_CODE 132633; echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) < /usr/src/linux-2.6.25-gentoo-r7/Makefile > include/linux/version.h.tmp; if [ -r include/linux/version.h ] && cmp -s include/linux/version.h include/linux/version.h.tmp; then rm -f include/linux/version.h.tmp; else :; mv -f include/linux/version.h.tmp include/linux/version.h; fi
set -e; :; mkdir -p include/linux/;     if [ `echo -n "2.6.25-gentoo-r7" | wc -c ` -gt 64 ]; then echo '"2.6.25-gentoo-r7" exceeds 64 characters' >&2; exit 1; fi; (echo \#define UTS_RELEASE \"2.6.25-gentoo-r7\";) < include/config/kernel.release > include/linux/utsrelease.h.tmp; if [ -r include/linux/utsrelease.h ] && cmp -s include/linux/utsrelease.h include/linux/utsrelease.h.tmp; then rm -f include/linux/utsrelease.h.tmp; else :; mv -f include/linux/utsrelease.h.tmp include/linux/utsrelease.h; fi
set -e; asmlink=`readlink include/asm | cut -d '-' -f 2`;   \
if [ -L include/asm ]; then                                     \
if [ "$asmlink" != "x86" ]; then                \
echo "ERROR: the symlink include/asm points to asm-$asmlink but asm-x86 was expected"; \
echo "       set ARCH or save .config and run 'make mrproper' to fix it";             \
exit 1;                                         \
fi;                                                     \
else                                                            \
echo '  SYMLINK include/asm -> include/asm-x86';          \
if [ ! -d include ]; then                               \
mkdir -p include;                               \
fi;                                                     \
ln -fsn asm-x86 include/asm;                              \
fi
mkdir -p .tmp_versions ; rm -f .tmp_versions/*
make -f scripts/Makefile.build obj=scripts/basic
(cat /dev/null; ) > scripts/basic/modules.order
make -f scripts/Makefile.build obj=.
(cat /dev/null; ) > modules.order
mkdir -p arch/x86/kernel/
intelwrapper -Wp,-MD,arch/x86/kernel/.asm-offsets.s.d  -nostdinc -isystem  -D__KERNEL__ -Iinclude  -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Os   -msoft-float -mregparm=3 -freg-struct-return   -march=i686   -ffreestanding   -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables  -Iinclude/asm-x86/mach-generic -Iinclude/asm-x86/mach-default -fno-omit-frame-pointer -fno-optimize-sibling-calls       -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(asm_offsets)"  -D"KBUILD_MODNAME=KBUILD_STR(asm_offsets)" -fverbose-asm -S -o arch/x86/kernel/asm-offsets.s arch/x86/kernel/asm-offsets.c
/bin/sh: intelwrapper: command not found
make[1]: *** [arch/x86/kernel/asm-offsets.s] Error 127
make: *** [prepare0] Error 2
gentoo_x86_32 linux #



Feilong H. (Intel)
Total Points:
1,697
Status Points:
1,197
Brown Belt
November 24, 2008 10:26 PM PST
Rate
 
#18 Reply to #17
Obviously the filename of your wrapper is not intelwrapper.  Please replace intelwrapper with the full path name of your wrapper script.
$ make HOSTCC=intelwrapper CC=intelwrapper V=1


thaidog
Total Points:
1,430
Status Points:
930
Brown Belt
November 26, 2008 6:17 PM PST
Rate
 
#19 Reply to #18
Obviously the filename of your wrapper is not intelwrapper.  Please replace intelwrapper with the full path name of your wrapper script.
$ make HOSTCC=intelwrapper CC=intelwrapper V=1

That is the name of it and it was already in my path... I copied over again and got this:

http://www.tyler.mcadams.com/build.txt

http://www.tyler.mcadams.com/kernellog.txt

http://www.tyler.mcadams.com/kernellog2.txt

Could not find anything exactly line like you are looking for... the only thing that ends in main.c are lines like this:

drivers/net/e1000/e1000_main.c(258): remark #177: function "__check_debug" was declared but never referenced
module_param(debug, int, 0);

Could be easier if I just give you a logon. You can e-mail me at: tyler@mcadams.com



Feilong H. (Intel)
Total Points:
1,697
Status Points:
1,197
Brown Belt
November 26, 2008 11:30 PM PST
Rate
 
#20 Reply to #19
I looked at http://www.tyler.mcadams.com/build.txt.  It looks that the error occured at arch/x86/boot/mca.c.  I copied the command line and changed -c to -E.  Please run the following command line and upload mca-prep.c for me.
intelwrapper -Wp,-MD,arch/x86/boot/.mca.o.d  -nostdinc -isystem /usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include -D__KERNEL__ -Iinclude  -include include/linux/autoconf.h -Iinclude  -include include/linux/autoconf.h -g -Os -D_SETUP -D__KERNEL__ -Wall -Wstrict-prototypes -march=i386 -mregparm=3 -include /usr/src/linux-2.6.25-gentoo-r7/arch/x86/boot/code16gcc.h -fno-strict-aliasing -fomit-frame-pointer  -ffreestanding  -fno-toplevel-reorder  -fno-stack-protector  -m32 -D__BIG_KERNEL__   -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(mca)"  -D"KBUILD_MODNAME=KBUILD_STR(mca)" -E arch/x86/boot/mca.c > mca-prep.c

ps. Due to the corporate firewall, I can't logon to your machine from Intel network...



thaidog
Total Points:
1,430
Status Points:
930
Brown Belt
November 27, 2008 8:36 AM PST
Rate
 
#21 Reply to #20
I looked at http://www.tyler.mcadams.com/build.txt.  It looks that the error occured at arch/x86/boot/mca.c.  I copied the command line and changed -c to -E.  Please run the following command line and upload mca-prep.c for me.
intelwrapper -Wp,-MD,arch/x86/boot/.mca.o.d  -nostdinc -isystem /usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include -D__KERNEL__ -Iinclude  -include include/linux/autoconf.h -Iinclude  -include include/linux/autoconf.h -g -Os -D_SETUP -D__KERNEL__ -Wall -Wstrict-prototypes -march=i386 -mregparm=3 -include /usr/src/linux-2.6.25-gentoo-r7/arch/x86/boot/code16gcc.h -fno-strict-aliasing -fomit-frame-pointer  -ffreestanding  -fno-toplevel-reorder  -fno-stack-protector  -m32 -D__BIG_KERNEL__   -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(mca)"  -D"KBUILD_MODNAME=KBUILD_STR(mca)" -E arch/x86/boot/mca.c > mca-prep.c

ps. Due to the corporate firewall, I can't logon to your machine from Intel network...

http://www.tyler.mcadams.com/mca-prep.c.txt

http://www.tyler.mcadams.com/mca-prep.c

Thanks!

PS- I thought you might want to look at this - it is what I am trying to get going (as part of a bigger project)

http://www.tyler.mcadams.com/intel_linux_gaming.doc

Only half way done (obviously) so far but the benchmarks with gcc are already smashing Windows! What do you think?

here is a screenhot of what could be the gui: http://www.tyler.mcadams.com/optimized.png

I will give you full credit for all your gracious help on this project! I just talked with Fabio Erculiani the inventor of Sabayon Linux and he is very interested in this little project also. (Sabayon is a Getnoo Linux based distro)



thaidog
Total Points:
1,430
Status Points:
930
Brown Belt
December 1, 2008 12:39 PM PST
Rate
 
#22

Also, if you get a chance, can you post the older redhat kernel that you got to compile? I'd like to download it and try it also if possible.



Feilong H. (Intel)
Total Points:
1,697
Status Points:
1,197
Brown Belt
December 2, 2008 1:43 AM PST
Rate
 
#23 Reply to #21
It looks that the problem is coming from the inline assembly code in the function query_mca().  Could you please upload the original arch/x86/boot/mca.c (don't preprocess) and the object file compiled with gcc (arch/x86/boot/mca.o)?  Probably we need to do some small modification to that piece of inline asm code.
I didn't keep the RH kernel built with icc.  It will take some time if I need to re-compile one.  And will it fit into your OS?  I don't think so...

ps. Your project sounds cool. :)



Igor Levicki
Total Points:
10,865
Status Points:
10,865
Black Belt
December 2, 2008 2:04 AM PST
Rate
 
#24 Reply to #22
Quoting - thaidog

Also, if you get a chance, can you post the older redhat kernel that you got to compile? I'd like to download it and try it also if possible.

thaidog, I hope it doesn't hurt to ask one obvious thing -- have you succesfully compiled the kernel with gcc on your computer before trying to compile with icc? Do you use patched gentoo kernel source or you are compiling vanilla kernel source tree? Which gcc and glibc versions you use? Perhaps that info will help.

 


--------
If you find my post helpfull, please rate it and/or select it as a best answer where applies. Thank you.


thaidog
Total Points:
1,430
Status Points:
930
Brown Belt
December 2, 2008 9:18 AM PST
Rate
 
#25 Reply to #24
Quoting - Igor Levicki
Quoting - thaidog

Also, if you get a chance, can you post the older redhat kernel that you got to compile? I'd like to download it and try it also if possible.

thaidog, I hope it doesn't hurt to ask one obvious thing -- have you succesfully compiled the kernel with gcc on your computer before trying to compile with icc? Do you use patched gentoo kernel source or you are compiling vanilla kernel source tree? Which gcc and glibc versions you use? Perhaps that info will help.

 

Oh yeah... I've got kernel after kernel that I have been optimizing with gcc 4.3.2 ad 4.3.1. I think I'll zip the /usr/src/linux up so you guys and check it out your self. One thing I did though is over the weekend I downloaded the latest vanilla-sources version in an attmept to see if it was just the gentoo-sources patches that was screwing everything up, but they did not compile with ICC either... I could have missed something though. I'll zip up the kernel-2.6.25-7 with all the mods we made to it so that you guys have better access to it. Right now it is pretty much striped bare... I dorpped everything I could in an attempt to see if "bleeding edge" stuff was causing issues. this is it: www.tyler.mcadams.com/linux-2.6.25-gentoo-r7.tar.gz It's 12:15EST - give it about 20min to upload. It has the current .config and all the previous changes we made to the verious files to see if that woud help as well. If you want an particular kernel for me to build with gcc or any already built I can give those too if it would help.





Intel Software Network Forums Statistics

8489 users have contributed to 31627 threads and 100761 posts to date.
In the past 24 hours, we have 33 new thread(s) 145 new posts(s), and 197 new user(s).

In the past 3 days, the most popular thread for everyone has been gemm(A,A,A) like possible? The most posts were made to Crash when loading skeleton The post with the most views is Dear Steve, excuse me for a d

Please welcome our newest member chat1983