[cfe-dev] clang and Crypto++

Marshall Clow mclow.lists at gmail.com
Wed Jan 5 09:45:10 PST 2011


On Jan 5, 2011, at 9:31 AM, Douglas Gregor wrote:
> On Jan 5, 2011, at 9:06 AM, Marshall Clow wrote:
> 
>> After Doug fixed bug #7851 yesterday (thanks, Doug!), I decided to see if crypto++ <http://www.cryptopp.com/> would build with clang TOT.
>> 
>> Answer: No, it does not.
>> 
>> There are three problems:

[ #1 and #2 snipped out ]

> 
>> 3) clang is much, much slower than gcc 4.2.1 when building crypto++.
>> On my 2007 MacPro:
>> 	gcc takes 8m40s to build.
>> 	clang (TOT this morning) takes much longer; there is one file - sha.cpp which takes over 30 minutes, if it ever does finish, but all the other files combined take more than 45 minutes.
> 
> 
> Naturally, we'd like to know where in clang this time is going. Is it the front end (-fsyntax-only)? The optimizer (> -O0), and if so, which one(s)?

Looks like the optimizer.

$ time clang++ -Wno-tautological-compare -DNDEBUG -g         -arch x86_64 -arch i386 -DCRYPTOPP_DISABLE_ASM -pipe -fsyntax-only sha.cpp 
real	6.234s
$ time clang++ -Wno-tautological-compare -DNDEBUG -g         -arch x86_64 -arch i386 -DCRYPTOPP_DISABLE_ASM -pipe -c sha.cpp 
real 7.863s
$ time clang++ -Wno-tautological-compare -DNDEBUG -g -O1 -arch x86_64 -arch i386 -DCRYPTOPP_DISABLE_ASM -pipe -c sha.cpp 
real 17.882s
$ time clang++ -Wno-tautological-compare -DNDEBUG -g -O2 -arch x86_64 -arch i386 -DCRYPTOPP_DISABLE_ASM -pipe -c sha.cpp 
.... long, long time; I killed it after 30 minutes.

How do I tell which one?

-- Marshall





More information about the cfe-dev mailing list