Tests: fix make targets using objcopy
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 2 lines · Michael Jeanson
Add detection for objcopy using
AC_CHECK_TOOLand use dedicated make targets for each file.
I have verified that this patch fixes cross compilation, please apply.
Quoted 32 lines · Michael Jeanson
Add detection for objcopy using
AC_CHECK_TOOLand use dedicated make targets for each file.Signed-off-by Michael Jeanson <[email protected]>--- .gitignore | 2 ++ configure.ac | 6 ++++++ tests/regression/ust/baddr-statedump/Makefile.am | 21 ++++++++++++++++----- .../ust/baddr-statedump/test_baddr-statedump.py | 2 +- tests/regression/ust/ust-dl/Makefile.am | 21 ++++++++++++++++----- tests/regression/ust/ust-dl/test_ust-dl.py | 2 +- 6 files changed, 42 insertions(+), 12 deletions(-).gitignore +2
-0@@ -95,7 +95,9 @@ health_check tests/regression/ust/python-logging/test_python_logging /tests/regression/ust/baddr-statedump/prog /tests/regression/ust/baddr-statedump/prog.debug +/tests/regression/ust/baddr-statedump/prog.strip /tests/regression/ust/ust-dl/prog +/tests/regression/ust/ust-dl/libfoo.so.debug /tests/utils/testapp/gen-ust-nevents/gen-ust-nevents /tests/utils/testapp/gen-ust-tracef/gen-ust-tracef /tests/regression/tools/live/live_testconfigure.ac +0
-0
configure.ac AC_PROG_SED · line 35
Quoted 8 lines
configure.ac +5
-0@@ -28,6 +28,12 @@ AC_PROG_SED AC_PROG_YACC LT_INIT +# Check for objcopy, required by the base address statedump and dynamic linker tests +AC_CHECK_TOOL([OBJCOPY], objcopy, no) +AS_IF([test "x$OBJCOPY" = xno], + [AC_MSG_ERROR([Cannont find objcopy. Install the binutils package.])] +)
The rest of the fix looks good, but this should only disable the affected tests since binutils is not a dependancy of lttng-tools.
Regards,
Jérémie
Quoted 123 lines
configure.ac +1
-0+ # Checks for typedefs, structures, and compiler characteristics. AC_C_INLINE AC_TYPE_INT32_Ttests/regression/ust/baddr-statedump/Makefile.am +16
-5@@ -1,3 +1,7 @@ +objcopy_verbose = $(objcopy_verbose_@AM_V@) +objcopy_verbose_ = $(objcopy_verbose_@AM_DEFAULT_V@) +objcopy_verbose_0 = @echo OBJCOPY $@; + AM_CPPFLAGS = -I$(srcdir) -g noinst_PROGRAMS = prog@@ -7,15 +11,21 @@ prog_LDADD = -llttng-ust -ldl noinst_SCRIPTS = test_baddr-statedump test_baddr-statedump.py EXTRA_DIST = test_baddr-statedump test_baddr-statedump.py -all-local: prog$(EXEEXT) +# Extract debug symbols +prog.debug: prog + $(objcopy_verbose)$(OBJCOPY) --only-keep-debug prog prog.debug + +# Strip and add debuglink +prog.strip: prog.debug + @cp -f prog prog.strip + $(objcopy_verbose)$(OBJCOPY) --strip-debug --add-gnu-debuglink=prog.debug prog.strip + +all-local: prog.strip @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ for script in $(EXTRA_DIST); do \ cp -f $(srcdir)/$$script $(builddir); \ done; \ fi - objcopy --only-keep-debug prog prog.debug - strip -g prog - objcopy --add-gnu-debuglink prog.debug prog clean-local: @if [ x"$(srcdir)" != x"$(builddir)" ]; then \@@ -23,4 +33,5 @@ clean-local: rm -f $(builddir)/$$script; \ done; \ fi - rm -f prog.debug + +CLEANFILES = prog.debug prog.striptests/regression/ust/baddr-statedump/test_baddr-statedump.py +1
-1@@ -45,7 +45,7 @@ session_info = create_session() enable_ust_tracepoint_event(session_info, "*") start_session(session_info) -test_process = subprocess.Popen(test_path + "prog", stdout=subprocess.PIPE, stderr=subprocess.PIPE) +test_process = subprocess.Popen(test_path + "prog.strip", stdout=subprocess.PIPE, stderr=subprocess.PIPE) if sys.version_info >= (3, 3): try: test_process.wait(5)tests/regression/ust/ust-dl/Makefile.am +16
-5@@ -1,3 +1,7 @@ +objcopy_verbose = $(objcopy_verbose_@AM_V@) +objcopy_verbose_ = $(objcopy_verbose_@AM_DEFAULT_V@) +objcopy_verbose_0 = @echo OBJCOPY $@; + AM_CPPFLAGS = -I$(srcdir) -g noinst_PROGRAMS = prog@@ -12,15 +16,21 @@ libfoo_la_LDFLAGS = -module -shared -avoid-version \ noinst_SCRIPTS = test_ust-dl test_ust-dl.py EXTRA_DIST = test_ust-dl test_ust-dl.py -all-local: libfoo.la +# Extract debug symbols +libfoo.so.debug: libfoo.la + $(objcopy_verbose)$(OBJCOPY) --only-keep-debug .libs/libfoo.so libfoo.so.debug + +# Strip and add debuglink +libfoo.so: libfoo.so.debug + @cp -f .libs/libfoo.so libfoo.so + $(objcopy_verbose)$(OBJCOPY) --strip-debug --add-gnu-debuglink=libfoo.so.debug libfoo.so + +all-local: libfoo.so @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ for script in $(EXTRA_DIST); do \ cp -f $(srcdir)/$$script $(builddir); \ done; \ fi - objcopy --only-keep-debug .libs/libfoo.so .libs/libfoo.so.debug - strip -g .libs/libfoo.so - objcopy --add-gnu-debuglink .libs/libfoo.so.debug .libs/libfoo.so clean-local: @if [ x"$(srcdir)" != x"$(builddir)" ]; then \@@ -28,4 +38,5 @@ clean-local: rm -f $(builddir)/$$script; \ done; \ fi - rm -f .libs/libfoo.so.debug + +CLEANFILES = libfoo.so libfoo.so.debugtests/regression/ust/ust-dl/test_ust-dl.py +1
-2@@ -47,7 +47,7 @@ start_session(session_info) test_env = os.environ.copy() test_env["LD_PRELOAD"] = "liblttng-ust-dl.so" -test_env["LD_LIBRARY_PATH"] = test_path + ".libs/" +test_env["LD_LIBRARY_PATH"] = test_path test_process = subprocess.Popen(test_path + "prog", stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=test_env) --1.9.1
Signature · 8 lines
Jérémie Galarneau EfficiOS Inc. http://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
A message that is not in the archive (sent off-list or not yet received): CA+jJMxukGHGuO_fCt-=h6do7_qwfC_wCTikvq+vcOc7HPROznA@mail.gmail.com
For future reference, a Pull Request addressing my comments was submitted and merged.
https://github.com/lttng/lttng-tools/pull/60
Thanks,
Jérémie
Quoted 178 lines · Jérémie Galarneau
Quoted 32 lines · Michael Jeanson
Add detection for objcopy using
AC_CHECK_TOOLand use dedicated make targets for each file.Signed-off-by Michael Jeanson <[email protected]>--- .gitignore | 2 ++ configure.ac | 6 ++++++ tests/regression/ust/baddr-statedump/Makefile.am | 21 ++++++++++++++++----- .../ust/baddr-statedump/test_baddr-statedump.py | 2 +- tests/regression/ust/ust-dl/Makefile.am | 21 ++++++++++++++++----- tests/regression/ust/ust-dl/test_ust-dl.py | 2 +- 6 files changed, 42 insertions(+), 12 deletions(-).gitignore +2
-0@@ -95,7 +95,9 @@ health_check tests/regression/ust/python-logging/test_python_logging /tests/regression/ust/baddr-statedump/prog /tests/regression/ust/baddr-statedump/prog.debug +/tests/regression/ust/baddr-statedump/prog.strip /tests/regression/ust/ust-dl/prog +/tests/regression/ust/ust-dl/libfoo.so.debug /tests/utils/testapp/gen-ust-nevents/gen-ust-nevents /tests/utils/testapp/gen-ust-tracef/gen-ust-tracef /tests/regression/tools/live/live_testconfigure.ac +0
-0configure.ac AC_PROG_SED · line 35
Quoted 8 lines
configure.ac +5
-0@@ -28,6 +28,12 @@ AC_PROG_SED AC_PROG_YACC LT_INIT +# Check for objcopy, required by the base address statedump and dynamic linker tests +AC_CHECK_TOOL([OBJCOPY], objcopy, no) +AS_IF([test "x$OBJCOPY" = xno], + [AC_MSG_ERROR([Cannont find objcopy. Install the binutils package.])] +)The rest of the fix looks good, but this should only disable the affected tests since binutils is not a dependancy of lttng-tools.
Regards,
JérémieQuoted 121 lines
configure.ac +1
-0+ # Checks for typedefs, structures, and compiler characteristics. AC_C_INLINE AC_TYPE_INT32_Ttests/regression/ust/baddr-statedump/Makefile.am +16
-5@@ -1,3 +1,7 @@ +objcopy_verbose = $(objcopy_verbose_@AM_V@) +objcopy_verbose_ = $(objcopy_verbose_@AM_DEFAULT_V@) +objcopy_verbose_0 = @echo OBJCOPY $@; + AM_CPPFLAGS = -I$(srcdir) -g noinst_PROGRAMS = prog@@ -7,15 +11,21 @@ prog_LDADD = -llttng-ust -ldl noinst_SCRIPTS = test_baddr-statedump test_baddr-statedump.py EXTRA_DIST = test_baddr-statedump test_baddr-statedump.py -all-local: prog$(EXEEXT) +# Extract debug symbols +prog.debug: prog + $(objcopy_verbose)$(OBJCOPY) --only-keep-debug prog prog.debug + +# Strip and add debuglink +prog.strip: prog.debug + @cp -f prog prog.strip + $(objcopy_verbose)$(OBJCOPY) --strip-debug --add-gnu-debuglink=prog.debug prog.strip + +all-local: prog.strip @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ for script in $(EXTRA_DIST); do \ cp -f $(srcdir)/$$script $(builddir); \ done; \ fi - objcopy --only-keep-debug prog prog.debug - strip -g prog - objcopy --add-gnu-debuglink prog.debug prog clean-local: @if [ x"$(srcdir)" != x"$(builddir)" ]; then \@@ -23,4 +33,5 @@ clean-local: rm -f $(builddir)/$$script; \ done; \ fi - rm -f prog.debug + +CLEANFILES = prog.debug prog.striptests/regression/ust/baddr-statedump/test_baddr-statedump.py +1
-1@@ -45,7 +45,7 @@ session_info = create_session() enable_ust_tracepoint_event(session_info, "*") start_session(session_info) -test_process = subprocess.Popen(test_path + "prog", stdout=subprocess.PIPE, stderr=subprocess.PIPE) +test_process = subprocess.Popen(test_path + "prog.strip", stdout=subprocess.PIPE, stderr=subprocess.PIPE) if sys.version_info >= (3, 3): try: test_process.wait(5)tests/regression/ust/ust-dl/Makefile.am +16
-5@@ -1,3 +1,7 @@ +objcopy_verbose = $(objcopy_verbose_@AM_V@) +objcopy_verbose_ = $(objcopy_verbose_@AM_DEFAULT_V@) +objcopy_verbose_0 = @echo OBJCOPY $@; + AM_CPPFLAGS = -I$(srcdir) -g noinst_PROGRAMS = prog@@ -12,15 +16,21 @@ libfoo_la_LDFLAGS = -module -shared -avoid-version \ noinst_SCRIPTS = test_ust-dl test_ust-dl.py EXTRA_DIST = test_ust-dl test_ust-dl.py -all-local: libfoo.la +# Extract debug symbols +libfoo.so.debug: libfoo.la + $(objcopy_verbose)$(OBJCOPY) --only-keep-debug .libs/libfoo.so libfoo.so.debug + +# Strip and add debuglink +libfoo.so: libfoo.so.debug + @cp -f .libs/libfoo.so libfoo.so + $(objcopy_verbose)$(OBJCOPY) --strip-debug --add-gnu-debuglink=libfoo.so.debug libfoo.so + +all-local: libfoo.so @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ for script in $(EXTRA_DIST); do \ cp -f $(srcdir)/$$script $(builddir); \ done; \ fi - objcopy --only-keep-debug .libs/libfoo.so .libs/libfoo.so.debug - strip -g .libs/libfoo.so - objcopy --add-gnu-debuglink .libs/libfoo.so.debug .libs/libfoo.so clean-local: @if [ x"$(srcdir)" != x"$(builddir)" ]; then \@@ -28,4 +38,5 @@ clean-local: rm -f $(builddir)/$$script; \ done; \ fi - rm -f .libs/libfoo.so.debug + +CLEANFILES = libfoo.so libfoo.so.debugtests/regression/ust/ust-dl/test_ust-dl.py +1
-2@@ -47,7 +47,7 @@ start_session(session_info) test_env = os.environ.copy() test_env["LD_PRELOAD"] = "liblttng-ust-dl.so" -test_env["LD_LIBRARY_PATH"] = test_path + ".libs/" +test_env["LD_LIBRARY_PATH"] = test_path test_process = subprocess.Popen(test_path + "prog", stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=test_env) --Quoted 2 lines
1.9.1
--
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
Signature · 8 lines
Jérémie Galarneau EfficiOS Inc. http://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev