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

Why do compiled executables always link libgcc_s.so.1 and libdl.so.2?

Yang__Richard
Beginner
723 Views

I'm trying to get rid of these 2 "unused dependencies" that literally show up in all the executables I have compiled with icc/icpc

For example, the simple "time" debian package:

richard@yenforyang:~/debs/time/time-1.7$ ldd -u -r /usr/bin/time
Unused direct dependencies:
        /lib/x86_64-linux-gnu/libgcc_s.so.1
        /lib/x86_64-linux-gnu/libdl.so.2
 

Installing the official stable release of the time package gives me no unused direct dependencies at all.

Note that I am using linker options like -Wl,--as-needed,--gc-sections (as there would be way more unused dependencies if I didn't, like "libiomp5.so" for instance)

 

 

0 Kudos
1 Reply
Viet_H_Intel
Moderator
723 Views

Can you try  -static-libgcc to see if you can get rid of GCC dependency?

0 Kudos
Reply