RH9 and static linkage with icc 7.1

RH9 and static linkage with icc 7.1

I am trying to statically link a program on a RH9 system with the 7.1 icc compiler. From this forum I found out that I need to copy an older version of glibc somewhere. I did as suggested and got glibc-2.2.93-5 from RH8 and installed


and changed


to include the libraries. I can compile programs now and they run fine. In order to statically link my program I also installed


included -L/opt/intel/old_libs/usr/lib in icc.cfg and changed the above libc-2.2.93.so to

/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
GROUP ( /opt/intel/old_libs/lib/libc2.2.93.so /opt/intel/old_libs/usr/lib/libc_nonshared.a )

I still can't statically link my program though. I get all sorts of errors along the lines of:

/usr/lib/libc.a(dl-libc.o)(.text+0xb4): In function `__libc_dlclose':
: multiple definition of `__libc_dlclose'
/opt/intel/old_libs/usr/lib/libc-2.2.93.a(dl-libc.o)(.text+0xac): first defined here

Why would the linker even try to look for /usr/lib/libc.a? I must confess that I really don't know what I am doing here, so I might be doing something really stupid. Could someone please hint me in the right direction?

Thanks a lot,


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

There are a couple of things you can try:

Call the copied libc.a libc.a and use the -L option to specify the path to it. This should cause the old one to be picked up.

Or you can use the -nodefaultlibs option and specify all the libraries yourself. If you put "-#" on the end of your command line the compiler will print the linker command that would be sent to the linker so you can use that as a starting spot.

Note that we do not recommend copying libc's between versions of Linux since the libc is intimately associated with the system files on a given version of Linux.

We are currently working on RHL9 support. Static linking in particular has caused quite a bit of work.

Leave a Comment

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