- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm trying to compile the Linux using the Intel C compiler and I'm running into a problem where I get:
/tmp/icc0gk6bpas_.s: Assembler messages:
/tmp/icc0gk6bpas_.s:508: Error: symbol `vsysc2' is already defined
when trying to compile arch/x86_64/kernel/vsyscall.c.
When I invoke the compiler with -S and look the the output, I see the following block within both vtime() and vgettimeofday():
# Begin ASM
vsysc2: syscall
# End ASM
This asm block is in __always_inline__ gettimeofday(), which is called by __always_inline__ do_vgettimeofday(), which is called by the aforementioned vgettimeofday(), so the label gets inlined into this function. vtime() calls vgettimeofday(), and it looks like the latter is getting inlined into the former, causing the asm block to be instantiated twice.
It seems like this would cause the 'already defined' error - has anyone else run into this issue compiling the kernel, and worked around it?
Thanks,
John Logan
Details:
Linux kernel 2.6.23-9, arch x86_64 (config attached)
command line:
cce/10.1.015/bin/icc -Wp,-MD,arch/x86_64/kernel/.vsyscall.o.d -isystem /usr/lib/gcc/x86_64-linux-gnu/4.2.3/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -O2 -march=core2 -mno-red-zone -mcmodel=kernel -pipe -Wno-sign-compare -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign -g0 -DKBUILD_STR(s)=#s -DKBUILD_BASENAME=KBUILD_STR(vsyscall) -DKBUILD_MODNAME=KBUILD_STR(vsyscall) -c -o arch/x86_64/kernel/.tmp_vsyscall.o arch/x86_64/kernel/vsyscall.c
removed '-m64', '-maccumulate-outgoing-args', '-fno-asynchronous-unwind-tables', '-nostdinc', '-funit-at-a-time', '-fno-stack-protector' using a wrapper script
I'm trying to compile the Linux using the Intel C compiler and I'm running into a problem where I get:
/tmp/icc0gk6bpas_.s: Assembler messages:
/tmp/icc0gk6bpas_.s:508: Error: symbol `vsysc2' is already defined
when trying to compile arch/x86_64/kernel/vsyscall.c.
When I invoke the compiler with -S and look the the output, I see the following block within both vtime() and vgettimeofday():
# Begin ASM
vsysc2: syscall
# End ASM
This asm block is in __always_inline__ gettimeofday(), which is called by __always_inline__ do_vgettimeofday(), which is called by the aforementioned vgettimeofday(), so the label gets inlined into this function. vtime() calls vgettimeofday(), and it looks like the latter is getting inlined into the former, causing the asm block to be instantiated twice.
It seems like this would cause the 'already defined' error - has anyone else run into this issue compiling the kernel, and worked around it?
Thanks,
John Logan
Details:
Linux kernel 2.6.23-9, arch x86_64 (config attached)
command line:
cce/10.1.015/bin/icc -Wp,-MD,arch/x86_64/kernel/.vsyscall.o.d -isystem /usr/lib/gcc/x86_64-linux-gnu/4.2.3/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -O2 -march=core2 -mno-red-zone -mcmodel=kernel -pipe -Wno-sign-compare -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign -g0 -DKBUILD_STR(s)=#s -DKBUILD_BASENAME=KBUILD_STR(vsyscall) -DKBUILD_MODNAME=KBUILD_STR(vsyscall) -c -o arch/x86_64/kernel/.tmp_vsyscall.o arch/x86_64/kernel/vsyscall.c
removed '-m64', '-maccumulate-outgoing-args', '-fno-asynchronous-unwind-tables', '-nostdinc', '-funit-at-a-time', '-fno-stack-protector' using a wrapper script
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feilong H was able to provide me with the resolution to this. Adding "noinline" to the definition of vgettimeofday() so that it reads:
int noinline __vsyscall(0) vgettimeofday(struct timeval * tv, struct timezone * tz)
resulted in a successful compile.
int noinline __vsyscall(0) vgettimeofday(struct timeval * tv, struct timezone * tz)
resulted in a successful compile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you jlogan2 for sharing this resolution with all the users.
The problem here is that icc decides to inline vgettimeofday() and gcc decides not to do that. Both compiles are doing the right decision. In this code, we don't want to have the function inlined, so we should mark it as noinline. It looks like a source code error.
Feilong
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page