'-static -cxxlib-icc' doesn't work in Fedora Core 4

'-static -cxxlib-icc' doesn't work in Fedora Core 4

The compiler switches -static and -cxxlib-icc doesn't work together in Fedora Core 4. It seems to me that isn't compiler's fault but there may be a problem with glibc or linker.

[mna@fc4 tmp]$ icpc -V -v
Intel C++ Compiler for 32-bit applications, Version 9.0 Build 20050430Z Package ID: l_cc_p_9.0.021
Copyright (C) 1985-2005 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY

Version 9.0
[mna@fc4 tmp]$ uname -s -r -m -o
Linux 2.6.12-1.1447_FC4 i686 GNU/Linux
[mna@fc4 tmp]$ cat /proc/version
Linux version 2.6.12-1.1447_FC4 (bhcompile@decompose.build.redhat.com) (gcc version 4.0.1 20050727 (Red Hat 4.0.1-5)) #1 Fri Aug 26 20:29:51 EDT 2005
[mna@fc4 tmp]$ rpm -qa | grep glibc
glibc-kernheaders-2.4-9.1.94
glibc-2.3.5-10.3
glibc-devel-2.3.5-10.3
glibc-common-2.3.5-10.3
glibc-headers-2.3.5-10.3
[mna@fc4 tmp]$ gcc -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,java,f95,ada --enable-java-awt=gtk --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --host=i386-redhat-linux
Thread model: posix
gcc version 4.0.1 20050727 (Red Hat 4.0.1-5)

[mna@fc4 tmp]$ echo 'int main() {}' > nullprg.cpp
[mna@fc4 tmp]$ icpc -static -cxxlib-icc nullprg.cpp
/usr/lib/libc.a(iofflush.o)(.eh_frame+0x12): undefined reference to `__gcc_personality_v0'
/usr/lib/libc.a(iofputs.o)(.eh_frame+0x12): undefined reference to `__gcc_personality_v0'
/usr/lib/libc.a(syslog.o)(.eh_frame+0x12): undefined reference to `__gcc_personality_v0'
/usr/lib/libc.a(backtrace.o)(.text+0x3f): In function `backtrace_helper':
: undefined reference to `_Unwind_GetCFA'
/usr/lib/libc.a(backtrace.o)(.text+0x98): In function `backtrace':
: undefined reference to `_Unwind_Backtrace'
/usr/lib/libc.a(iofclose.o)(.eh_frame+0x12): undefined reference to `__gcc_personality_v0'
/usr/lib/libc.a(iofwrite.o)(.eh_frame+0x12): undefined reference to `__gcc_personality_v0'
/usr/lib/libc.a(ioseekoff.o)(.eh_frame+0x12): undefined reference to `__gcc_personality_v0'
/usr/lib/libc.a(wfileops.o)(.eh_frame+0x12): undefined reference to `__gcc_personality_v0'
/usr/lib/libc.a(fileops.o)(.eh_frame+0x12): undefined reference to `__gcc_personality_v0'

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

With icpc 9.0, you have no alternative to -cxxlib-icc. With respect to linking against libstdc++, icpc should work the same as g++:
g++ -static yourprg.cpp
and
icpc -static yourprg.cpp (with icc environment set)
should link against the same libstdc++.
Is libstdc++.a present on the g++ library search path? (g++ -print-search-dirs)
Most linux g++ installations put a copy in /usr/lib. Red Hat has made a practice of omitting static libraries required by g++ (thus not supporting -static).
If -cxxlib-icc fouls things up, you may as well omit it.

I have verified that libstdc++.a is in one of the library search
directories.

The point I wonder, both 'icpc -cxxlib-icc' and 'icpc -static' works
but 'icpc -cxxlib-icc -static' does not.

Anyway, I just dropped cxxlib-icc.

I'm getting similar errors, as well as IPO unresolved references, when I use -cxxlib-icc in SUSE 9.1 (regardless of whether -static is also used). Now, am I actually losing out on performance by not being able to get this to work?

Message Edited by Quince on 09-20-2005 05:03 PM

Leave a Comment

Please sign in to add a comment. Not a member? Join today