systemtap/rawhide-6.13-kbuild-compatibility.patch

102 lines
4.1 KiB
Diff
Raw Normal View History

- Upgrade to version 5.2. See systemtap.changes for changelog - Upgrade to version 5.2. See systemtap.changes for changelog - Upgrade to version 5.2. See systemtap.changes for changelog - Resolve errors with linux-6.13 based kernels. Building trivial 'hello world' failed with: <command-line>: fatal error: {path_to}stapconf.h: No such file or directory Attemptng to preserve build directory (-k) caused an infinite loop of: /usr/src/linux-6.13.4-1/scripts/Makefile.build:370: warning: overriding recipe for target 'modules.order' New patch: linux-6.13-fedora-compatibility.patch New patch: rawhide-6.13-kbuild-compatibility.patch - Update to version 5.2 Summary of changes: * SystemTap frontend (stap) changes - New /* pragma:suffix */ for file-level embedded C code blocks to be placed near the end of the emitted kernel module C file. Corresponding macros allow additional C hooks for module init/exit. - With elfutils 0.192's release on 2024-10-18, the "metadata" based probes announced in systemtap 5.0 should now be increasingly available. * SystemTap backend changes - Numerous kernel portability changes - "probe never" probes don't emit C code at all any more. - The standard Fedora spec packaging breaks up the sdt.h header file and the /usr/bin/dtrace stub-builder script, for those cases where the macros in sdt.h are sufficient. - More robust message transport draining during shutdown to prevent message losses. * SystemTap tapset changes - Numerous kernel portability changes - Added a few functions to inet_sock.stp. * SystemTap sample scripts - traceio3.stp: Trace VFS operations by filename regex. - swapmonitor.stp: Trace swap operations. * Bugfixes - PR31597 Systemtap not extracting all the data sent to the print data in the buffers before shutdown - PR31707 Need a way to postpone emitting the file-level embedded C blocks - PR31708 Probe never handlers still emit C code for the handler handlers and probe local structs - PR31699 UBSAN errors for systemtap map functions with Fedora Rawhide and Fedora 39 6.8.8 kernels - PR31740 @hist_log affects the result of @variance - PR31893 access_ok() was called without turning off page faults - PR32064 SEC_ERROR_BAD_DATABASE during very first stap-server start - PR31703 Git detection false positive when 'which' not available - PR32107 Drop obsolete -Werror hack in buildrun.cxx - PR32194 Reflect the uprobe_unregister() split - PR32209 No tracepoints seen using kernel-6.12 - PR32302 Unrecognized tracepoints - RHEL-55262 Handle S390_lowcore macro removal - RHEL-66275 Add some inet_sock.stp tapset functions. - RHEL-66150 Fix cachestat.stp for newer kernels. - RHEL-66577 Add swapmonitor.stp example script. OBS-URL: https://build.opensuse.org/package/show/devel:tools/systemtap?expand=0&rev=154
2025-02-25 21:43:00 +00:00
From: Frank Ch. Eigler <fche@redhat.com>
Date: Fri Jan 17 19:40:56 2025 -0500
Subject: rawhide (6.13) kbuild compatibility
Git-commit: 048ee97b8d57209e824c7078b34f4a130da40363
Signed-off-by: Tony Jones <tonyj@suse.de>
PR32458: rawhide (6.13) kbuild compatibility
Subject kernel versions introduce changes to the kbuild $(MAKE)
invocations process command line options, and twiddle with working
directories, making our systemtap module Makefile not quite
compatible. Sprinkle $(obj)/ liberally around all the generated
header files (used for autoconf* purposes) and nearby. This appears
to make both >6.13 and <6.13 kbuilds happy.
diff --git a/buildrun.cxx b/buildrun.cxx
index 1dae071d1..f369135af 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -186,7 +186,7 @@ output_autoconf(systemtap_session& s, ofstream& o,
const char *deffalse)
{
autoconf_c_files.push_back (autoconf_c);
- o << endl << s.tmpdir << "/" << autoconf_c << ".h:" << endl;
+ o << endl << "$(obj)/" << autoconf_c << ".h:" << endl;
o << "\t";
if (s.verbose < 4)
o << "@";
@@ -286,7 +286,8 @@ compile_pass (systemtap_session& s)
string makefile_nm = s.tmpdir + "/Makefile";
ofstream o (makefile_nm.c_str());
- string stap_export_nm = s.tmpdir + "/stapconf_export.h";
+ string stap_export_basenm = "stapconf_export.h";
+ string stap_export_nm = s.tmpdir + "/" + stap_export_basenm;
ofstream o2 (stap_export_nm.c_str());
// Create makefile
@@ -343,7 +344,7 @@ compile_pass (systemtap_session& s)
o << module_cflags << " += -Wmissing-prototypes" << endl; // GCC14 prep, PR31288
- o << "STAPCONF_HEADER := " << s.tmpdir << "/" << s.stapconf_name << endl;
+ o << "STAPCONF_HEADER := " << "$(obj)/" << s.stapconf_name << endl;
o << ".DELETE_ON_ERROR: $(STAPCONF_HEADER)" << endl;
vector<string> cs; // to hold autoconf C file names
@@ -568,16 +569,16 @@ compile_pass (systemtap_session& s)
// PR32458 (!) Build the combined conf header as an ordinary
// dependency of the module.o file. Don't invoke a sub-$(MAKE) with
// crude command line parsing.
- o << "$(STAPCONF_HEADER): " << stap_export_nm;
+ o << "$(STAPCONF_HEADER): " << "$(obj)/" << stap_export_basenm;
for (unsigned i=0; i<cs.size(); i++)
- o << " " << s.tmpdir << "/" << cs[i] << ".h";
+ o << " " << "$(obj)/" << cs[i] << ".h";
o << endl;
o << "\t";
if (s.verbose < 4)
o << "@";
o << "cat $^ > $(STAPCONF_HEADER)" << endl;
- o << s.module_name <<".o : $(STAPCONF_HEADER)" << endl;
+ o << "$(obj)/" << s.module_name <<".o : $(STAPCONF_HEADER)" << endl;
o << module_cflags << " += -include $(STAPCONF_HEADER)" << endl;
@@ -692,18 +693,20 @@ compile_pass (systemtap_session& s)
}
o << " stap_symbols.o" << endl;
- o << s.tmpdir << "/stap_symbols.o: $(STAPCONF_HEADER)" << endl;
+ o << "$(obj)/stap_symbols.o: $(STAPCONF_HEADER)" << endl;
// add all stapconf dependencies
string translated = s.translated_source;
+ translated = translated.substr(translated.rfind('/')+1); // basename
translated[translated.size()-1] = 'o';
- o << translated << ": $(STAPCONF_HEADER)" << endl;
+ o << "$(obj)/" << translated << ": $(STAPCONF_HEADER)" << endl;
translated[translated.size()-1] = 'i';
- o << translated << ": $(STAPCONF_HEADER)" << endl;
+ o << "$(obj)/" << translated << ": $(STAPCONF_HEADER)" << endl;
for (unsigned i=0; i<s.auxiliary_outputs.size(); i++) {
translated = s.auxiliary_outputs[i]->filename;
+ translated = translated.substr(translated.rfind('/')+1); // basename
translated[translated.size()-1] = 'o';
- o << translated << ": $(STAPCONF_HEADER)" << endl;
+ o << "$(obj)/" << translated << ": $(STAPCONF_HEADER)" << endl;
}
o.close ();
@@ -723,7 +726,7 @@ compile_pass (systemtap_session& s)
// Run make
vector<string> make_cmd = make_make_cmd(s, s.tmpdir);
- if (s.keep_tmpdir)
+ if (false && s.keep_tmpdir) // PR32458: kbuild 6.13+ can't abide multiple make targets
{
string E_source = s.translated_source.substr(s.translated_source.find_last_of("/")+1);
E_source.at(E_source.length() - 1) = 'i'; // overwrite the last character