From dba803d10c0151755ed107cba71b6f31b9660933 Mon Sep 17 00:00:00 2001 From: Nitin A Kamble Date: Mon, 9 May 2011 09:01:42 -0700 Subject: systemtap: fix for compilation with gcc 4.6.0 Signed-off-by: Nitin A Kamble --- .../fix_for_compilation_with_gcc-4.6.0.patch | 119 +++++++++++++++++++++ meta/recipes-kernel/systemtap/systemtap_git.bb | 3 +- 2 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-kernel/systemtap/systemtap/fix_for_compilation_with_gcc-4.6.0.patch (limited to 'meta/recipes-kernel/systemtap') diff --git a/meta/recipes-kernel/systemtap/systemtap/fix_for_compilation_with_gcc-4.6.0.patch b/meta/recipes-kernel/systemtap/systemtap/fix_for_compilation_with_gcc-4.6.0.patch new file mode 100644 index 0000000000..a32217586f --- /dev/null +++ b/meta/recipes-kernel/systemtap/systemtap/fix_for_compilation_with_gcc-4.6.0.patch @@ -0,0 +1,119 @@ +Upstream-Status: Pending + +Fix following compiler errors with gcc 4.6.0: +Nitin A Kamble 2011/05/09 + +| tapsets.cxx: In member function 'void sdt_query::handle_probe_entry()': +| tapsets.cxx:5295:8: error: variable 'kprobe_found' set but not used [-Werror=unused-but-set-variable] +| tapsets.cxx: In member function 'virtual void hwbkpt_builder::build(systemtap_session&, probe*, probe_point*, const literal_map_t&, std::vector&)': +| tapsets.cxx:7655:18: error: variable 'has_symbol_str' set but not used [-Werror=unused-but-set-variable] +| cc1plus: all warnings being treated as errors +| +| make[2]: *** [stap-tapsets.o] Error 1 +| translate.cxx: In member function 'virtual void c_unparser::visit_print_format(print_format*)': +| translate.cxx:4431:6: error: variable 'width_ix' set but not used [-Werror=unused-but-set-variable] +| cc1plus: all warnings being treated as errors +| +| make[2]: *** [stap-translate.o] Error 1 +| common.c: In function 'fatal_handler': +| common.c:397:13: error: variable 'rc' set but not used [-Werror=unused-but-set-variable] +| cc1: all warnings being treated as errors +| +| make[3]: *** [common.o] Error 1 +| make[3]: *** Waiting for unfinished jobs.... +| common.c: In function 'fatal_handler': +| common.c:397:13: error: variable 'rc' set but not used [-Werror=unused-but-set-variable] +| cc1: all warnings being treated as errors +| +| mainloop.c: In function 'chld_proc': +| mainloop.c:56:11: error: variable 'rc' set but not used [-Werror=unused-but-set-variable] +| mainloop.c: In function 'stp_main_loop': +| mainloop.c:623:17: error: variable 'rc' set but not used [-Werror=unused-but-set-variable] +| cc1: all warnings being treated as errors +| + +Index: git/tapsets.cxx +=================================================================== +--- git.orig/tapsets.cxx ++++ git/tapsets.cxx +@@ -5292,7 +5292,6 @@ sdt_query::handle_probe_entry() + probe *new_base = convert_location(); + probe_point *new_location = new_base->locations[0]; + +- bool kprobe_found = false; + bool need_debug_info = false; + + Dwarf_Addr bias; +@@ -5302,7 +5301,6 @@ sdt_query::handle_probe_entry() + if (have_kprobe()) + { + convert_probe(new_base); +- kprobe_found = true; + // Expand the local variables in the probe body + sdt_kprobe_var_expanding_visitor svv (module_val, + provider_name, +@@ -7652,7 +7650,7 @@ hwbkpt_builder::build(systemtap_session + { + string symbol_str_val; + int64_t hwbkpt_address, len; +- bool has_addr, has_symbol_str, has_write, has_rw, has_len; ++ bool has_addr, has_write, has_rw, has_len; + + if (! (sess.kernel_config["CONFIG_PERF_EVENTS"] == string("y"))) + throw semantic_error ("CONFIG_PERF_EVENTS not available on this kernel", +@@ -7662,7 +7660,6 @@ hwbkpt_builder::build(systemtap_session + location->components[0]->tok); + + has_addr = get_param (parameters, TOK_HWBKPT, hwbkpt_address); +- has_symbol_str = get_param (parameters, TOK_HWBKPT, symbol_str_val); + has_len = get_param (parameters, TOK_LENGTH, len); + has_write = (parameters.find(TOK_HWBKPT_WRITE) != parameters.end()); + has_rw = (parameters.find(TOK_HWBKPT_RW) != parameters.end()); +Index: git/translate.cxx +=================================================================== +--- git.orig/translate.cxx ++++ git/translate.cxx +@@ -4428,7 +4428,7 @@ c_unparser::visit_print_format (print_fo + continue; + + /* Take note of the width and precision arguments, if any. */ +- int width_ix = -1, prec_ix= -1; ++ int __attribute((__unused__)) width_ix = -1, prec_ix= -1; + if (components[i].widthtype == print_format::width_dynamic) + width_ix = arg_ix++; + if (components[i].prectype == print_format::prec_dynamic) +Index: git/runtime/staprun/common.c +=================================================================== +--- git.orig/runtime/staprun/common.c ++++ git/runtime/staprun/common.c +@@ -394,7 +394,7 @@ void parse_modpath(const char *inpath) + #define ERR_MSG "\nUNEXPECTED FATAL ERROR in staprun. Please file a bug report.\n" + static void fatal_handler (int signum) + { +- int rc; ++ int __attribute__((__unused__)) rc; + char *str = strsignal(signum); + rc = write (STDERR_FILENO, ERR_MSG, sizeof(ERR_MSG)); + rc = write (STDERR_FILENO, str, strlen(str)); +Index: git/runtime/staprun/mainloop.c +=================================================================== +--- git.orig/runtime/staprun/mainloop.c ++++ git/runtime/staprun/mainloop.c +@@ -53,7 +53,7 @@ static void *signal_thread(void *arg) + + static void chld_proc(int signum) + { +- int32_t rc, btype = STP_EXIT; ++ int32_t __attribute__((__unused__)) rc, btype = STP_EXIT; + dbug(2, "chld_proc %d (%s)\n", signum, strsignal(signum)); + pid_t pid = waitpid(-1, NULL, WNOHANG); + if (pid != target_pid) +@@ -620,7 +620,7 @@ int stp_main_loop(void) + { + /* module asks us to start exiting, so send STP_EXIT */ + dbug(2, "got STP_REQUEST_EXIT\n"); +- int32_t rc, btype = STP_EXIT; ++ int32_t __attribute__((__unused__))rc, btype = STP_EXIT; + rc = write(control_channel, &btype, sizeof(btype)); + break; + } diff --git a/meta/recipes-kernel/systemtap/systemtap_git.bb b/meta/recipes-kernel/systemtap/systemtap_git.bb index 4df09478de..8ac4c14862 100644 --- a/meta/recipes-kernel/systemtap/systemtap_git.bb +++ b/meta/recipes-kernel/systemtap/systemtap_git.bb @@ -5,10 +5,11 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" DEPENDS = "elfutils" SRCREV = "4ab3a1863bf4f472acae7a809bf2b38d91658aa8" -PR = r0 +PR = "r1" PV = "1.4+git${SRCPV}" SRC_URI = "git://sources.redhat.com/git/systemtap.git;protocol=git \ + file://fix_for_compilation_with_gcc-4.6.0.patch \ " EXTRA_OECONF = "--prefix=${D} --with-libelf=${STAGING_DIR_TARGET} --without-rpm \ -- cgit v1.2.3