Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Yang__Richard
Beginner
139 Views

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

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
139 Views

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

Reply