-
Notifications
You must be signed in to change notification settings - Fork 42
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] Cannot build taintgrind #22
Comments
Hi, taintgrind does not include the autogen.sh script, but uses the one that comes with valgrind. Did you install valgrind (http://valgrind.org)? |
@wmkhoo no I did not build valgrind because I already have the one installed from the repo (brew install valgrind)... Can I build from source in addition to the valgrind I already have or will that cause conflicts? Thanks. |
If you don't want to replace the default installation, you can install it at location you specify using 'configure --prefix=...', which is what the taintgrind installation instructions describe. |
@wmkhoo alright thank you. I got it working, but I just ended up using a Ubuntu VM which I use often anyway and then building everything from sources as specified. Now I just need to learn LLVM bytecode :P . I am familiar with x86-64 and C but I have not had to directly read/interpret LLVM bytecode. It is possible to lift it to C to find out which source lines are tainted? |
VEX, which is what valgrind uses, takes a little getting used to. However, if you include debugging symbols during compilation (e.g. gcc -g ...), taintgrind will list the source line. |
Let's try and get taintgrind to build on MacOS. |
Getting this error link_tool_exe_darwin: /usr/bin/ld -static -arch x86_64 -macosx_version_min 10.6 -o taintgrind-amd64-darwin -u __start -e __start -image_base 0x158000000 -stack_addr 0x154000000 -stack_size 0x800000 taintgrind_amd64_darwin-tnt_syswrap.o taintgrind_amd64_darwin-tnt_main.o taintgrind_amd64_darwin-tnt_translate.o taintgrind_amd64_darwin-copy.o taintgrind_amd64_darwin-tnt_smt2.o taintgrind_amd64_darwin-tnt_asm.o ../coregrind/libcoregrind-amd64-darwin.a ../VEX/libvex-amd64-darwin.a Undefined symbols for architecture x86_64: Suspect the problem is with the capstone binary. |
I think you're right, these symbols should be defined in capstone library.
…On 28/01/2019 23:09, Wei Ming Khoo wrote:
Getting this error
`../coregrind/link_tool_exe_darwin 0x158000000 gcc -o
taintgrind-amd64-darwin -arch x86_64 -O2 -g -std=gnu99 -Wall
-Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes
-Wmissing-declarations -Wcast-align -Wcast-qual -Wwrite-strings
-Wempty-body -Wformat -Wformat-security -Wignored-qualifiers
-fno-stack-protector -fno-strict-aliasing -fno-builtin -Wno-cast-align
-Wno-self-assign -Wno-tautological-compare -mmacosx-version-min=10.5
-fno-stack-protector -O2 -nodefaultlibs -nostartfiles -Wl,-u,__start
-Wl,-e,__start -arch x86_64 taintgrind_amd64_darwin-tnt_syswrap.o
taintgrind_amd64_darwin-tnt_main.o
taintgrind_amd64_darwin-tnt_translate.o taintgrind_amd64_darwin-copy.o
taintgrind_amd64_darwin-tnt_smt2.o taintgrind_amd64_darwin-tnt_asm.o
../coregrind/libcoregrind-amd64-darwin.a ../VEX/libvex-amd64-darwin.a
-lgcc -lcapstone -L./capstone-3.0.4/
link_tool_exe_darwin: /usr/bin/ld -static -arch x86_64
-macosx_version_min 10.6 -o taintgrind-amd64-darwin -u __start -e
__start -image_base 0x158000000 -stack_addr 0x154000000 -stack_size
0x800000 taintgrind_amd64_darwin-tnt_syswrap.o
taintgrind_amd64_darwin-tnt_main.o
taintgrind_amd64_darwin-tnt_translate.o taintgrind_amd64_darwin-copy.o
taintgrind_amd64_darwin-tnt_smt2.o taintgrind_amd64_darwin-tnt_asm.o
../coregrind/libcoregrind-amd64-darwin.a ../VEX/libvex-amd64-darwin.a
Undefined symbols for architecture x86_64:
"_cs_close", referenced from:
_vgTaintgrind_asm_release in taintgrind_amd64_darwin-tnt_asm.o
"_cs_disasm", referenced from:
_vgTaintgrind_asm_guest_pprint in taintgrind_amd64_darwin-tnt_asm.o
"_cs_free", referenced from:
_vgTaintgrind_asm_guest_pprint in taintgrind_amd64_darwin-tnt_asm.o
"_cs_open", referenced from:
_vgTaintgrind_asm_init in taintgrind_amd64_darwin-tnt_asm.o
ld: symbol(s) not found for architecture x86_64
make[2]: *** [taintgrind-amd64-darwin] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
`
Suspect the problem is with the capstone binary.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AXiXjuaXXuZoxRtSnXuqSYtVWF-3j329ks5vH_OlgaJpZM4Tzh0j>.
|
Seems to compile for me on High Sierra amd64. Someone else want to give it a go? |
Yeah I'll give it a shot and let you know the results... Might take me a few days though my workload has been very high lately :\ |
Please excuse my ignorance, but the instructions say:
[me@machine ~/valgrind-X.X.X] git clone http://github.com/wmkhoo/taintgrind.git
[me@machine ~/valgrind-X.X.X] cd taintgrind
[me@machine ~/valgrind-X.X.X/taintgrind] ../autogen.sh
[me@machine ~/valgrind-X.X.X/taintgrind] ./configure --prefix=
pwd
/../inst[me@machine ~/valgrind-X.X.X/taintgrind] make && make install
However, there is no autogen.sh or configure in the repo. There's a configure.ac which I cannot get to run. I do have automake and autoconf but have not used these tools before.
The text was updated successfully, but these errors were encountered: