|
From: <sv...@va...> - 2005-08-27 13:00:39
|
Author: sewardj
Date: 2005-08-27 14:00:35 +0100 (Sat, 27 Aug 2005)
New Revision: 4534
Log:
- reenable building of none, lackey and cachegrind (static, glibc-free
of course)
- in m_main, automatically deduce the tool name from the the of the
executable name
- in m_main, ignore any --tool=3D flags as it is way too late to do=20
anything about them now :-)
Modified:
branches/ASPACEM/cachegrind/Makefile.am
branches/ASPACEM/coregrind/m_main.c
branches/ASPACEM/lackey/Makefile.am
branches/ASPACEM/none/Makefile.am
Modified: branches/ASPACEM/cachegrind/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/cachegrind/Makefile.am 2005-08-27 06:56:32 UTC (rev =
4533)
+++ branches/ASPACEM/cachegrind/Makefile.am 2005-08-27 13:00:35 UTC (rev =
4534)
@@ -9,10 +9,15 @@
=20
noinst_HEADERS =3D cg_arch.h
=20
-val_PROGRAMS =3D vgtool_cachegrind.so
+bin_PROGRAMS =3D valgrind_cachegrind
=20
-vgtool_cachegrind_so_SOURCES =3D \
+valgrind_cachegrind_DEPENDENCIES =3D $(top_srcdir)/coregrind/libcoregrin=
d.a
+valgrind_cachegrind_SOURCES =3D \
cg_main.c \
cg-@VG_ARCH@.c
-vgtool_cachegrind_so_LDFLAGS =3D -shared
-
+valgrind_cachegrind_LDFLAGS =3D \
+ -static \
+ $(top_srcdir)/coregrind/libcoregrind.a \
+ -Wl,-defsym,valt_load_address=3D@VALT_LOAD_ADDRESS@ \
+ -Wl,-T,$(top_srcdir)/valt_load_address.lds \
+ -nodefaultlibs -lgcc -nostartfiles
Modified: branches/ASPACEM/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_main.c 2005-08-27 06:56:32 UTC (rev 4533=
)
+++ branches/ASPACEM/coregrind/m_main.c 2005-08-27 13:00:35 UTC (rev 4534=
)
@@ -1014,9 +1014,7 @@
load_tool__preloadpath[VKI_PATH_MAX-1] =3D 0;
*preloadpath_out =3D load_tool__preloadpath;
} else {
- VG_(printf)("valgrind: couldn't find preload file for tool %s\n",=20
- toolname);
- VG_(exit)(127);
+ *preloadpath_out =3D NULL;
}
}
=20
@@ -1255,7 +1253,8 @@
*need_help =3D 2;
=20
} else if (VG_CLO_STREQN(7, vg_argv[i], "--tool=3D")) {
- *tool =3D &vg_argv[i][7];
+ /* *tool =3D &vg_argv[i][7]; */
+ /* ignore this, since by now it is way too late to change */
=20
} else if (VG_CLO_STREQN(7, vg_argv[i], "--exec=3D")) {
*exec =3D &vg_argv[i][7];
@@ -2270,20 +2269,20 @@
=20
Int main(Int argc, HChar **argv, HChar **envp)
{
- HChar** cl_argv;
- const HChar* tool =3D "memcheck"; // default to Memcheck
- const HChar* exec =3D NULL;
- HChar* preload; /* tool-specific LD_PRELOAD .so */
- HChar** env;
- Int need_help =3D 0; // 0 =3D no, 1 =3D --help, 2 =3D =
--help-debug
- struct exeinfo info;
- ToolInfo* toolinfo =3D NULL;
- Addr client_eip;
- Addr sp_at_startup; /* client's SP at the point we
- gained control. */
- UInt* client_auxv;
- Int loglevel, i;
- struct vki_rlimit zero =3D { 0, 0 };
+ HChar** cl_argv;
+ HChar* tool =3D NULL; // will acquire tool name later
+ HChar* exec =3D NULL;
+ HChar* preload =3D NULL; /* tool-specific LD_PRELOAD .so */
+ HChar** env;
+ Int need_help =3D 0; // 0 =3D no, 1 =3D --help, 2 =3D --help=
-debug
+ struct exeinfo info;
+ ToolInfo* toolinfo =3D NULL;
+ Addr client_eip;
+ Addr sp_at_startup; /* client's SP at the point we
+ gained control. */
+ UInt* client_auxv;
+ Int loglevel, i;
+ struct vki_rlimit zero =3D { 0, 0 };
=20
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
// Nb: startup is complex. Prerequisites are shown at every step.
@@ -2354,7 +2353,8 @@
// Look for alternative libdir =20
// p: none
//--------------------------------------------------------------
- if (0) { HChar *cp =3D VG_(getenv)(VALGRINDLIB);
+ if (0) {
+ HChar *cp =3D VG_(getenv)(VALGRINDLIB);
if (cp !=3D NULL)
VG_(libdir) =3D cp;
}
@@ -2390,6 +2390,28 @@
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=20
//--------------------------------------------------------------
+ // Figure out the tool name by looking at the executable name
+ // eg /path/to/valgrind_memcheck --> memcheck
+ // p: none, except the ability to bomb out if nothing
+ // sensible can be determined
+ //--------------------------------------------------------------
+ VG_(debugLog)(1, "main", "Deducing tool name from argv[0]\n");
+ {=20
+ HChar *p0, *p1;
+ tool =3D "CANNOT_DETERMINE_TOOL_NAME";
+ /* scan to the end the the exe name */
+ p0 =3D argv[0];
+ for (p1 =3D p0; *p1; p1++)
+ ;
+ /* scan bwds to find '_' */
+ for (; p1 > p0 && *p1 !=3D '_'; p1--)
+ ;
+ if (p1 > p0 && *p1 =3D=3D '_')
+ tool =3D p1 + 1;
+ }
+ VG_(debugLog)(1, "main", "Deduced tool name =3D '%s'\n", tool);
+
+ //--------------------------------------------------------------
// With client padded out, map in tool
// p: set-libdir [for VG_(libdir)]
// p: pre_process_cmd_line_options() [for 'tool']
Modified: branches/ASPACEM/lackey/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/lackey/Makefile.am 2005-08-27 06:56:32 UTC (rev 4533=
)
+++ branches/ASPACEM/lackey/Makefile.am 2005-08-27 13:00:35 UTC (rev 4534=
)
@@ -1,7 +1,13 @@
include $(top_srcdir)/Makefile.tool.am
=20
-val_PROGRAMS =3D vgtool_lackey.so
+bin_PROGRAMS =3D valgrind_lackey
=20
-vgtool_lackey_so_SOURCES =3D lk_main.c
-vgtool_lackey_so_LDFLAGS =3D -shared
-
+valgrind_lackey_DEPENDENCIES =3D $(top_srcdir)/coregrind/libcoregrind.a
+valgrind_lackey_SOURCES =3D \
+ lk_main.c
+valgrind_lackey_LDFLAGS =3D \
+ -static \
+ $(top_srcdir)/coregrind/libcoregrind.a \
+ -Wl,-defsym,valt_load_address=3D@VALT_LOAD_ADDRESS@ \
+ -Wl,-T,$(top_srcdir)/valt_load_address.lds \
+ -nodefaultlibs -lgcc -nostartfiles
Modified: branches/ASPACEM/none/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/none/Makefile.am 2005-08-27 06:56:32 UTC (rev 4533)
+++ branches/ASPACEM/none/Makefile.am 2005-08-27 13:00:35 UTC (rev 4534)
@@ -1,7 +1,13 @@
include $(top_srcdir)/Makefile.tool.am
=20
-val_PROGRAMS =3D vgtool_none.so
+bin_PROGRAMS =3D valgrind_none
=20
-vgtool_none_so_SOURCES =3D nl_main.c
-vgtool_none_so_LDFLAGS =3D -shared
-
+valgrind_none_DEPENDENCIES =3D $(top_srcdir)/coregrind/libcoregrind.a
+valgrind_none_SOURCES =3D \
+ nl_main.c
+valgrind_none_LDFLAGS =3D \
+ -static \
+ $(top_srcdir)/coregrind/libcoregrind.a \
+ -Wl,-defsym,valt_load_address=3D@VALT_LOAD_ADDRESS@ \
+ -Wl,-T,$(top_srcdir)/valt_load_address.lds \
+ -nodefaultlibs -lgcc -nostartfiles
|