Project import
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..251fb36
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,106 @@
+#
+#    Copyright (c) 2010-2011 Nest, Inc.
+#    All rights reserved.
+#
+#    This document is the property of Nest. It is considered
+#    confidential and proprietary information.
+#
+#    This document may not be reproduced or transmitted in any form,
+#    in whole or in part, without the express written permission of
+#    Nest.
+#
+#    Description:
+#      This file is the make file for valgrind, an instrumentation
+#      framework for building dynamic analysis tools. It includes tools
+#      that can automatically detect many memory management and threading
+#      bugs, and profile programs in detail.
+#
+
+
+include pre.mak
+
+PackageName		:= valgrind
+
+PackageExtension	:= tar.bz2
+PackageSeparator	:= -
+
+PackagePatchArgs	:= -p1
+
+PackageArchive		:= $(PackageName).$(PackageExtension)
+PackageSourceDir	:= $(PackageName)$(PackageSeparator)$(PackageVersion)
+
+PackageBuildMakefile	= $(call GenerateBuildPaths,Makefile)
+
+LicenseSourceFile	:= $(PackageSourceDir)/COPYING
+
+CleanPaths		+= $(PackageLicenseFile)
+
+all: $(PackageDefaultGoal)
+
+# Generate the package license contents.
+
+$(LicenseSourceFile): source
+
+$(PackageLicenseFile): $(LicenseSourceFile)
+	$(copy-result)
+
+# Extract the source from the archive and apply patches, if any.
+
+$(PackageSourceDir): $(PackageArchive) $(PackagePatchPaths)
+	$(expand-and-patch-package)
+
+# Prepare the sources.
+
+.PHONY: source
+source: | $(PackageSourceDir)
+
+# Patch the sources, if necessary.
+
+.PHONY: patch
+patch: source
+
+# Generate the package build makefile.
+
+$(PackageBuildMakefile): | $(PackageSourceDir) $(BuildDirectory) $(ResultDirectory)
+	$(Verbose)cd $(BuildDirectory) && \
+	$(CURDIR)/$(PackageSourceDir)/configure \
+	CC="$(CC)" CXX="$(CXX)" AR=$(AR) NM=$(NM) RANLIB=$(RANLIB) STRIP=$(STRIP) \
+	INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
+	--build=$(HostTuple) \
+	--host=$(ValgrindTargetTuple) \
+	--prefix=/usr \
+	--sysconfdir=/etc \
+	--localstatedir=/var
+
+# Configure the source for building.
+
+.PHONY: configure
+configure: source $(PackageBuildMakefile)
+
+# Build the source.
+#
+# We have to unset MAKEFLAGS since they confuse the package build otherwise.
+
+.PHONY: build
+build: configure
+	$(Verbose)unset MAKEFLAGS && \
+	$(MAKE) $(JOBSFLAG) -C $(BuildDirectory) \
+	all
+
+# Stage the build to a temporary installation area.
+#
+# We have to unset MAKEFLAGS since they confuse the package build otherwise.
+
+.PHONY: stage
+stage: build | $(ResultDirectory)
+	$(Verbose)unset MAKEFLAGS && \
+	$(MAKE) $(JOBSFLAG) -C $(BuildDirectory) \
+	DESTDIR=$(ResultDirectory) \
+	install
+
+clean:
+	$(Verbose)$(RM) $(RMFLAGS) -r $(PackageSourceDir)
+	$(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory)
+	$(Verbose)$(RM) $(RMFLAGS) -r $(ResultDirectory)
+
+include post.mak
diff --git a/valgrind.patches/valgrind-50.description b/valgrind.patches/valgrind-50.description
new file mode 100644
index 0000000..7bb8ac2
--- /dev/null
+++ b/valgrind.patches/valgrind-50.description
@@ -0,0 +1,2 @@
+Adding support for syscall 124 (adjtimex)
+Adding ioctls 0x460F 0x4610 (TARGET_FBIOGET_CONF2FBMAP, TARGET_FBIOPUT_CON2FBMAP)
diff --git a/valgrind.patches/valgrind-50.patch b/valgrind.patches/valgrind-50.patch
new file mode 100644
index 0000000..2b68f3f
--- /dev/null
+++ b/valgrind.patches/valgrind-50.patch
@@ -0,0 +1,104 @@
+diff -aru valgrind-3.10.1/coregrind/m_redir.c valgrind.bk/coregrind/m_redir.c
+--- valgrind-3.10.1/coregrind/m_redir.c	2014-11-25 11:41:21.000000000 -0800
++++ valgrind.bk/coregrind/m_redir.c	2016-01-11 11:35:13.243688342 -0800
+@@ -1367,6 +1367,8 @@
+       Odroid uses ld-linux-armhf.so.3 for some reason. */
+    if (0==VG_(strcmp)("Memcheck", VG_(details).name)) {
+       /* strlen */
++
++      #if CI_HACK_strlen
+       add_hardwired_spec(
+          "ld-linux.so.3", "strlen",
+          (Addr)&VG_(arm_linux_REDIR_FOR_strlen),
+@@ -1399,6 +1401,7 @@
+          (Addr)&VG_(arm_linux_REDIR_FOR_strcmp),
+          complain_about_stripped_glibc_ldso
+       );
++      #endif
+    }
+ 
+ #  elif defined(VGP_arm64_linux)
+Only in valgrind.bk/coregrind: .m_redir.c.swp
+diff -aru valgrind-3.10.1/coregrind/m_syswrap/syswrap-arm-linux.c valgrind.bk/coregrind/m_syswrap/syswrap-arm-linux.c
+--- valgrind-3.10.1/coregrind/m_syswrap/syswrap-arm-linux.c	2014-11-25 11:41:20.000000000 -0800
++++ valgrind.bk/coregrind/m_syswrap/syswrap-arm-linux.c	2016-01-11 12:06:52.559694749 -0800
+@@ -907,7 +907,7 @@
+ //zz    //   (__NR_setdomainname,     sys_setdomainname),  // 121 */*(?)
+    GENXY(__NR_uname,             sys_newuname),       // 122
+ //   PLAX_(__NR_modify_ldt,        sys_modify_ldt),     // 123
+-//zz    LINXY(__NR_adjtimex,          sys_adjtimex),       // 124
++    LINXY(__NR_adjtimex,          sys_adjtimex),       // 124
+ //zz 
+    GENXY(__NR_mprotect,          sys_mprotect),       // 125
+    LINXY(__NR_sigprocmask,       sys_sigprocmask),    // 126
+Only in valgrind.bk/coregrind/m_syswrap: .syswrap-arm-linux.c.swp
+diff -aru valgrind-3.10.1/coregrind/m_syswrap/syswrap-generic.c valgrind.bk/coregrind/m_syswrap/syswrap-generic.c
+--- valgrind-3.10.1/coregrind/m_syswrap/syswrap-generic.c	2014-11-25 11:41:20.000000000 -0800
++++ valgrind.bk/coregrind/m_syswrap/syswrap-generic.c	2016-01-11 13:42:35.252945175 -0800
+@@ -3496,7 +3496,7 @@
+                VG_(umsg)("   This could cause spurious value errors to appear.\n");
+                VG_(umsg)("   See README_MISSING_SYSCALL_OR_IOCTL for "
+                          "guidance on writing a proper wrapper.\n" );
+-               //VG_(get_and_pp_StackTrace)(tid, VG_(clo_backtrace_size));
++               VG_(get_and_pp_StackTrace)(tid, VG_(clo_backtrace_size));
+                return;
+             }
+          }
+diff -aru valgrind-3.10.1/coregrind/m_syswrap/syswrap-linux.c valgrind.bk/coregrind/m_syswrap/syswrap-linux.c
+--- valgrind-3.10.1/coregrind/m_syswrap/syswrap-linux.c	2014-11-25 11:41:20.000000000 -0800
++++ valgrind.bk/coregrind/m_syswrap/syswrap-linux.c	2016-01-11 13:16:05.550146781 -0800
+@@ -6266,6 +6266,17 @@
+    case VKI_FBIOPAN_DISPLAY:
+       PRE_MEM_READ( "ioctl(FBIOPAN_DISPLAY)", ARG3,
+                     sizeof(struct vki_fb_var_screeninfo));
++                    break;
++
++   case VKI_FBIOGET_CON2FBMAP:
++      PRE_MEM_WRITE( "ioctl(FBIOPUT_CON2FBMAP)", ARG3,
++                    sizeof(struct vki_fb_con2fbmap));
++                    break;
++
++   case VKI_FBIOPUT_CON2FBMAP:
++      PRE_MEM_READ( "ioctl(FBIOPUT_CON2FBMAP)", ARG3,
++                    sizeof(struct vki_fb_con2fbmap));
++                    break;
+ 
+       break;
+    case VKI_PPCLAIM:
+@@ -8835,6 +8846,9 @@
+    case VKI_FBIOGET_FSCREENINFO: //0x4602
+       POST_MEM_WRITE(ARG3, sizeof(struct vki_fb_fix_screeninfo));
+       break;
++   case VKI_FBIOGET_CON2FBMAP: //0x460F
++      POST_MEM_WRITE(ARG3, sizeof(struct vki_fb_con2fbmap));
++      break;
+ 
+    case VKI_PPCLAIM:
+    case VKI_PPEXCL:
+Only in valgrind.bk/coregrind/m_syswrap: .syswrap-linux.c.swp
+diff -aru valgrind-3.10.1/include/vki/vki-linux.h valgrind.bk/include/vki/vki-linux.h
+--- valgrind-3.10.1/include/vki/vki-linux.h	2014-11-25 11:41:18.000000000 -0800
++++ valgrind.bk/include/vki/vki-linux.h	2016-01-11 13:14:56.144975442 -0800
+@@ -2094,6 +2094,8 @@
+ #define VKI_FBIOPUT_VSCREENINFO	0x4601
+ #define VKI_FBIOGET_FSCREENINFO	0x4602
+ #define VKI_FBIOPAN_DISPLAY	0x4606
++#define VKI_FBIOGET_CON2FBMAP 0x460F
++#define VKI_FBIOPUT_CON2FBMAP 0x4610
+ 
+ struct vki_fb_fix_screeninfo {
+ 	char id[16];			/* identification string eg "TT Builtin" */
+@@ -2161,6 +2163,11 @@
+ 	__vki_u32 reserved[5];		/* Reserved for future compatibility */
+ };
+ 
++struct vki_fb_con2fbmap {
++    __vki_u32 console;
++    __vki_u32 framebuffer;
++};
++
+ //----------------------------------------------------------------------
+ // From linux-2.6.9/include/linux/kd.h
+ //----------------------------------------------------------------------
+Only in valgrind.bk/include/vki: .vki-linux.h.swp
+Only in valgrind.bk/: tags
diff --git a/valgrind.tar.bz2 b/valgrind.tar.bz2
new file mode 100644
index 0000000..706b6e1
--- /dev/null
+++ b/valgrind.tar.bz2
Binary files differ
diff --git a/valgrind.url b/valgrind.url
new file mode 100644
index 0000000..ace347a
--- /dev/null
+++ b/valgrind.url
@@ -0,0 +1 @@
+http://www.valgrind.org/downloads/valgrind-3.10.1.tar.bz2
diff --git a/valgrind.version b/valgrind.version
new file mode 100644
index 0000000..f870be2
--- /dev/null
+++ b/valgrind.version
@@ -0,0 +1 @@
+3.10.1