Starting from Pin 3, Pin requires all dependencies of pintools, such as third-party libraries, to be rebuilt with its own runtime, a.k.a., PinCRT [1]. These scripts provide an automatic flow for this purpose, through the use of GCC's spec files [2].
-
to set special compiler flags;
-
to include special system headers, instead of standard headers;
-
to set special link flags;
-
to link only with given runtime libraries, without standard libraries.
-
dump the default spec file by
gcc -dumpspecs
. -
change the
cc1
rule, by renaming it and adding more flags. -
add the header paths with
-isystem
in thecc1
rule. -
change the
cc1plus
rule, by renaming it and adding more flags. -
create a new rule
pin_link
for link flags, and modify thelink_command
rule to use it. -
create new rules
pincrt_startfile
,pincrt_endfile
,pincrt_libs
, and modify thelink_command
rule to use them. Also, use%:remove-outfile()
function to remove the standard libraries.
The install path is set to be the parent directory of the top directory. In
another word, this directory should be the src
directory besides include
,
lib
, etc..