octomagon / davegrohl

A Password Cracker for macOS
http://www.davegrohl.org
GNU General Public License v2.0
235 stars 39 forks source link

make fails with Xcode 6.3.1 #11

Closed JoshCooley closed 9 years ago

JoshCooley commented 9 years ago

make fails with error: initializer for thread-local variable must be a constant expression:

hostaname:davegrohl jcooley$ make
 clang++ -std=c++11 -stdlib=libc++ -mmacosx-version-min=10.7 -fobjc-arc -fobjc-nonfragile-abi -arch x86_64 -ObjC++ -O3  -I include -c -o build/DGAttack.o src/DGAttack.cpp
src/DGAttack.cpp:299:32: error: initializer for thread-local variable must be a constant expression
    static __thread hashData_t guessHashData;
                               ^~~~~~~~~~~~~
src/DGAttack.cpp:299:32: note: use 'thread_local' to allow this
1 error generated.
make: *** [build/DGAttack.o] Error 1

This is on OS X Yosemite with Xcode 6.3.1

hostname:davegrohl jcooley$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.3.0
Thread model: posix
hostname:davegrohl jcooley$ uname -a
Darwin hostname 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
hostname:davegrohl jcooley$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.10.3
BuildVersion:   14D136

image

arvenom commented 9 years ago

Got the same issue :( any updates?

JPaulMora commented 9 years ago

I've been looking for a solution, but cocoa isn't my primary language. Remember you can download v2.1 on the main page

octomagon commented 9 years ago

I've pushed a possible fix for this to the 'develop' branch. I've only been able to verify it works on El Capitan with the Xcode 7 Beta. Let me know if it works for you guys and I'll merge it to the master branch... or just wait and I'll test it on Yosemite eventually.

To fix it, I replaced the hashData_t with a unsigned char array. Allocating another whole hashData_t per thread was probably unnecessary anyway.

octomagon commented 9 years ago

The fix has been merged to master.