project { requires += pin includes += $(PIN_ROOT)/source/include \ $(PIN_ROOT)/source/include/pin \ $(PIN_ROOT)/source/include/pin/gen \ $(PIN_ROOT)/extras/cxx/include \ $(PIN_ROOT)/extras/libstdc++/include \ $(PIN_ROOT)/extras/crt/include \ $(PIN_ROOT)/extras/crt/include/kernel/uapi \ $(PIN_ROOT)/extras/crt/include/kernel/uapi/asm-x86 \ $(PIN_ROOT)/libunwind/include \ $(PIN_ROOT)/extras/components/include \ $(PIN_ROOT)/extras/crt/include macros += BIGARRAY_MULTIPLIER=1 USING_XED PIN_CRT=1 __PIN__=1 specific (vc9) { runtime_library = 0 compile_flags += /Oy } specific (prop:microsoft) { runtime_library = MultiThreaded ImageHasSafeExceptionHandlers = false macros += _ITERATOR_DEBUG_LEVEL=0 } specific (prop:windows) { macros += TARGET_WINDOWS _SECURE_SCL=0 configurations -= Debug DisableSpecificWarning += 4530 IgnoreAllDefaultLibraries = true // We need to remove the _DEBUG macro so that Visual Studio does not // try to link against the debug C++ libraries. Otherwise, the program // will not compile, and will have link errors. Debug::macros -= _DEBUG } specific (gnuace, make) { compile_flags += -O3 -funwind-tables -fno-stack-protector -fasynchronous-unwind-tables -fomit-frame-pointer -fno-strict-aliasing -fno-rtti -fPIC -nostdlib -fpermissive -Wno-error=all -fno-exceptions compile_flags -= -Wunused-parameter -nostdlib libs += xed libs += c-dynamic m-dynamic c++ c++abi unwind-dynamic } verbatim (make, macros) { ifeq ($(shell uname -s), Darwin) CPPFLAGS += -DTARGET_MAC -D__DARWIN_ONLY_UNIX_CONFORMANCE=1 -D__DARWIN_UNIX03=0 LDFLAGS += -Wl,-no_new_main else CPPFLAGS += -DTARGET_LINUX -faligned-new LDFLAGS += -ldl-dynamic endif // We have to disable hidden symbols since we are not manually exporting // the main() function. no_hidden_visibility = 1 } verbatim (gnuace, macros) { ifeq ($(shell uname -s), Darwin) CPPFLAGS += -DTARGET_MAC -D__DARWIN_ONLY_UNIX_CONFORMANCE=1 -D__DARWIN_UNIX03=0 else CPPFLAGS += -DTARGET_LINUX -Wl,--hash-style=sysv -faligned-new endif } } feature(ia32) { includes += $(PIN_ROOT)/extras/xed-ia32/include \ $(PIN_ROOT)/extras/crt/include/arch-x86 libpaths += $(PIN_ROOT)/ia32/lib \ $(PIN_ROOT)/ia32/lib-ext \ $(PIN_ROOT)/extras/xed-ia32/lib \ $(PIN_ROOT)/extras/components/lib/ia32 macros += TARGET_IA32 HOST_IA32 avoids += intel64 specific (prop:windows) { libpaths += $(PIN_ROOT)/ia32/lib \ $(PIN_ROOT)/ia32/lib-ext // DO NOT CHANGE ORDER lit_libs += libcpmt libcmt pinvm pin libxed ntdll-32 } specific (make, gnuace) { compile_flags += -m32 } } feature(intel64) { includes += $(PIN_ROOT)/extras/xed-intel64/include \ $(PIN_ROOT)/extras/xed-intel64/include/xed \ $(PIN_ROOT)/extras/crt/include/arch-x86_64 libpaths += $(PIN_ROOT)/intel64/lib \ $(PIN_ROOT)/intel64/lib-ext \ $(PIN_ROOT)/extras/xed-intel64/lib \ $(PIN_ROOT)/extras/components/lib/intel64 \ $(PIN_ROOT)/intel64/runtime/pincrt macros += TARGET_IA32E HOST_IA32E avoids += ia32 specific (prop:windows) { // DO NOT CHANGE ORDER lit_libs += libcpmt libcmt pinvm pin libxed ntdll-64 } specific (make, gnuace) { compile_flags += -isystem $(PIN_ROOT)/extras/crt/include/arch-x86_64 -isystem $(PIN_ROOT)/extras/crt/include/kernel/asm-x86_64 } }