-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Source files added and comments are updated
- Loading branch information
Onder Kalaci
committed
Aug 20, 2014
1 parent
fa1ae63
commit 1eb9e12
Showing
90 changed files
with
12,984 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,270 @@ | ||
# These definitions are generated by the kit builder | ||
KIT := 1 | ||
TARGET_OS=linux | ||
|
||
############################################################## | ||
# | ||
# This file defines (indirectly via include files) all the variables necessary for building tools and running tests. | ||
# A detailed list of the variables defined in each file is available below. | ||
# | ||
# In addition, this files defines the common make targets. | ||
# | ||
# All aforementioned variables can be overridden from the command line, however it is not recommended to do so. | ||
# In order to safely obtain more control over the build process, the user may define the following variables in | ||
# the command line: | ||
# | ||
# CC - Override the default c compiler for tools. | ||
# CXX - Override the default c++ compiler for tools | ||
# APP_CC - Override the default c compiler for applications and any additional object or shared object files. | ||
# If not defined, APP_CC will be the same as CC. | ||
# APP_CXX - Override the default c++ compiler for applications and any additional object or shared object files. | ||
# If not defined, APP_CXX will be the same as CXX. | ||
# ICC - When ICC=1 is specified, the test binaries will be built will be done with the Intel compiler. | ||
# GCCVER - On Linux, icc requires some utilities from the gcc toolchain. This specifies which gcc version to use. | ||
# Relevant only on Linux when ICC=1. | ||
# BINUTILS_PATH - Define a path to a different set of binutils for the linker. Relevant on Unix only. | ||
# DEBUG - When DEBUG=1 is specified, debug information will be generated and no optimizations will be performed. | ||
# PIN_TESTING - When PIN_TESTING=1 is specified, Pin will be invoked with additional flags which will add some internal | ||
# testing. Note that this may incur a performance penalty. | ||
# PINFLAGS - Use this to add Pin flags when running the tests. Usage: make PINFLAGS=<extra flags> ... | ||
# PROBE - Override the default check whether to test the probe-mode tests. Specifying PROBE=1 will enable them, | ||
# while PROBE=0 will disable them. | ||
# INSTALLER - Specify a script for adding functionality to the "install" target. The script will run after the entire | ||
# build completes successfully. | ||
# INSTALL_FLAGS - Specify command line arguments to be passed to the installer script (see above). | ||
# CMD_PREFIX - A prefix which will be added to all executed shell commands. | ||
# REMOTE_DEVICE - ID of the remote device tests should run on. | ||
# REMOTE_ROOT - Location of the kit root directory on the remote device. | ||
# | ||
############################################################## | ||
|
||
|
||
############################################################## | ||
# | ||
# The following variables are defined in win.vars / unix.vars: | ||
# | ||
# HOST_ARCH - Architecture of the host system. One of: ia32/intel64/mic. | ||
# TARGET - Architecture of the target system. This is usually the same as the host. | ||
# BITS - Pointer size (in bits) of this architecture. One of 32/64. | ||
# OBJDIR - The output directory for the test rules. | ||
# TARGET_OS - Operating system of the target. | ||
# OS_TYPE - One of: unix/win. | ||
# COMPILER - The compiler used to build Pin. The name of some source trees depend on it. One of: gcc/icc/clang/msvc. | ||
# LINKER - Linker. | ||
# ARCHIVER - Static library (archive) builder. Should be followed by the requested archive name. | ||
# ASMBLR - Assembler. | ||
# EXE_SUFFIX - Extension of executables (apps). | ||
# OBJ_SUFFIX - Extension of an object file. | ||
# DLL_SUFFIX - Extension of a shared object file (dll). | ||
# PINTOOL_SUFFIX - Extension of a tool. | ||
# SATOOL_SUFFIX - Extension of static analysis tools. | ||
# LIB_SUFFIX - Extension of a static library (archive). | ||
# ASM_SUFFIX - Extension of asm source files (common convention). | ||
# DLL_PREFIX - Prefix to a shared object's name. This is only relevant on Unix platforms. The prefix is "lib" by | ||
# common convention. | ||
# PYTHON - Define the python executable. | ||
# DIFF - Diff application. | ||
# CMP - Compare application used by the default test rule. | ||
# CMD - Creates a temporary shell for the following command. Relevant on Windows only. | ||
# GREP - The grep command. | ||
# QGREP - Quiet grep command - output is suppressed. | ||
# CGREP - Count number of matching lines. | ||
# LINECOUNT - Count the number of lines in the given file. | ||
# BASHTEST - Equivalent of the bash "test" command. | ||
# STRIP - Equivalent of the "strip" program. | ||
# SET_DLL_PATH - exports the LD_LIBRARY_PATH to point to OBJDIR. Relevant on Unix only. | ||
# | ||
############################################################## | ||
|
||
|
||
############################################################## | ||
# | ||
# The following variables are defined in makefile.win.config / makefile.unix.config: | ||
# | ||
# ## Output control | ||
# | ||
# COMP_OBJ - Flags for compiling an object file. Should be followed by the requested output object's name. | ||
# COMP_EXE - Flags for building an executable from source and object files. Should be followed by the requested | ||
# output executable's name. | ||
# LINK_EXE - Flags for linking an executable from object files. Should be followed by the requested output | ||
# executable's name. | ||
# | ||
# ## Special compilation directives | ||
# | ||
# STATIC - Linker directive for building a static executable. | ||
# NO_RANDOM - Linker directive which disables voluntary image relocation. Relevant only on Windows since VS2010. | ||
# PIC - Compiler directive for generating position independent code. Relevant on Unix platforms. | ||
# NO_PIE - Compiler directive for building a non-position-independent execuatble. Relevant only on OSX. | ||
# SSE2 - Compiler directive for generating sse2 instructions. | ||
# ASMCPP - Specifies that the following files' language is assembly with embedded c++. | ||
# | ||
# ## Include paths | ||
# | ||
# COMPONENT_INCLUDES - Include paths for additional Pin components. This is added to the tools' build rules automatically. | ||
# | ||
# ## Library paths | ||
# | ||
# APP_LPATHS - Defines the locations of the additional Pin components. | ||
# TOOL_LPATHS - Defines the locations of the shared libraries needed to link a tool. | ||
# CXX_LPATHS - Defines the locations of c++-specific shared libraries. | ||
# | ||
## Libraries to link | ||
# | ||
# APP_LIBS - Defines some shared objects that may be needed by an application. On Unix platforms this includes | ||
# the pthread library. | ||
# DL_LIB - This defines the library which implements dynamic loading APIs (dl/thr). Relevant only on Unix. | ||
# APP_LIB_ATOMIC - Link the application with Pin's atomic library. To use this, one must add $(COMPONENT_INCLUDES) to | ||
# the compilation rules and $(APP_LPATHS) to the link rule. | ||
# APP_LIB_XED - Link the application with Xed. To use this, one must add $(COMPONENT_INCLUDES) to the compilation | ||
# rules and $(APP_LPATHS) to the link rule. | ||
# TOOL_LIBS - Defines the libraries needed by the tool. | ||
# SA_TOOL_LIBS - Defines the libraries needed by static analysis tools. | ||
# CXX_LIBS - Defines c++-specific libraries needed by some applications and tools. | ||
# | ||
## Compiler flags | ||
# | ||
# APP_CXXFLAGS - Application's / object's compiler options. This may include optimization and debugging flags | ||
# depending on whether DEBUG=1 was specified. | ||
# APP_CXXFLAGS_NOOPT - Application's / object's compiler options with no optimizations regardless of the DEBUG flag. | ||
# ASM_FLAGS - Application's / object's assembler options. | ||
# TOOL_CXXFLAGS - Tool's compiler options. This may include optimization and debugging flags depending on whether | ||
# DEBUG=1 was specified. | ||
# TOOL_CXXFLAGS_NOOPT - Tool's compiler options with no optimizations regardless of the DEBUG flag. | ||
# DLL_CXXFLAGS - Flags for compiling a dll. Comes in addition to to other compiler flags like APP_CXXFLAGS. | ||
# | ||
## Linker flags | ||
# | ||
# APP_LDFLAGS - Application's linker options. | ||
# APP_LDFLAGS_NOOPT - Application's linker options with no optimizations. | ||
# TOOL_LDFLAGS - Tool's linker options. | ||
# TOOL_LDFLAGS_NOOPT - Tool's linker options with no optimizations. | ||
# TOOL_SA_LDFLAGS - Static analysis tool's linker options. Relevant on Unix only. | ||
# TOOL_SA_LDFLAGS_NOOPT - Static analysis tool's linker options with no optimizations. Relevant on Unix only. | ||
# DLL_LDFLAGS - Flags for linking a dll. Comes in addition to to other linker flags like APP_LDFLAGS. | ||
# | ||
## Debugging flags | ||
# | ||
# DBG_INFO_CXX - If DEBUG=1, this variable holds compiler flags for generating debug information. Automatically | ||
# included in all the compilation flags e.g. TOOL_CXXFLAGS_NOOPT, APP_CXXFLAGS, etc). | ||
# DBG_INFO_LD - Same as DBG_INFO_CXX but for linking. | ||
# DBG_INFO_CXX_ALWAYS - When this is specified in the compilation rule, debug information will be generated regardless of | ||
# the value of the DEBUG variable. This is currently disabled on Windows due to some issues with | ||
# cygwin/ssh. | ||
# DBG_INFO_LD_ALWAYS - Same as DBG_INFO_CXX_ALWAYS but for linking. | ||
# | ||
# ## General | ||
# | ||
# PIN_ROOT - Path to the Pin root directory. When building from a kit, this is the kit root. When building | ||
# from the source tree, this is the Charm directory. | ||
# | ||
# PIN - Pin launcher. When PIN_TESTING=1, this may be followed by some additional flags. | ||
# PINBIN - The architecture-specific Pin executable. Depends on the value of the TARGET variable. | ||
# PIN32 - The 32 bit Pin executable. | ||
# PIN64 - The 32 bit Pin executable. | ||
# PIN_TESTFLAGS - Additional arguments to Pin when PIN_TESTING=1. | ||
# MAKE_TESTFLAGS - Additional arguments passed to "make" when running the .test recipes. See makefile.default.rules | ||
# for usage. | ||
# INSTALLER - Default installer (see details at the beginning of this files). | ||
# INSTALL_FLAGS - Default installer flags (see details at the beginning of this files). | ||
# | ||
# The following variables are defined at the bottom of this file: | ||
# | ||
# APP_CC - The applications' c compiler. This enables compiling tools and apps with different compilers. | ||
# APP_CXX - The applications' c++ compiler. This enables compiling tools and apps with different compilers. | ||
# PROBE - Enables probe-mode tests when PROBE=1 (default). | ||
# TESTAPP - Test application used in the default test rule. | ||
# CHECKAVX - Small program which ckecks the hardware for avx support. | ||
# CHECKAVX2 - Small program which ckecks the hardware for avx2 support. | ||
# CHECKTSX - Small program which ckecks the hardware for tsx support. | ||
# THREADLIB - Thread utilities library used by applications. | ||
# SUPPORTS_AVX_OBJ - Object file which contains a function for checking avx support. This is used by several files from | ||
# a few different directories. | ||
# SUPPORTS_AVX2_OBJ - Object file which contains a function for checking avx2 support. | ||
# | ||
# The following make targets are defined at the bottom of this file: | ||
# | ||
# all - Rule for building all the binaries specified in a per-directory makefile.rules file. The make program uses the | ||
# first rule not preceded by a period "." as the default target. Since we want the "all" target to be the default, | ||
# it must be specified here (before the per-directory makefile.rules file is called). All the other common make | ||
# targets are defined in makefile.default.rules. | ||
# | ||
# The following variables and make targets are defined in makefile.default.rules: | ||
# | ||
# dir - Rule for creating the output directory. Depends on the value of the TARGET variable. | ||
# obj-<arch> - Rule for building an output directory for a specific architecture. | ||
# tools - Builds all the tools in the directory. | ||
# apps - Builds all the applications in the directory. | ||
# objects - Builds all the objects which were explicitly specified in the directory. | ||
# dlls - Builds all the dlls in the directory. | ||
# libs - Builds all the libraries (archives) in the directory. | ||
# avxcheck - Builds a program which checks for avx support. | ||
# tsxcheck - Builds a program which checks for tsx support. | ||
# install - Builds everything in the directory and runs the install script where applicable. | ||
# test - Runs all the tests in the directory. | ||
# sanity - Runs the sanity subset of tests in the directory. | ||
# clean - Cleanup. | ||
# | ||
# $(OBJDIR)%$(PINTOOL_SUFFIX) - Default rule for building tools. | ||
# Example: make obj-intel64/mytool.so | ||
# | ||
# $(OBJDIR)% - Default rule for building applications. | ||
# Example: make obj-intel64/myapp | ||
# | ||
# %.test - Rule for running the default test template. | ||
# Example: make mytest.test | ||
# | ||
############################################################## | ||
|
||
|
||
############################################################## | ||
# | ||
# Include files | ||
# | ||
############################################################## | ||
|
||
ifeq ($(OS),Windows_NT) | ||
include ../Config/win.vars | ||
include ../Config/makefile.win.config | ||
else | ||
include ../Config/unix.vars | ||
include ../Config/makefile.unix.config | ||
endif | ||
|
||
|
||
############################################################## | ||
# | ||
# Variable definitions | ||
# | ||
############################################################## | ||
|
||
# Define the applications' compiler | ||
APP_CC := $(CC) | ||
APP_CXX := $(CXX) | ||
|
||
# Define the test application | ||
TESTAPP := ../Utils/$(OBJDIR)cp-pin$(EXE_SUFFIX) | ||
|
||
# Define the HW check utilities | ||
CHECKAVX := ../Utils/$(OBJDIR)avx_check$(EXE_SUFFIX) | ||
CHECKAVX2 := ../Utils/$(OBJDIR)avx2_check$(EXE_SUFFIX) | ||
CHECKTSX := ../Utils/$(OBJDIR)tsx_check$(EXE_SUFFIX) | ||
|
||
# Define the thread utilities library | ||
THREADLIB := ../Utils/$(OBJDIR)threadlib$(OBJ_SUFFIX) | ||
|
||
# Common object files | ||
SUPPORTS_AVX_OBJ := ../Utils/$(OBJDIR)supports_avx$(OBJ_SUFFIX) | ||
SUPPORTS_AVX2_OBJ := ../Utils/$(OBJDIR)supports_avx2$(OBJ_SUFFIX) | ||
|
||
|
||
############################################################## | ||
# | ||
# Default make target | ||
# | ||
############################################################## | ||
|
||
# Build everything. | ||
all: objects libs dlls apps tools | ||
|
||
# Accelerate the make process and prevent errors. | ||
.PHONY: all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
############################################################## | ||
# | ||
# This file is an extension to the testing framework specific | ||
# to the Debugger tests directory. | ||
# It contains additional variables used only by the Debugger tests. | ||
# Below is a detailed list of the variables made available by this | ||
# file: | ||
# | ||
# GDB - Path to gdb. Available on Unix platforms only. | ||
# BARE_PIN - Path to the Pin launcher without any additional | ||
# flags. | ||
# PINDB - Path to the pindb test-debugger program. | ||
# PINDB_LIBPATH - Defines the locations of the necessary shared | ||
# libraries when running the pindb program. | ||
# Relevant on Unix platforms only. On Windows this | ||
# variable is empty. | ||
# PINDB_WITH_LIBPATH - Path to the pindb test-debugger program, preceeded | ||
# by the library locations set in LD_LIBRARY_PATH. | ||
# Relevant on Unix platforms only. On Windows this | ||
# variable is identical to PINDB. | ||
# PINDB_USERFLAGS - Use this to add flags to the pindb program when | ||
# running the tests. | ||
# Usage: make PINDB_USERFLAGS=<extra flags> ... | ||
# PINFLAGS_DEBUG - Enable application debugging and stop in the | ||
# debugger as soon as the application is launched. | ||
# PINFLAGS_DEBUG_RUNFREE - Enable application debugging bu do not stop in the | ||
# debugger. Allows the user to attach a debugger at | ||
# a later time. | ||
# COMPARE_EXT - Compare file extension depending on compiler used. | ||
# | ||
############################################################## | ||
|
||
# We only support gdb on Unix platforms. | ||
ifneq ($(OS),Windows_NT) | ||
GDB := /usr/bin/gdb | ||
endif | ||
|
||
# These variables depend on whether we're running from a kit or source. | ||
ifeq ($(KIT),1) | ||
BARE_PIN := $(PIN_ROOT)/pin$(EXE_SUFFIX) | ||
PINDB := $(PIN_ROOT)/$(TARGET)/bin/pindb$(EXE_SUFFIX) | ||
ifeq ($(OS),Windows_NT) | ||
# On Windows LD_LIBRARY_PATH is not available | ||
PINDB_LIBPATH := | ||
PINDB_WITH_LIBPATH := $(PINDB) | ||
else | ||
ifeq ($(REQUIRES_PIN_CPP_RUNTIME),1) | ||
PINDB_LIBPATH := $(PIN_ROOT)/$(TARGET)/runtime:$(PIN_ROOT)/$(TARGET)/runtime/cpplibs | ||
else | ||
PINDB_LIBPATH := $(PIN_ROOT)/$(TARGET)/runtime | ||
endif | ||
PINDB_WITH_LIBPATH := LD_LIBRARY_PATH=$(PINDB_LIBPATH):$$LD_LIBRARY_PATH $(PINDB) | ||
endif | ||
else | ||
ifeq ($(TARGET_OS),linux) | ||
BARE_PIN := $(PIN_ROOT)/Source/pin/pin-runner-linux-$(TARGET).sh | ||
else | ||
BARE_PIN := $(PIN_ROOT)/build/Source/pin/pin-$(TARGET_OS)-$(TARGET)/pin$(EXE_SUFFIX) | ||
endif | ||
PINDB := $(PIN_ROOT)/build/Source/pindb/export-$(TARGET_OS)-$(TARGET)/pindb | ||
PINDB_LIBPATH := | ||
PINDB_WITH_LIBPATH := $(PINDB) | ||
endif | ||
|
||
# These are the Pin flags needed to enable application debugging. | ||
PINFLAGS_DEBUG := -appdebug | ||
PINFLAGS_DEBUG_RUNFREE := -appdebug_enable | ||
|
||
# Compare file extensions. | ||
ifeq ($(ICC),1) | ||
COMPARE_EXT := compareICC | ||
else | ||
COMPARE_EXT := compare | ||
endif |
Oops, something went wrong.