|
From: <sv...@va...> - 2009-02-11 00:35:50
|
Author: njn
Date: 2009-02-11 00:35:45 +0000 (Wed, 11 Feb 2009)
New Revision: 9135
Log:
Changed the way files are installed. Instead of going into
$INSTALL/<platform>/<filename>, they go to $INSTALL/<filename>-<platform>.
These filenames match those built in the build tree, and so simplifies the
build system signficantly and avoids the horrible sed renamings that were
previously required. This will also help greatly with the treatment of
.dSYM debug directories in the DARWIN branch.
Files affected include:
- preload libraries such as vgpreload_core-<platform>.so and
libmpiwrap-<platform>.so
- libraries such as libcoregrind_<platform>.a
- executables such as memcheck-<platform>
I updated the manual and added a note to the NEWS file about the change,
because it will affect a small number of users.
I did my best to update the AIX launcher/initimg correctly, but it hasn't
been tested.
Modified:
trunk/Makefile.install.am
trunk/NEWS
trunk/auxprogs/Makefile.am
trunk/coregrind/Makefile.am
trunk/coregrind/launcher-aix5.c
trunk/coregrind/launcher-linux.c
trunk/coregrind/m_initimg/initimg-aix5.c
trunk/coregrind/m_initimg/initimg-linux.c
trunk/memcheck/docs/mc-manual.xml
Modified: trunk/Makefile.install.am
===================================================================
--- trunk/Makefile.install.am 2009-02-11 00:21:53 UTC (rev 9134)
+++ trunk/Makefile.install.am 2009-02-11 00:35:45 UTC (rev 9135)
@@ -1,40 +1,22 @@
# This is used by coregrind/Makefile.am and Makefile.tool.am for doing
-# "in-place" installs. It copies $(noinst_PROGRAMS) into $inplacedir, doing
-# some magic renaming as it does.
-# The similar code below explains how the magic sed commands work.
+# "in-place" installs. It copies $(noinst_PROGRAMS) into $inplacedir.
all-local:
if [ -n "$(noinst_PROGRAMS)" ] ; then \
for f in $(noinst_PROGRAMS); do \
- name=`echo $$f | sed -e 's/-\([^-]*-[^-.]*\)\(\..*\)\{0,1\}$$/\2/'`; \
- plat=`echo $$f | sed -e 's/^.*-\([^-]*-[^-.]*\)\(\..*\)\{0,1\}$$/\1/'`; \
- mkdir -p $(inplacedir)/$$plat; \
- rm -f $(inplacedir)/$$plat/$$name; \
- ln -f -s ../../$(subdir)/$$f $(inplacedir)/$$plat/$$name; \
+ mkdir -p $(inplacedir); \
+ rm -f $(inplacedir)/$$f; \
+ ln -f -s ../$(subdir)/$$f $(inplacedir); \
done ; \
fi
# This is used by coregrind/Makefile.am and by <tool>/Makefile.am for doing
-# "make install". It copies $(noinst_PROGRAMS) into $prefix/lib/valgrind/,
-# doing some magic renaming as it does.
+# "make install". It copies $(noinst_PROGRAMS) into $prefix/lib/valgrind/.
# It needs to be depended on by an 'install-exec-local' rule.
-#
-# Details about the renaming: the loop copies a bunch of files with
-# names of the form wurble-arch-os to $prefix/lib/valgrind/arch-os/wurble.
-# There is some complexity in the sed mangling because wurble may itself
-# contain a dash, which must be ignored. For example we want
-# exp-omega-x86-linux
-# to be installed in
-# $prefix/lib/valgrind/x86-linux/exp-omega
-# and not in
-# $prefix/lib/valgrind/omega-x86-linux/exp
-# or similarly mutant place.
install-exec-local-programs:
if [ -n "$(noinst_PROGRAMS)" ] ; then \
for f in $(noinst_PROGRAMS); do \
- name=`echo $$f | sed -e 's/-\([^-]*-[^-.]*\)\(\..*\)\?$$/\2/'`; \
- plat=`echo $$f | sed -e 's/^.*-\([^-]*-[^-.]*\)\(\..*\)\?$$/\1/'`; \
- $(mkinstalldirs) $(DESTDIR)$(valdir)/$$plat; \
- $(INSTALL_PROGRAM) $$f $(DESTDIR)$(valdir)/$$plat/$$name; \
+ $(mkinstalldirs) $(DESTDIR)$(valdir); \
+ $(INSTALL_PROGRAM) $$f $(DESTDIR)$(valdir); \
done ; \
fi
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2009-02-11 00:21:53 UTC (rev 9134)
+++ trunk/NEWS 2009-02-11 00:35:45 UTC (rev 9135)
@@ -1,6 +1,19 @@
Release 3.5.0 (???)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* The location of some install files has changed. This should not affect
+ most users. Those who might be affected:
+
+ - For people who use Valgrind with MPI programs, the installed
+ libmpiwrap.so library has moved from $(INSTALL)/<platform>/libmpiwrap.so
+ to $(INSTALL)/libmpiwrap-<platform>.so.
+
+ - For people who distribute standalone Valgrind tools, the installed
+ libraries such as $(INSTALL)/<platform>/libcoregrind.a have moved to
+ $(INSTALL)/libcoregrind-<platform>.a.
+
+ These changes were made to simplify the build system.
+
* Previously, all the distributed suppression (*.supp) files were installed.
Now, only default.supp is installed. This should not affect users as the
other installed suppression files were not read.
Modified: trunk/auxprogs/Makefile.am
===================================================================
--- trunk/auxprogs/Makefile.am 2009-02-11 00:21:53 UTC (rev 9134)
+++ trunk/auxprogs/Makefile.am 2009-02-11 00:35:45 UTC (rev 9135)
@@ -85,12 +85,12 @@
install-exec-local:
if BUILD_MPIWRAP_PRI
- $(mkinstalldirs) $(DESTDIR)$(valdir)/@VGCONF_ARCH_PRI@-@VGCONF_OS@; \
- $(INSTALL_PROGRAM) ./libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so $(DESTDIR)$(valdir)/@VGCONF_ARCH_PRI@-@VGCONF_OS@/libmpiwrap.so;
+ $(mkinstalldirs) $(DESTDIR)$(valdir); \
+ $(INSTALL_PROGRAM) ./libmpiwrap-@VGCONF_ARCH_PRI@-@VGCONF_OS@.so $(DESTDIR)$(valdir);
endif
if BUILD_MPIWRAP_SEC
- $(mkinstalldirs) $(DESTDIR)$(valdir)/@VGCONF_ARCH_SEC@-@VGCONF_OS@; \
- $(INSTALL_PROGRAM) ./libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so $(DESTDIR)$(valdir)/@VGCONF_ARCH_SEC@-@VGCONF_OS@/libmpiwrap.so;
+ $(mkinstalldirs) $(DESTDIR)$(valdir); \
+ $(INSTALL_PROGRAM) ./libmpiwrap-@VGCONF_ARCH_SEC@-@VGCONF_OS@.so $(DESTDIR)$(valdir);
endif
Modified: trunk/coregrind/Makefile.am
===================================================================
--- trunk/coregrind/Makefile.am 2009-02-11 00:21:53 UTC (rev 9134)
+++ trunk/coregrind/Makefile.am 2009-02-11 00:35:45 UTC (rev 9135)
@@ -29,31 +29,44 @@
default.supp: $(SUPP_FILES)
-noinst_LIBRARIES =
-LIBPLATFORMS =
+noinst_PROGRAMS =
+pkglib_LIBRARIES =
+LIBVEX =
+
if VGCONF_PLATFORMS_INCLUDE_X86_LINUX
-noinst_LIBRARIES += libcoregrind_x86_linux.a libreplacemalloc_toolpreload_x86_linux.a
-LIBPLATFORMS += x86_linux
+noinst_PROGRAMS += vgpreload_core-x86-linux.so
+pkglib_LIBRARIES += libcoregrind_x86_linux.a libreplacemalloc_toolpreload_x86_linux.a
+LIBVEX += libvex_x86_linux.a
endif
+
if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX
-noinst_LIBRARIES += libcoregrind_amd64_linux.a libreplacemalloc_toolpreload_amd64_linux.a
-LIBPLATFORMS += amd64_linux
+noinst_PROGRAMS += vgpreload_core-amd64-linux.so
+pkglib_LIBRARIES += libcoregrind_amd64_linux.a libreplacemalloc_toolpreload_amd64_linux.a
+LIBVEX += libvex_amd64_linux.a
endif
+
if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX
-noinst_LIBRARIES += libcoregrind_ppc32_linux.a libreplacemalloc_toolpreload_ppc32_linux.a
-LIBPLATFORMS += ppc32_linux
+noinst_PROGRAMS += vgpreload_core-ppc32-linux.so
+pkglib_LIBRARIES += libcoregrind_ppc32_linux.a libreplacemalloc_toolpreload_ppc32_linux.a
+LIBVEX += libvex_ppc32_linux.a
endif
+
if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX
-noinst_LIBRARIES += libcoregrind_ppc64_linux.a libreplacemalloc_toolpreload_ppc64_linux.a
-LIBPLATFORMS += ppc64_linux
+noinst_PROGRAMS += vgpreload_core-ppc64-linux.so
+pkglib_LIBRARIES += libcoregrind_ppc64_linux.a libreplacemalloc_toolpreload_ppc64_linux.a
+LIBVEX += libvex_ppc64_linux.a
endif
+
if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5
-noinst_LIBRARIES += libcoregrind_ppc32_aix5.a libreplacemalloc_toolpreload_ppc32_aix5.a
-LIBPLATFORMS += ppc32_aix5
+noinst_PROGRAMS += vgpreload_core-ppc32-aix5.so
+pkglib_LIBRARIES += libcoregrind_ppc32_aix5.a libreplacemalloc_toolpreload_ppc32_aix5.a
+LIBVEX += libvex_ppc32_aix5.a
endif
+
if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5
-noinst_LIBRARIES += libcoregrind_ppc64_aix5.a libreplacemalloc_toolpreload_ppc64_aix5.a
-LIBPLATFORMS += ppc64_aix5
+noinst_PROGRAMS += vgpreload_core-ppc64-aix5.so
+pkglib_LIBRARIES += libcoregrind_ppc64_aix5.a libreplacemalloc_toolpreload_ppc64_aix5.a
+LIBVEX += libvex_ppc64_aix5.a
endif
@@ -88,26 +101,6 @@
#----------------------------------------------------------
-noinst_PROGRAMS =
-if VGCONF_PLATFORMS_INCLUDE_X86_LINUX
-noinst_PROGRAMS += vgpreload_core-x86-linux.so
-endif
-if VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX
-noinst_PROGRAMS += vgpreload_core-amd64-linux.so
-endif
-if VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX
-noinst_PROGRAMS += vgpreload_core-ppc32-linux.so
-endif
-if VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX
-noinst_PROGRAMS += vgpreload_core-ppc64-linux.so
-endif
-if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5
-noinst_PROGRAMS += vgpreload_core-ppc32-aix5.so
-endif
-if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5
-noinst_PROGRAMS += vgpreload_core-ppc64-aix5.so
-endif
-
noinst_HEADERS = \
pub_core_aspacemgr.h \
pub_core_basics.h \
@@ -417,19 +410,11 @@
clean-local:
$(MAKE) -C @VEX_DIR@ CC="$(CC)" AR="$(AR)" clean
-# Nb: The loop installs some .a files for possible use by standalone tools
-# into the correct (target-specific) lib dirs at install time.
-# $(LIBPLATFORMS) will look like this:
-# x86_linux amd64_linux
-# pD and pU are the (arch,os) target pairs separated by a dash (pD) or
-# an underscore (pU) respectively, eg amd64-linux (pD) and amd64_linux (pU).
-# It then copies the libraries to the right places.
+# Nb: The loop installs the libvex library for possible use by standalone
+# tools.
install-exec-local: install-exec-local-programs
- for pU in $(LIBPLATFORMS) ; do \
- pD=`echo $$pU | sed -e 's/_/-/g'` ; \
- $(INSTALL_DATA) libcoregrind_$$pU.a $(DESTDIR)$(valdir)/$$pD/libcoregrind.a ; \
- $(INSTALL_DATA) libreplacemalloc_toolpreload_$$pU.a $(DESTDIR)$(valdir)/$$pD/libreplacemalloc_toolpreload.a ; \
- $(INSTALL_DATA) @VEX_DIR@/libvex_$$pU.a $(DESTDIR)$(valdir)/$$pD/libvex.a ; \
+ for v in $(LIBVEX) ; do \
+ $(INSTALL_DATA) @VEX_DIR@/$$v $(DESTDIR)$(valdir) ; \
done
Modified: trunk/coregrind/launcher-aix5.c
===================================================================
--- trunk/coregrind/launcher-aix5.c 2009-02-11 00:21:53 UTC (rev 9134)
+++ trunk/coregrind/launcher-aix5.c 2009-02-11 00:35:45 UTC (rev 9135)
@@ -1503,7 +1503,7 @@
fprintf(stderr,"%s: malloc of toolfile failed\n", argv[0]);
return 1;
}
- sprintf(toolfile, "%s/%s/%s", valgrind_lib, platform, toolname);
+ sprintf(toolfile, "%s/%s-%s", valgrind_lib, toolname, platform);
if (!file_exists(toolfile)) {
fprintf(stderr,"%s: can't stat %s\n", argv[0], toolfile);
Modified: trunk/coregrind/launcher-linux.c
===================================================================
--- trunk/coregrind/launcher-linux.c 2009-02-11 00:21:53 UTC (rev 9134)
+++ trunk/coregrind/launcher-linux.c 2009-02-11 00:35:45 UTC (rev 9135)
@@ -309,7 +309,7 @@
toolfile = malloc(strlen(valgrind_lib) + strlen(toolname) + strlen(platform) + 3);
if (toolfile == NULL)
barf("malloc of toolfile failed.");
- sprintf(toolfile, "%s/%s/%s", valgrind_lib, platform, toolname);
+ sprintf(toolfile, "%s/%s-%s", valgrind_lib, toolname, platform);
VG_(debugLog)(1, "launcher", "launching %s\n", toolfile);
Modified: trunk/coregrind/m_initimg/initimg-aix5.c
===================================================================
--- trunk/coregrind/m_initimg/initimg-aix5.c 2009-02-11 00:21:53 UTC (rev 9134)
+++ trunk/coregrind/m_initimg/initimg-aix5.c 2009-02-11 00:35:45 UTC (rev 9135)
@@ -71,8 +71,8 @@
{
/* Set up an AIX5PreloadPage structure with the names of
- $VALGRIND_LIB/PLATFORM/vgpreload_core.so
- $VALGRIND_LIB/PLATFORM/vgpreload_TOOL.so, if it exists
+ $VALGRIND_LIB/vgpreload_core_PLATFORM.so
+ $VALGRIND_LIB/vgpreload_TOOL_PLATFORM.so, if it exists
xxx in "LD_PRELOAD=xxx", if it exists
The client is started by running (on the simulator, of course)
@@ -83,9 +83,9 @@
stored in the AIX5PreloadPage. Finally, we jump to the client's
entry point address.
*/
- const HChar* _so = ".so";
- const HChar* vgpreload_ = "vgpreload_";
- const HChar* vgpreload_core_so = "vgpreload_core.so";
+ const HChar* _so = ".so";
+ const HChar* vgpreload_ = "vgpreload_";
+ const HChar* core = "core";
const HChar* errmsg_str
= "valgrind: FATAL: core/tool/LD_PRELOAD= "
"preload failed.\n";
@@ -108,10 +108,10 @@
vg_assert( iicii.toolname );
pltool_len = VG_(strlen)( VG_(libdir) )
+ 1 /*slash*/
- + VG_(strlen)(VG_PLATFORM)
- + 1 /*slash*/
+ VG_(strlen)( vgpreload_ )
+ VG_(strlen)( iicii.toolname )
+ + 1 /*dash*/
+ + VG_(strlen)(VG_PLATFORM)
+ VG_(strlen)( _so )
+ 1 /*NUL*/;
vg_assert(pltool_len > 0);
@@ -119,28 +119,32 @@
pltool_str[0] = 0;
VG_(strcat)( pltool_str, VG_(libdir) );
VG_(strcat)( pltool_str, "/" );
- VG_(strcat)( pltool_str, VG_PLATFORM );
- VG_(strcat)( pltool_str, "/" );
VG_(strcat)( pltool_str, vgpreload_ );
VG_(strcat)( pltool_str, iicii.toolname );
+ VG_(strcat)( pltool_str, "-" );
+ VG_(strcat)( pltool_str, VG_PLATFORM );
VG_(strcat)( pltool_str, _so );
vg_assert( pltool_str[pltool_len-1] == 0);
vg_assert( VG_(strlen)(pltool_str) == pltool_len-1 );
plcore_len = VG_(strlen)( VG_(libdir) )
+ 1 /*slash*/
+ + VG_(strlen)( vgpreload_ )
+ + VG_(strlen)( core )
+ + 1 /*dash*/
+ VG_(strlen)(VG_PLATFORM)
- + 1 /*slash*/
- + VG_(strlen)( vgpreload_core_so )
+ + VG_(strlen)(_so)
+ 1 /*NUL*/;
vg_assert(plcore_len > 0);
plcore_str = VG_(malloc)( "initimg-aix5.ici.2", plcore_len );
plcore_str[0] = 0;
VG_(strcat)( plcore_str, VG_(libdir) );
VG_(strcat)( plcore_str, "/" );
+ VG_(strcat)( plcore_str, vgpreload_ );
+ VG_(strcat)( plcore_str, core );
+ VG_(strcat)( plcore_str, "-" );
VG_(strcat)( plcore_str, VG_PLATFORM );
- VG_(strcat)( plcore_str, "/" );
- VG_(strcat)( plcore_str, vgpreload_core_so );
+ VG_(strcat)( plcore_str, _so );
vg_assert( plcore_str[plcore_len-1] == 0 );
vg_assert( VG_(strlen)(plcore_str) == plcore_len-1 );
@@ -168,7 +172,7 @@
if (0 != VG_(access)(plcore_str, True,False,True))
VG_(err_config_error)("Can't find core preload "
- "(vgpreload_core.so)");
+ "(vgpreload_core-<platform>.so)");
have_tool_so = 0 == VG_(access)(pltool_str, True,False,True);
@@ -520,18 +524,18 @@
/* Take the strings that this prints out and feed them
to /usr/sbin/execerror. For example, it might print
- (ld 3 1 __libc_freeres /foo/bar/ppc32-aix5/vgpreload_core.so
+ (ld 3 1 __libc_freeres /foo/bar/vgpreload_core-ppc32-aix5.so
in which case
$ execerror xyzzy \
- "(ld 3 1 __libc_freeres /foo/bar/ppc32-aix5/vgpreload_core.so"
+ "(ld 3 1 __libc_freeres /foo/bar/vgpreload_core-ppc32-aix5.so"
gets you
Could not load program xyzzy:
rtld: 0712-001 Symbol __libc_freeres was referenced
- from module /foo/bar/ppc32-aix5/vgpreload_core.so(),
+ from module /foo/bar/vgpreload_core-ppc32-aix5.so(),
but a runtime definition
of the symbol was not found.
*/
Modified: trunk/coregrind/m_initimg/initimg-linux.c
===================================================================
--- trunk/coregrind/m_initimg/initimg-linux.c 2009-02-11 00:21:53 UTC (rev 9134)
+++ trunk/coregrind/m_initimg/initimg-linux.c 2009-02-11 00:35:45 UTC (rev 9135)
@@ -202,8 +202,8 @@
/* Prepare the client's environment. This is basically a copy of our
environment, except:
- LD_PRELOAD=$VALGRIND_LIB/PLATFORM/vgpreload_core.so:
- ($VALGRIND_LIB/PLATFORM/vgpreload_TOOL.so:)?
+ LD_PRELOAD=$VALGRIND_LIB/vgpreload_core-PLATFORM.so:
+ ($VALGRIND_LIB/vgpreload_TOOL-PLATFORM.so:)?
$LD_PRELOAD
If this is missing, then it is added.
@@ -242,18 +242,18 @@
preload_string_len);
vg_assert(preload_string);
- /* Determine if there's a vgpreload_<tool>.so file, and setup
+ /* Determine if there's a vgpreload_<tool>_<platform>.so file, and setup
preload_string. */
preload_tool_path = VG_(malloc)("initimg-linux.sce.2", preload_tool_path_len);
vg_assert(preload_tool_path);
VG_(snprintf)(preload_tool_path, preload_tool_path_len,
- "%s/%s/vgpreload_%s.so", VG_(libdir), VG_PLATFORM, toolname);
+ "%s/vgpreload_%s-%s.so", VG_(libdir), toolname, VG_PLATFORM);
if (VG_(access)(preload_tool_path, True/*r*/, False/*w*/, False/*x*/) == 0) {
- VG_(snprintf)(preload_string, preload_string_len, "%s/%s/%s.so:%s",
- VG_(libdir), VG_PLATFORM, preload_core, preload_tool_path);
+ VG_(snprintf)(preload_string, preload_string_len, "%s/%s-%s.so:%s",
+ VG_(libdir), preload_core, VG_PLATFORM, preload_tool_path);
} else {
- VG_(snprintf)(preload_string, preload_string_len, "%s/%s/%s.so",
- VG_(libdir), VG_PLATFORM, preload_core);
+ VG_(snprintf)(preload_string, preload_string_len, "%s/%s-%s.so",
+ VG_(libdir), preload_core, VG_PLATFORM);
}
VG_(free)(preload_tool_path);
Modified: trunk/memcheck/docs/mc-manual.xml
===================================================================
--- trunk/memcheck/docs/mc-manual.xml 2009-02-11 00:21:53 UTC (rev 9134)
+++ trunk/memcheck/docs/mc-manual.xml 2009-02-11 00:35:45 UTC (rev 9135)
@@ -1463,7 +1463,7 @@
this:</para>
<programlisting><![CDATA[
-LD_PRELOAD=$prefix/lib/valgrind/<platform>/libmpiwrap.so \
+LD_PRELOAD=$prefix/lib/valgrind/libmpiwrap-<platform>.so \
mpirun [args] $prefix/bin/valgrind ./hello
]]></programlisting>
@@ -1499,7 +1499,7 @@
<programlisting><![CDATA[
MPIWRAP_DEBUG=[wrapper-args] \
- LD_PRELOAD=$prefix/lib/valgrind/<platform>/libmpiwrap.so \
+ LD_PRELOAD=$prefix/lib/valgrind/libmpiwrap-<platform>.so \
mpirun [mpirun-args] \
$prefix/bin/valgrind [valgrind-args] \
[application] [app-args]
@@ -1507,9 +1507,9 @@
<para>As an alternative to
<computeroutput>LD_PRELOAD</computeroutput>ing
-<computeroutput>libmpiwrap.so</computeroutput>, you can simply link it
-to your application if desired. This should not disturb native
-behaviour of your application in any way.</para>
+<computeroutput>libmpiwrap-<platform>.so</computeroutput>, you can
+simply link it to your application if desired. This should not disturb
+native behaviour of your application in any way.</para>
</sect2>
|