From: Julian Seward Date: Thu, 27 Oct 2011 10:54:23 +0000 (+0000) Subject: Merge from trunk, r12234 (Some fixes for Android) X-Git-Tag: svn/VALGRIND_3_7_0~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b365b9317ba775cf855838b31877a3b63f48c60;p=thirdparty%2Fvalgrind.git Merge from trunk, r12234 (Some fixes for Android) git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_7_BRANCH@12242 --- diff --git a/Makefile.tool.am b/Makefile.tool.am index f5297bba29..7924b1bb28 100644 --- a/Makefile.tool.am +++ b/Makefile.tool.am @@ -59,6 +59,13 @@ TOOL_LDFLAGS_X86_DARWIN = \ TOOL_LDFLAGS_AMD64_DARWIN = \ $(TOOL_LDFLAGS_COMMON_DARWIN) -arch x86_64 +# On Android we must ask for non-executable stack, not sure why. +if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX +if VGCONF_PLATVARIANT_IS_ANDROID +TOOL_LDFLAGS_ARM_LINUX += -Wl,-z,noexecstack +endif +endif + # NB for 64-bit darwin. We may want to set -Wl,-pagezero_size to # something smaller than the default of 4G, so as to facilitate # loading clients who are also linked thusly (currently m_ume.c diff --git a/README.android b/README.android index e3228576e8..cf45bf71f3 100644 --- a/README.android +++ b/README.android @@ -25,10 +25,11 @@ export NDKROOT=/path/to/android-ndk-r6 # NDKROOT above, this is merely to avoid repeated typing; none of the # commands read it. # -# Currently the only supported value is: nexus_s +# Currently the supported values are: nexus_s pandaboard +# So choose one of the below: # export HWKIND=nexus_s # Samsung Nexus S - +export HWKIND=pandaboard # Pandaboard running Linaro Android # Then cd to the root of your Valgrind source tree. # @@ -49,7 +50,7 @@ export CC=$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin # Do configuration stuff. Don't mess with the --prefix in the # configure command below, even if you think it's wrong. # You may need to set the --with-tmpdir path to something -# different if /sdcard doesn't works on the device -- this is +# different if /sdcard doesn't work on the device -- this is # a known cause of difficulties. ./autogen.sh diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am index 6220f79c13..15aa4ed6b3 100644 --- a/coregrind/Makefile.am +++ b/coregrind/Makefile.am @@ -52,6 +52,12 @@ valgrind_LDFLAGS = $(AM_CFLAGS_PRI) if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN valgrind_LDFLAGS += -Wl,-read_only_relocs -Wl,suppress endif +# On Android we must ask for non-executable stack, not sure why. +if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX +if VGCONF_PLATVARIANT_IS_ANDROID +valgrind_LDFLAGS += -Wl,-z,noexecstack +endif +endif vgdb_SOURCES = vgdb.c vgdb_CPPFLAGS = $(AM_CPPFLAGS_PRI) diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index aab005a1a5..f0b94edfe4 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -5173,11 +5173,13 @@ POST(sys_ioctl) */ if (1) { /* blunt-instrument approach */ - if (0) VG_(printf)("QQQQQQQQQQ c01c quick hack actioned (%08lx, %08lx)\n", ARG2, ARG3); + if (0) VG_(printf)("QQQQQQQQQQ c01c quick hack actioned" + " (%08lx, %08lx)\n", ARG2, ARG3); POST_MEM_WRITE(ARG3, 256); } else { /* be a bit more sophisticated */ - if (0) VG_(printf)("QQQQQQQQQQ c01c quick hack actioned (%08lx, %08lx) (fancy)\n", ARG2, ARG3); + if (0) VG_(printf)("QQQQQQQQQQ c01c quick hack actioned" + " (%08lx, %08lx) (fancy)\n", ARG2, ARG3); POST_MEM_WRITE(ARG3, 28); UInt* word = (UInt*)ARG3; if (word && word[2] && word[3] < 0x200/*stay sane*/) @@ -5197,6 +5199,14 @@ POST(sys_ioctl) } /* END Nexus S specific ioctls */ + +# elif defined(ANDROID_HARDWARE_pandaboard) + + /* BEGIN Pandaboard specific ioctls */ + /* currently none are known */ + /* END Pandaboard specific ioctls */ + + # else /* no ANDROID_HARDWARE_anything defined */ # warning "" @@ -5205,6 +5215,7 @@ POST(sys_ioctl) # warning "building for. Currently known values are" # warning "" # warning " ANDROID_HARDWARE_nexus_s Samsung Nexus S" +# warning " ANDROID_HARDWARE_pandaboard Pandaboard running Linaro Android" # warning "" # warning "Make sure you exactly follow the steps in README.android." # warning "" diff --git a/memcheck/mc_replace_strmem.c b/memcheck/mc_replace_strmem.c index d29dc59791..c0c2855df8 100644 --- a/memcheck/mc_replace_strmem.c +++ b/memcheck/mc_replace_strmem.c @@ -1493,7 +1493,9 @@ static inline void my_exit ( int x ) } #if defined(VGO_linux) - STRCASESTR(VG_Z_LIBC_SONAME, strcasestr) +# if !defined(VGPV_arm_linux_android) + STRCASESTR(VG_Z_LIBC_SONAME, strcasestr) +# endif #elif defined(VGO_darwin)