[cfe-dev] strace clang refers files from lib/tls/x86_64 multiple times

Oza, Hiral via cfe-dev cfe-dev at lists.llvm.org
Mon Feb 8 02:41:43 PST 2016


Greetings!

Sample program:
int main(int argc, char **argv)
{
    int myLocal=0xAA;
    return 0;
}

Command: clang t.c -o a.o -c

With above simple program we are observing that clang is stat-ing and trying to open various files from lib/tls location. Eventually all calls to "lib/tls" leads to ENOENT (No such file or directory)!

<sample_strace>
open("path/lib/tls/x86_64/libpthread.so.0", O_RDONLY) = -1 ENOENT         (No such file or directory)
...
open("path/lib/tls/libpthread.so.0", O_RDONLY) = -1 ENOENT (No such       file or directory)
...
</sample_strace>

The same behavior is not observed with GCC. With gcc we could build above sample program under 30 seconds while it takes more than 100 seconds when using clang!!!
Any pointer on how to reduce unnecessary stat/open is appreciated.

My local installation paths are...
                somepath/gcc-4.9.x/{bin,lib}
                somepath/llvm-3.7.1/{bin,lib}
                somepath/{bin,lib}

In above installation path we don't have "tls" directory.

In this regards I have following questions...
- We are not seeing present of "tls" directory under "somepath/llvm-3.7.1/{bin,lib}" - is anything missing in our installation?
- Why clang refers to "lib/tls"?
- Why clang refers to "lib/x86_64" ? And why not just using "lib/"

Thank you in advance for your help.

Regards,
-Hiral

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160208/1a1bfd66/attachment.html>


More information about the cfe-dev mailing list