summaryrefslogtreecommitdiff
path: root/config/pin_base.mpb
blob: 261b367e236dbd3a2172308e3f14c55ed4bde510 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
project {
  requires += pin

  includes += $(PIN_ROOT)/source/include \
              $(PIN_ROOT)/source/include/pin \
              $(PIN_ROOT)/source/include/pin/gen \
              $(PIN_ROOT)/extras/components/include \
              ..

  macros += BIGARRAY_MULTIPLIER=1 USING_XED PIN_CRT=1 __PIN__=1
  lit_libs += c-dynamic m-dynamic stlport-dynamic dl-dynamic unwind-dynamic

  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 -faligned-new -fPIC -nostdlib -fpermissive -Wno-error=all -fno-exceptions
    compile_flags += '-isystem $(PIN_ROOT)/extras/stlport/include -isystem $(PIN_ROOT)/extras/libstdc++/include -isystem $(PIN_ROOT)/extras/crt/include -isystem $(PIN_ROOT)/extras/crt/include/kernel/uapi'
    compile_flags -= -Wunused-parameter

    libs += xed
  }

  verbatim (make, macros) {
    ifeq ($(shell uname -s), Darwin)
      CPPFLAGS += -DTARGET_MAC
    else
      CPPFLAGS += -DTARGET_LINUX
    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
    else
      CPPFLAGS += -DTARGET_LINUX -Wl,--hash-style=sysv
    endif
  }
}

feature(ia32) {
  includes += $(PIN_ROOT)/extras/xed-ia32/include

  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

  libpaths += $(PIN_ROOT)/intel64/lib \
              $(PIN_ROOT)/intel64/lib-ext \
              $(PIN_ROOT)/extras/xed-intel64/lib \
              $(PIN_ROOT)/extras/components/lib/intel64

  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
  }

}