maple icon indicating copy to clipboard operation
maple copied to clipboard

Compilation problem

Open tobias-schuele opened this issue 10 years ago • 4 comments

Hi, when I try to compile Maple with GCC 4.9.2, I get the following error message. Any ideas what's going wrong? Thanks!

g++ -fPIC -D_GNU_SOURCE -D_USING_DEBUG_INFO -Wall -Werror -g -D_DEBUG -I/home/mch11220/pin-2.14-71313-gcc.4.4.7-linux/source/include/pin -I/home/mch11220/pin-2.14-71313-gcc.4.4.7-linux/source/include/pin/gen -I/home/mch11220/pin-2.14-71313-gcc.4.4.7-linux/extras/components/include -I/home/mch11220/pin-2.14-71313-gcc.4.4.7-linux/extras/xed-intel64/include -I/home/mch11220/pin-2.14-71313-gcc.4.4.7-linux/source/tools/InstLib -DBIGARRAY_MULTIPLIER=1 -Wall -Werror -Wno-unknown-pragmas -fno-stack-protector -DTARGET_IA32E -DHOST_IA32E -fPIC -DTARGET_LINUX -I/home/mch11220/pin-2.14-71313-gcc.4.4.7-linux/source/include/pin -I/home/mch11220/pin-2.14-71313-gcc.4.4.7-linux/source/include/pin/gen -I/home/mch11220/pin-2.14-71313-gcc.4.4.7-linux/extras/components/include -I/home/mch11220/pin-2.14-71313-gcc.4.4.7-linux/extras/xed-intel64/include -I/home/mch11220/pin-2.14-71313-gcc.4.4.7-linux/source/tools/InstLib -O0 -g -Isrc/ -I/usr/local/include -c -o build-debug/tracer/profiler.o src/tracer/profiler.cpp In file included from src/core/execution_control.hpp:37:0, from src/tracer/profiler.hpp:23, from src/tracer/profiler.cpp:20: src/core/wrapper.hpp: In member function ‘void Wrapper<W, void()>::CallOriginal()’: src/core/wrapper.hpp:172:23: error: cannot convert ‘LEVEL_VM::PARG_T’ to ‘LEVEL_VM::CALL_APPLICATION_FUNCTION_PARAM_’ for argument ‘5’ to ‘LEVEL_BASE::VOID LEVEL_PINCLIENT::PIN_CallApplicationFunction(const CONTEXT_, LEVEL_VM::THREADID, LEVEL_VM::CALLINGSTD_TYPE, LEVEL_BASE::AFUNPTR, LEVEL_VM::CALL_APPLICATION_FUNCTION_PARAM*, ...)’ PIN_PARG_END());
^ src/core/wrapper.hpp:285:5: note: in expansion of macro ‘CALL_ORIGINAL_NORET’ CALL_ORIGINAL_NORET(NUM_ARGS);
^ src/core/wrapper.hpp:322:1: note: in expansion of macro ‘WRAPPER_TEMPLATE_NORET’ WRAPPER_TEMPLATE_NORET(0); ^ Makefile:121: recipe for target 'build-debug/tracer/profiler.o' failed

tobias-schuele avatar Aug 26 '15 16:08 tobias-schuele

It compiles with Pin 2.14 Rev 67254. However, when trying to run the shared_counter example as described in the README, the following error message is emitted:

Traceback (most recent call last): File "/home/mch11220/Downloads/maple-1.1.0/script/maple/idiom/main.py", line 1207, in main(sys.argv[1:]) File "/home/mch11220/Downloads/maple-1.1.0/script/maple/idiom/main.py", line 1202, in main eval('command_%s(argv[1:])' % command) File "", line 1, in File "/home/mch11220/Downloads/maple-1.1.0/script/maple/idiom/main.py", line 768, in __command_default idiom_testcase.run() File "/home/mch11220/Downloads/maple-1.1.0/script/maple/core/testing.py", line 226, in run self.body() File "/home/mch11220/Downloads/maple-1.1.0/script/maple/idiom/testing.py", line 185, in body self.profile_testcase.run() File "/home/mch11220/Downloads/maple-1.1.0/script/maple/core/testing.py", line 226, in run self.body() File "/home/mch11220/Downloads/maple-1.1.0/script/maple/core/testing.py", line 257, in body test.run() File "/home/mch11220/Downloads/maple-1.1.0/script/maple/core/testing.py", line 84, in run self.body() File "/home/mch11220/Downloads/maple-1.1.0/script/maple/core/testing.py", line 110, in body stderr=self.fio[2]) File "/usr/lib/python2.7/subprocess.py", line 710, in __init errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory

tobias-schuele avatar Aug 26 '15 20:08 tobias-schuele

Anyone here for Pin error: cannot convert ‘LEVEL_VM::PARG_T’ to ‘LEVEL_VM::CALL_APPLICATION_FUNCTION_PARAM_’ for argument ‘5’, the quick fix is to add a NULL in after the function pointer.

Relevant documentation. The missing argument:

[in] | param | Additional parameters to define the exact behavior of this function invocation (or NULL for using the defaults)

TACIXAT avatar Jul 17 '17 14:07 TACIXAT

@TACIXAT Hello, I encountered the same problem and read your answer. However, I didn't fully understand it. Can you please give me an example? Thank you.

ShadowLL avatar Dec 27 '19 09:12 ShadowLL

@ShadowLL It's been two years, but my understanding is the fifth argument to the call can be null. Recent documentation link. Seriously though, just use DynamoRIO, it is much better than Pin.

Example here - https://github.com/sarabjeetsingh007/sniper-7.2-debug/blob/84495873c991308a7441b5b1db1a64f8ec2da538/sift/recorder/emulation.cc#L146 (see the NULL in the fifth argument)

TACIXAT avatar Dec 28 '19 00:12 TACIXAT