Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS build fixes and instructions #17

Merged
merged 2 commits into from
Dec 20, 2017
Merged

macOS build fixes and instructions #17

merged 2 commits into from
Dec 20, 2017

Conversation

stek29
Copy link
Contributor

@stek29 stek29 commented Dec 13, 2017

Fixes #7

See avast/llvm#1 and avast-tl/fileformat#2

@metthal metthal requested review from s3rvac and removed request for s3rvac December 13, 2017 20:25
@Manouchehri
Copy link
Contributor

Nice! How large is your output folder? Maybe we can make a Homebrew package? (They handle pushing to Bintray too.)

@stek29
Copy link
Contributor Author

stek29 commented Dec 13, 2017

@Manouchehri 3.9 GB :S

@mewmew
Copy link

mewmew commented Dec 14, 2017

@Manouchehri 3.9 GB :S

Most likely this is due to the yara_patterns in share. Mine is ~3.7 GB.

u@x220 /u/s/generic> du -hs yara_patterns/
3.8G	yara_patterns/

@petmac
Copy link

petmac commented Dec 15, 2017

Thanks for working on this. I had a cursory look but didn't go further than that.

There seemed to be a bunch of CMakeLists.txt files that checked for Clang using ... STREQUAL "Clang" which obviously won't detect AppleClang. Changing STREQUAL to MATCHES should fix those.

In your PR, looks like README.md was deleted/renamed?

@stek29
Copy link
Contributor Author

stek29 commented Dec 15, 2017

@petmac there's only one file checking for compiler, and it should not confuse AppleClang and Clang there :)

@stek29
Copy link
Contributor Author

stek29 commented Dec 15, 2017

@petmac Wow, thanks, I've cleared README.md somehow :\

@ostefano
Copy link

@stek29 I've tried to compile your branch on a 10.13.2 system. It complains about a missing library (which is not available on osx afaik). Maybe some makefiles with a missing switch?

Scanning dependencies of target capstone2llvmirtool
[ 17%] Building CXX object deps/capstone2llvmir/src/capstone2llvmirtool/CMakeFiles/capstone2llvmirtool.dir/capstone2llvmir.cpp.o
[ 17%] Linking CXX executable capstone2llvmir
ld: library not found for -lrt
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [deps/capstone2llvmir/src/capstone2llvmirtool/capstone2llvmir] Error 1
make[1]: *** [deps/capstone2llvmir/src/capstone2llvmirtool/CMakeFiles/capstone2llvmirtool.dir/all] Error 2
make: *** [all] Error 2

@stek29
Copy link
Contributor Author

stek29 commented Dec 17, 2017

@ostefano

See avast/llvm#1 and avast-tl/fileformat#2

@sarnau
Copy link

sarnau commented Dec 19, 2017

@stek29 @petmac is correct with the STREQUAL vs MATCHES comment. Without that you do get an error "Unsupported compiler. Supported: GCC, Clang." in the openssl dependency.

@stek29
Copy link
Contributor Author

stek29 commented Dec 20, 2017

@sarnau Are you sure you have fileformat and llvm with my patches merged?

See this

Just making MATCHES is not a good idea. If it prints "Supported: GCC, Clang", then it thinks it's Linux, and that's not correct. So better it says "Unsupported compiler" than silently fails with lots of issues about trying to use linux kernel crypto features on macOS.

@stek29 stek29 mentioned this pull request Dec 20, 2017
@metthal metthal merged commit e2fa7df into avast:master Dec 20, 2017
@stek29 stek29 deleted the macos-fix branch December 20, 2017 19:49
@newkit
Copy link

newkit commented Dec 31, 2017

Just out of curiousity - how did you avoid that the original Apple flexversion got picked up? My build was failing until I renamed the original Apple files.

@stek29
Copy link
Contributor Author

stek29 commented Jan 1, 2018

@newkit README is made for reading it.

@newkit
Copy link

newkit commented Jan 1, 2018

Oh really? ;-) I know it is mentioned there and I had installed it through homebrew. And changed the PATH variables as mentioned, but still yaramodpicked up Apples /usr/bin/flexand failed building.

@stek29
Copy link
Contributor Author

stek29 commented Jan 1, 2018

@newkit Did you also change two other variables? Did you put homebrew's flex/bison in the beginning of PATH?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants