From 54d088036b6deaa2105bb20c00c0fefd70827f70ad086cebc7ecc0e286c1e487 Mon Sep 17 00:00:00 2001 From: Tony Jones Date: Tue, 2 Apr 2024 19:00:34 +0000 Subject: [PATCH] Accepting request 1164226 from home:jones_tony:branches:devel:tools - Fix runtime issues with v6.8 kernel (bsc#1222249) New patch: get-shm_flag-defines-from-the-appropriate-include-file-for-linux-6.8-kernel.patch New patch: pr31373-deal-with-the-removal-of-strlcpy-from-linux-6.8.patch - Fix gcc14 build errors (bsc#1221706) New patch: bpf-translate.cxx-fix-build-against-upcoming-gcc14.patch New patch: pr31288-build-with-gcc14-cont.patch New patch: pr31288-build-with-gcc14.patch New patch: staprun-fix-build-against-upcoming-gcc14.patch New patch: stapvirt.c-more-gcc-14-werror-calloc-transposed-args-compatibility.patch OBS-URL: https://build.opensuse.org/request/show/1164226 OBS-URL: https://build.opensuse.org/package/show/devel:tools/systemtap?expand=0&rev=148 --- ...cxx-fix-build-against-upcoming-gcc14.patch | 35 + ...te-include-file-for-linux-6.8-kernel.patch | 41 + pr31288-build-with-gcc14-cont.patch | 31 + pr31288-build-with-gcc14.patch | 1292 +++++++++++++++++ ...he-removal-of-strlcpy-from-linux-6.8.patch | 40 + ...run-fix-build-against-upcoming-gcc14.patch | 30 + ...calloc-transposed-args-compatibility.patch | 40 + systemtap.changes | 17 + systemtap.spec | 7 + 9 files changed, 1533 insertions(+) create mode 100644 bpf-translate.cxx-fix-build-against-upcoming-gcc14.patch create mode 100644 get-shm_flag-defines-from-the-appropriate-include-file-for-linux-6.8-kernel.patch create mode 100644 pr31288-build-with-gcc14-cont.patch create mode 100644 pr31288-build-with-gcc14.patch create mode 100644 pr31373-deal-with-the-removal-of-strlcpy-from-linux-6.8.patch create mode 100644 staprun-fix-build-against-upcoming-gcc14.patch create mode 100644 stapvirt.c-more-gcc-14-werror-calloc-transposed-args-compatibility.patch diff --git a/bpf-translate.cxx-fix-build-against-upcoming-gcc14.patch b/bpf-translate.cxx-fix-build-against-upcoming-gcc14.patch new file mode 100644 index 0000000..1b50e6e --- /dev/null +++ b/bpf-translate.cxx-fix-build-against-upcoming-gcc14.patch @@ -0,0 +1,35 @@ +From: Sergei Trofimovich +Date: Fri Dec 22 19:42:38 2023 +0000 +Subject: bpf-translate.cxx: fix build against upcoming `gcc-14` +Git-commit: d42139cf9cd26d0c0363fcfe007716baeb8de517 +References: bsc#1221706 +Signed-off-by: Tony Jones + + + bpf-translate.cxx: fix build against upcoming `gcc-14` (`-Werror=calloc-transposed-args`) + + `gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It + detected minor infelicity in `calloc()` API usage in `systemtap`: + + bpf-translate.cxx: In function 'bpf::BPF_Section* bpf::output_probe(BPF_Output&, program&, const std::string&, unsigned int)': + bpf-translate.cxx:5044:39: error: 'void* calloc(size_t, size_t)' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args] + 5044 | bpf_insn *buf = (bpf_insn*) calloc (sizeof(bpf_insn), ninsns); + | ^~~~~~~~~~~~~~~~ + bpf-translate.cxx:5044:39: note: earlier argument should specify number of elements, later size of each element + +diff --git a/bpf-translate.cxx b/bpf-translate.cxx +index 1a9302463..aa8ef65ce 100644 +--- a/bpf-translate.cxx ++++ b/bpf-translate.cxx +@@ -5041,9 +5041,9 @@ output_probe(BPF_Output &eo, program &prog, + } + } + +- bpf_insn *buf = (bpf_insn*) calloc (sizeof(bpf_insn), ninsns); ++ bpf_insn *buf = (bpf_insn*) calloc (ninsns, sizeof(bpf_insn)); + assert (buf); +- Elf64_Rel *rel = (Elf64_Rel*) calloc (sizeof(Elf64_Rel), nreloc); ++ Elf64_Rel *rel = (Elf64_Rel*) calloc (nreloc, sizeof(Elf64_Rel)); + assert (rel); + + unsigned i = 0, r = 0; diff --git a/get-shm_flag-defines-from-the-appropriate-include-file-for-linux-6.8-kernel.patch b/get-shm_flag-defines-from-the-appropriate-include-file-for-linux-6.8-kernel.patch new file mode 100644 index 0000000..558f6c8 --- /dev/null +++ b/get-shm_flag-defines-from-the-appropriate-include-file-for-linux-6.8-kernel.patch @@ -0,0 +1,41 @@ +From: William Cohen +Date: Tue Feb 20 09:22:34 2024 -0500 +Subject: Get SHM_* flag defines from the appropriate include file for Linux 6.8 kernel +Git-commit: 8a9097d906867d364bc94f9c1552f240ca609422 +References: bsc#1222249 +Signed-off-by: Tony Jones + + Get SHM_* flag defines from the appropriate include file for Linux 6.8 kernels + + Linux git commit bc46ef3cea3d6f6 removed the include/uapi/linux/shm.h + from include/linux/shm.h. For the newer Linux 6.8 kernels need to get + SHM_* defines directly from include/uapi/linux/shm.h. + +diff --git a/tapset/linux/aux_syscalls.stp b/tapset/linux/aux_syscalls.stp +index e773ba7c2..fa915af8f 100644 +--- a/tapset/linux/aux_syscalls.stp ++++ b/tapset/linux/aux_syscalls.stp +@@ -3405,7 +3405,11 @@ function _dup3_flag_str:string(f:long) + %} + + %{ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,8,0) + #include ++#else ++#include ++#endif + static const _stp_val_array _stp_shmat_list[] = { + V(SHM_RDONLY), + V(SHM_RND), +@@ -4149,7 +4153,11 @@ CATCH_DEREF_FAULT(); + + %{ + #include ++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,8,0) + #include ++#else ++#include ++#endif + static const _stp_val_array _stp_shmget_flags_list[] = { + V(IPC_CREAT), + V(IPC_EXCL), diff --git a/pr31288-build-with-gcc14-cont.patch b/pr31288-build-with-gcc14-cont.patch new file mode 100644 index 0000000..2ab1367 --- /dev/null +++ b/pr31288-build-with-gcc14-cont.patch @@ -0,0 +1,31 @@ +Author: Frank Ch. Eigler +Date: Thu Jan 25 16:46:33 2024 -0500 +Subject: PR31288: build with gcc14 cont'd +Git-commit: 11353cf4e90b2344db5609a543c5ccd894550831 +References: bsc#1221706 +Signed-off-by: Tony Jones + +diff --git a/runtime/softfloat.c b/runtime/softfloat.c +index 709e45d2f..869efdf46 100644 +--- a/runtime/softfloat.c ++++ b/runtime/softfloat.c +@@ -614,6 +614,7 @@ uint_fast64_t + |Converting a fp to a str + *------------------------------------------------------------------------*/ + ++char* itoa(uint64_t val); + char* itoa(uint64_t val) + { + int base = 10; +diff --git a/stapregex.cxx b/stapregex.cxx +index e25992bb2..d0371beee 100644 +--- a/stapregex.cxx ++++ b/stapregex.cxx +@@ -103,6 +103,7 @@ void + stapdfa::emit_declaration (translator_output *o) const + { + o->newline() << "// DFA for \"" << orig_input << "\""; ++ o->newline() << "int " << func_name << " (struct context * __restrict__ c, const char *str);"; + o->newline() << "int " << func_name << " (struct context * __restrict__ c, const char *str) {"; + o->indent(1); + diff --git a/pr31288-build-with-gcc14.patch b/pr31288-build-with-gcc14.patch new file mode 100644 index 0000000..bd24029 --- /dev/null +++ b/pr31288-build-with-gcc14.patch @@ -0,0 +1,1292 @@ +From: Frank Ch. Eigler +Date: Thu Jan 25 14:28:38 2024 -0500 +Subject: PR31288: build with gcc14 +Git-commit: 2604d135069f74cf5a223631cf92c9d0d818ef9c +References: bsc#1221706 +Signed-off-by: Tony Jones +X-Info: adjust patch, no 80642fc0d22abf9d5e19e705adfd7f12599ace7c + + PR31288: build with gcc14 + + GCC14 makes -Wmissing-prototypes defaultish on, which triggers on such + gentle-spirited code as: + + void foo(void) { } + + when you should darn well know to have an exact duplicate declaration + prototype first. Because of course. + + void foo(void); + void foo(void) { } + + So anyway, with our fondness for -Werror, this broke the stap runtime + autoconf* business, bits of the runtime, bits of the translator. + Probably more stuff as yet unidentified. If your testsuite logs show: + + [...]: error: no previous prototype for ‘[...]’ [-Werror=missing-prototypes] + + this is probably to blame. + + Since this is coming to clang as well, we now get buildrun.cxx to + force -Wmissing-prototypes on all the time, so as to try to notice + occurrences of this problem earlier. + +diff --git a/buildrun.cxx b/buildrun.cxx +index 76551415c..bb7bdcc9d 100644 +--- a/buildrun.cxx ++++ b/buildrun.cxx +@@ -315,6 +315,7 @@ compile_pass (systemtap_session& s) + o << "CHECK_BUILD := $(CC) -DMODULE $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) $(CPPFLAGS) " + << "$(LINUXINCLUDE) $(_KBUILD_CFLAGS) $(CFLAGS_KERNEL) $(EXTRA_CFLAGS) " + << "$(CFLAGS) -DKBUILD_BASENAME=\\\"" << s.module_name << "\\\" " ++ << "-Wmissing-prototypes " // GCC14 prep, PR31288 + << WERROR << " -S -o /dev/null -xc " << endl; + o << "stap_check_build = $(shell " << superverbose << " if $(CHECK_BUILD) $(1) " + << redirecterrors << " ; then echo \"$(2)\"; else echo \"$(3)\"; fi)" << endl; +@@ -345,6 +346,8 @@ compile_pass (systemtap_session& s) + // o << module_cflags << " += -Iusr/include" << endl; + // since such headers are cleansed of _KERNEL_ pieces that we need + ++ o << module_cflags << " += -Wmissing-prototypes" << endl; // GCC14 prep, PR31288 ++ + o << "STAPCONF_HEADER := " << s.tmpdir << "/" << s.stapconf_name << endl; + o << ".DELETE_ON_ERROR: $(STAPCONF_HEADER)" << endl; + o << "$(STAPCONF_HEADER):" << endl; +diff --git a/runtime/linux/autoconf-access_ok_2args.c b/runtime/linux/autoconf-access_ok_2args.c +index 2e5c79a65..3e6041dd2 100644 +--- a/runtime/linux/autoconf-access_ok_2args.c ++++ b/runtime/linux/autoconf-access_ok_2args.c +@@ -1,5 +1,7 @@ + #include + ++int __something(void); ++ + int __something(void) + { + return access_ok ((void*) 0, 4); +diff --git a/runtime/linux/autoconf-alloc-percpu-align.c b/runtime/linux/autoconf-alloc-percpu-align.c +index 158d579c0..912361269 100644 +--- a/runtime/linux/autoconf-alloc-percpu-align.c ++++ b/runtime/linux/autoconf-alloc-percpu-align.c +@@ -1,6 +1,7 @@ + #include + + /* kernel commit f2a8205c */ ++void foo (void); + void foo (void) { + (void) __alloc_percpu(sizeof(int), 8); + } +diff --git a/runtime/linux/autoconf-asm-access-ok.c b/runtime/linux/autoconf-asm-access-ok.c +index 1d0e61776..7a95758c2 100644 +--- a/runtime/linux/autoconf-asm-access-ok.c ++++ b/runtime/linux/autoconf-asm-access-ok.c +@@ -1,5 +1,6 @@ + #include + ++bool foo(const void __user *ptr, size_t size); + bool foo(const void __user *ptr, size_t size) + { + return __access_ok(ptr, size); +diff --git a/runtime/linux/autoconf-atomic_fetch_add_unless.c b/runtime/linux/autoconf-atomic_fetch_add_unless.c +index b765c39ef..b79c4742d 100644 +--- a/runtime/linux/autoconf-atomic_fetch_add_unless.c ++++ b/runtime/linux/autoconf-atomic_fetch_add_unless.c +@@ -1,5 +1,7 @@ + #include + ++int foo(atomic_t *v); ++ + int foo(atomic_t *v) + { + return atomic_fetch_add_unless(v, 1, 0); +diff --git a/runtime/linux/autoconf-bio-bi_opf.c b/runtime/linux/autoconf-bio-bi_opf.c +index 20db781f3..047ccd68c 100644 +--- a/runtime/linux/autoconf-bio-bi_opf.c ++++ b/runtime/linux/autoconf-bio-bi_opf.c +@@ -19,6 +19,8 @@ + * No intended functional changes in this commit. + */ + ++void bar (void); ++ + void bar (void) + { + struct bio foo; +diff --git a/runtime/linux/autoconf-cpu-clock.c b/runtime/linux/autoconf-cpu-clock.c +index b501bcdf3..6c80afdad 100644 +--- a/runtime/linux/autoconf-cpu-clock.c ++++ b/runtime/linux/autoconf-cpu-clock.c +@@ -29,7 +29,8 @@ + // reference sched_clock_cpu(). Thus it must be exported with the + // EXPORT_SYMBOL_GPL macro. + // +- ++void foo (void); ++ + void foo (void) { + (void) cpu_clock(0); + } +diff --git a/runtime/linux/autoconf-d-real-inode.c b/runtime/linux/autoconf-d-real-inode.c +index 4ab820b8e..b8acdeafe 100644 +--- a/runtime/linux/autoconf-d-real-inode.c ++++ b/runtime/linux/autoconf-d-real-inode.c +@@ -2,7 +2,7 @@ + + /* kernel function d_real_inode() is missing in older kernels like + * kernel-3.10.0-327.el7.x86_64 */ +- ++void foo(void); + void foo(void) { + struct inode *ino = d_real_inode(NULL); + (void) ino; +diff --git a/runtime/linux/autoconf-dpath-path.c b/runtime/linux/autoconf-dpath-path.c +index c3654604b..fd2ae2c3c 100644 +--- a/runtime/linux/autoconf-dpath-path.c ++++ b/runtime/linux/autoconf-dpath-path.c +@@ -1,6 +1,8 @@ + #include + #include + ++void ____autoconf_func(struct path *p); ++ + void ____autoconf_func(struct path *p) + { + (void)d_path(p, NULL, 0); +diff --git a/runtime/linux/autoconf-files_lookup_fd_raw.c b/runtime/linux/autoconf-files_lookup_fd_raw.c +index 9e98aa064..5e8fd37d3 100644 +--- a/runtime/linux/autoconf-files_lookup_fd_raw.c ++++ b/runtime/linux/autoconf-files_lookup_fd_raw.c +@@ -1,6 +1,8 @@ + #include + #include + ++void foo(void); ++ + void + foo(void) + { +diff --git a/runtime/linux/autoconf-from_kuid_munged.c b/runtime/linux/autoconf-from_kuid_munged.c +index 444dac1a6..6405a3bd7 100644 +--- a/runtime/linux/autoconf-from_kuid_munged.c ++++ b/runtime/linux/autoconf-from_kuid_munged.c +@@ -1,6 +1,7 @@ + #include + + /* We need to check for an exported or inlined from_kuid_munged() */ ++uid_t bar (struct user_namespace *ns, kuid_t uid); + uid_t bar (struct user_namespace *ns, kuid_t uid) { + return (from_kuid_munged(ns, uid)); + } +diff --git a/runtime/linux/autoconf-fs_supers-hlist.c b/runtime/linux/autoconf-fs_supers-hlist.c +index 3d626ce90..d49845548 100644 +--- a/runtime/linux/autoconf-fs_supers-hlist.c ++++ b/runtime/linux/autoconf-fs_supers-hlist.c +@@ -11,6 +11,8 @@ vfs: convert fs_supers to hlist + Signed-off-by: Al Viro + */ + ++int foo (struct super_block *sb); ++ + int foo (struct super_block *sb) { + return (hlist_unhashed (& sb->s_instances)); + } +diff --git a/runtime/linux/autoconf-get-kretprobe.c b/runtime/linux/autoconf-get-kretprobe.c +index ae5b4ab51..f25c1eae5 100644 +--- a/runtime/linux/autoconf-get-kretprobe.c ++++ b/runtime/linux/autoconf-get-kretprobe.c +@@ -1,5 +1,7 @@ + #include + ++void* foo(struct kretprobe_instance* ri); ++ + void* foo(struct kretprobe_instance* ri) + { + return get_kretprobe(ri); +diff --git a/runtime/linux/autoconf-get_user_page_vma_remote.c b/runtime/linux/autoconf-get_user_page_vma_remote.c +index df3d05d27..78b28ce8e 100644 +--- a/runtime/linux/autoconf-get_user_page_vma_remote.c ++++ b/runtime/linux/autoconf-get_user_page_vma_remote.c +@@ -31,6 +31,11 @@ + // This forms part of a broader set of patches intended to eliminate the vmas + // parameter altogether. + ++struct page *get_user_page_vma_remote_wrapper(struct mm_struct *mm, ++ unsigned long addr, ++ unsigned int gup_flags, ++ struct vm_area_struct **vmaps); ++ + struct page *get_user_page_vma_remote_wrapper(struct mm_struct *mm, + unsigned long addr, + unsigned int gup_flags, +diff --git a/runtime/linux/autoconf-get_user_pages-flags.c b/runtime/linux/autoconf-get_user_pages-flags.c +index f135afa11..1bc317bb7 100644 +--- a/runtime/linux/autoconf-get_user_pages-flags.c ++++ b/runtime/linux/autoconf-get_user_pages-flags.c +@@ -32,6 +32,11 @@ + // struct vm_area_struct **vmas); + // + ++long gupr_wrapper(struct task_struct *tsk, struct mm_struct *mm, ++ unsigned long start, unsigned long nr_pages, ++ unsigned int gup_flags, struct page **pages, ++ struct vm_area_struct **vmas); ++ + long gupr_wrapper(struct task_struct *tsk, struct mm_struct *mm, + unsigned long start, unsigned long nr_pages, + unsigned int gup_flags, struct page **pages, +diff --git a/runtime/linux/autoconf-get_user_pages-notask_struct.c b/runtime/linux/autoconf-get_user_pages-notask_struct.c +index 15bb73bd2..4def2b4e2 100644 +--- a/runtime/linux/autoconf-get_user_pages-notask_struct.c ++++ b/runtime/linux/autoconf-get_user_pages-notask_struct.c +@@ -29,6 +29,11 @@ + // struct vm_area_struct **vmas); + // + ++long gupr_wrapper(struct mm_struct *mm, ++ unsigned long start, unsigned long nr_pages, ++ unsigned int gup_flags, struct page **pages, ++ struct vm_area_struct **vmas); ++ + long gupr_wrapper(struct mm_struct *mm, + unsigned long start, unsigned long nr_pages, + unsigned int gup_flags, struct page **pages, +diff --git a/runtime/linux/autoconf-get_user_pages_remote-flags.c b/runtime/linux/autoconf-get_user_pages_remote-flags.c +index c0c23609f..1ff9fff76 100644 +--- a/runtime/linux/autoconf-get_user_pages_remote-flags.c ++++ b/runtime/linux/autoconf-get_user_pages_remote-flags.c +@@ -30,6 +30,11 @@ + // struct vm_area_struct **vmas); + // + ++long gupr_wrapper(struct task_struct *tsk, struct mm_struct *mm, ++ unsigned long start, unsigned long nr_pages, ++ unsigned int gup_flags, struct page **pages, ++ struct vm_area_struct **vmas); ++ + long gupr_wrapper(struct task_struct *tsk, struct mm_struct *mm, + unsigned long start, unsigned long nr_pages, + unsigned int gup_flags, struct page **pages, +diff --git a/runtime/linux/autoconf-get_user_pages_remote-flags_locked.c b/runtime/linux/autoconf-get_user_pages_remote-flags_locked.c +index bb9b56717..bda2919a0 100644 +--- a/runtime/linux/autoconf-get_user_pages_remote-flags_locked.c ++++ b/runtime/linux/autoconf-get_user_pages_remote-flags_locked.c +@@ -23,6 +23,11 @@ + // struct vm_area_struct **vmas, int *locked); + // + ++long gupr_wrapper2(struct task_struct *tsk, struct mm_struct *mm, ++ unsigned long start, unsigned long nr_pages, ++ unsigned int gup_flags, struct page **pages, ++ struct vm_area_struct **vmas, int *locked); ++ + long gupr_wrapper2(struct task_struct *tsk, struct mm_struct *mm, + unsigned long start, unsigned long nr_pages, + unsigned int gup_flags, struct page **pages, +diff --git a/runtime/linux/autoconf-get_user_pages_remote-notask_struct.c b/runtime/linux/autoconf-get_user_pages_remote-notask_struct.c +index 3b849af3c..0b50f23ef 100644 +--- a/runtime/linux/autoconf-get_user_pages_remote-notask_struct.c ++++ b/runtime/linux/autoconf-get_user_pages_remote-notask_struct.c +@@ -29,6 +29,11 @@ + // struct vm_area_struct **vmas, int *locked); + // + ++long gupr_wrapper(struct mm_struct *mm, ++ unsigned long start, unsigned long nr_pages, ++ unsigned int gup_flags, struct page **pages, ++ struct vm_area_struct **vmas, int *locked); ++ + long gupr_wrapper(struct mm_struct *mm, + unsigned long start, unsigned long nr_pages, + unsigned int gup_flags, struct page **pages, +diff --git a/runtime/linux/autoconf-grsecurity.c b/runtime/linux/autoconf-grsecurity.c +index ee2e4e55f..2b34290a3 100644 +--- a/runtime/linux/autoconf-grsecurity.c ++++ b/runtime/linux/autoconf-grsecurity.c +@@ -5,6 +5,7 @@ + struct module *t; + unsigned size; + ++void foo (void); + void foo (void) + { + size += t->init_size_rw + t->init_size_rx + t->core_size_rw + t->core_size_rx; +diff --git a/runtime/linux/autoconf-hlist-4args.c b/runtime/linux/autoconf-hlist-4args.c +index ab9f8a5fe..8b504c50d 100644 +--- a/runtime/linux/autoconf-hlist-4args.c ++++ b/runtime/linux/autoconf-hlist-4args.c +@@ -7,6 +7,7 @@ struct foo { + + struct hlist_head *h; + ++void foo (void); + void foo (void) + { + struct hlist_node *n; +diff --git a/runtime/linux/autoconf-hlist_add_tail_rcu.c b/runtime/linux/autoconf-hlist_add_tail_rcu.c +index 2c4660837..e5bc4a75f 100644 +--- a/runtime/linux/autoconf-hlist_add_tail_rcu.c ++++ b/runtime/linux/autoconf-hlist_add_tail_rcu.c +@@ -1,5 +1,8 @@ + #include + ++void foo(struct hlist_node *n, struct hlist_head *h); ++ ++ + void foo(struct hlist_node *n, struct hlist_head *h) + { + hlist_add_tail_rcu(n, h); +diff --git a/runtime/linux/autoconf-hrtimer-getset-expires.c b/runtime/linux/autoconf-hrtimer-getset-expires.c +index 951cb99b3..39a0c23fc 100644 +--- a/runtime/linux/autoconf-hrtimer-getset-expires.c ++++ b/runtime/linux/autoconf-hrtimer-getset-expires.c +@@ -1,5 +1,6 @@ + #include + ++void ____autoconf_func(struct hrtimer *t); + void ____autoconf_func(struct hrtimer *t) + { + hrtimer_set_expires(t, hrtimer_get_expires(t)); +diff --git a/runtime/linux/autoconf-hw_breakpoint_context.c b/runtime/linux/autoconf-hw_breakpoint_context.c +index 0b625657c..d59d29360 100644 +--- a/runtime/linux/autoconf-hw_breakpoint_context.c ++++ b/runtime/linux/autoconf-hw_breakpoint_context.c +@@ -2,6 +2,10 @@ + + /* void *context parameter is new since linux commit 4dc0da. */ + struct perf_event * __percpu * ++hw_breakpoint_context(struct perf_event_attr *attr, ++ perf_overflow_handler_t triggered, ++ void *context); ++struct perf_event * __percpu * + hw_breakpoint_context(struct perf_event_attr *attr, + perf_overflow_handler_t triggered, + void *context) +diff --git a/runtime/linux/autoconf-kernel_read-new-args.c b/runtime/linux/autoconf-kernel_read-new-args.c +index f77c7ccf1..4de0cb7d3 100644 +--- a/runtime/linux/autoconf-kernel_read-new-args.c ++++ b/runtime/linux/autoconf-kernel_read-new-args.c +@@ -27,6 +27,8 @@ + + #include + ++ssize_t foo(struct file *file, void *buf, size_t count, loff_t *pos); ++ + ssize_t foo(struct file *file, void *buf, size_t count, loff_t *pos) + { + return kernel_read(file, buf, count, pos); +diff --git a/runtime/linux/autoconf-kprobe-symbol-name.c b/runtime/linux/autoconf-kprobe-symbol-name.c +index eeb3f840e..6ee187330 100644 +--- a/runtime/linux/autoconf-kprobe-symbol-name.c ++++ b/runtime/linux/autoconf-kprobe-symbol-name.c +@@ -1,5 +1,7 @@ + #include + ++void func(struct kprobe *kp); ++ + void func(struct kprobe *kp) + { + kp->symbol_name = "dummy"; +diff --git a/runtime/linux/autoconf-ktime-get-real.c b/runtime/linux/autoconf-ktime-get-real.c +index 67b71409d..37164da17 100644 +--- a/runtime/linux/autoconf-ktime-get-real.c ++++ b/runtime/linux/autoconf-ktime-get-real.c +@@ -1,5 +1,5 @@ + #include +- ++void ____autoconf_func(struct timespec *ts); + void ____autoconf_func(struct timespec *ts) + { + ktime_get_real_ts(ts); +diff --git a/runtime/linux/autoconf-local-clock.c b/runtime/linux/autoconf-local-clock.c +index d148c873a..f4385ff2f 100644 +--- a/runtime/linux/autoconf-local-clock.c ++++ b/runtime/linux/autoconf-local-clock.c +@@ -29,6 +29,7 @@ + // reference sched_clock_cpu(). Thus it must be exported with the + // EXPORT_SYMBOL_GPL macro. + // ++void foo (void); + + void foo (void) { + (void) local_clock(); +diff --git a/runtime/linux/autoconf-lockdown-debugfs.c b/runtime/linux/autoconf-lockdown-debugfs.c +index 33fe50a54..c9a89ab80 100644 +--- a/runtime/linux/autoconf-lockdown-debugfs.c ++++ b/runtime/linux/autoconf-lockdown-debugfs.c +@@ -1,5 +1,7 @@ + #include + ++int foo(void); ++ + int foo(void) { + return security_locked_down(LOCKDOWN_DEBUGFS); + } +diff --git a/runtime/linux/autoconf-lockdown-kernel.c b/runtime/linux/autoconf-lockdown-kernel.c +index 90c241437..d4439c2fe 100644 +--- a/runtime/linux/autoconf-lockdown-kernel.c ++++ b/runtime/linux/autoconf-lockdown-kernel.c +@@ -1,5 +1,7 @@ + #include + ++int foo(void); ++ + int foo(void) { + return kernel_is_locked_down("something"); + } +diff --git a/runtime/linux/autoconf-mm-context-vdso-base.c b/runtime/linux/autoconf-mm-context-vdso-base.c +index 99748fb75..c1428b492 100644 +--- a/runtime/linux/autoconf-mm-context-vdso-base.c ++++ b/runtime/linux/autoconf-mm-context-vdso-base.c +@@ -1,5 +1,6 @@ + #include + ++int context_vdso(struct task_struct *tsk); + int context_vdso(struct task_struct *tsk) + { + return (tsk->mm->context.vdso_base == 0L); +diff --git a/runtime/linux/autoconf-mm-context-vdso.c b/runtime/linux/autoconf-mm-context-vdso.c +index d2babc108..38e88fde1 100644 +--- a/runtime/linux/autoconf-mm-context-vdso.c ++++ b/runtime/linux/autoconf-mm-context-vdso.c +@@ -1,5 +1,5 @@ + #include +- ++int context_vdso(struct task_struct *tsk); + int context_vdso(struct task_struct *tsk) + { + return (tsk->mm->context.vdso == NULL); +diff --git a/runtime/linux/autoconf-mm-shmempages.c b/runtime/linux/autoconf-mm-shmempages.c +index 2ce742be7..7f914be21 100644 +--- a/runtime/linux/autoconf-mm-shmempages.c ++++ b/runtime/linux/autoconf-mm-shmempages.c +@@ -1,5 +1,7 @@ + #include + ++void foo (void); ++ + void foo (void) { + (void) MM_SHMEMPAGES; + } +diff --git a/runtime/linux/autoconf-mmap_lock.c b/runtime/linux/autoconf-mmap_lock.c +index 42119dc84..194e337a7 100644 +--- a/runtime/linux/autoconf-mmap_lock.c ++++ b/runtime/linux/autoconf-mmap_lock.c +@@ -1,6 +1,8 @@ + #include + #include + ++int foobar(struct mm_struct *mm); ++ + int foobar(struct mm_struct *mm) { + mmap_write_lock (mm); + mmap_read_unlock (mm); +diff --git a/runtime/linux/autoconf-module-sect-attrs.c b/runtime/linux/autoconf-module-sect-attrs.c +index f589dca30..78c0ada49 100644 +--- a/runtime/linux/autoconf-module-sect-attrs.c ++++ b/runtime/linux/autoconf-module-sect-attrs.c +@@ -1,5 +1,7 @@ + #include + ++unsigned long foobar(struct module_sect_attrs *moosas); ++ + unsigned long foobar(struct module_sect_attrs *moosas) + { + struct module_sect_attr msa = moosas->attrs[0]; +diff --git a/runtime/linux/autoconf-netfilter-313b.c b/runtime/linux/autoconf-netfilter-313b.c +index 3b1883077..41fbaaef0 100644 +--- a/runtime/linux/autoconf-netfilter-313b.c ++++ b/runtime/linux/autoconf-netfilter-313b.c +@@ -5,6 +5,13 @@ + // to kernel-3.10.0-284.el7 per rhbz1230935#c4 as patch no 119478. + // This fixes PR18711. + ++unsigned int ++new_style_hook(const struct nf_hook_ops *ops, ++ struct sk_buff *skb, ++ const struct net_device *nf_in, ++ const struct net_device *nf_out, ++ const struct nf_hook_state *state); ++ + unsigned int + new_style_hook(const struct nf_hook_ops *ops, + struct sk_buff *skb, +diff --git a/runtime/linux/autoconf-netfilter-4_1.c b/runtime/linux/autoconf-netfilter-4_1.c +index 9f3ba01d5..a18b46c2b 100644 +--- a/runtime/linux/autoconf-netfilter-4_1.c ++++ b/runtime/linux/autoconf-netfilter-4_1.c +@@ -14,6 +14,11 @@ + // + // Signed-off-by: David S. Miller + ++unsigned int ++newer_style_hook(const struct nf_hook_ops *ops, ++ struct sk_buff *skb, ++ const struct nf_hook_state *state); ++ + unsigned int + newer_style_hook(const struct nf_hook_ops *ops, + struct sk_buff *skb, +diff --git a/runtime/linux/autoconf-netfilter-4_4.c b/runtime/linux/autoconf-netfilter-4_4.c +index ad953efc3..9e1743515 100644 +--- a/runtime/linux/autoconf-netfilter-4_4.c ++++ b/runtime/linux/autoconf-netfilter-4_4.c +@@ -28,6 +28,10 @@ + // So we can simply remove all of the owner handling -- when module is + // removed it also needs to unregister all its hooks. + ++unsigned int even_newer_style_hook(void *priv, ++ struct sk_buff *skb, ++ const struct nf_hook_state *state); ++ + unsigned int even_newer_style_hook(void *priv, + struct sk_buff *skb, + const struct nf_hook_state *state) +diff --git a/runtime/linux/autoconf-netfilter.c b/runtime/linux/autoconf-netfilter.c +index f12266416..42e83fdb7 100644 +--- a/runtime/linux/autoconf-netfilter.c ++++ b/runtime/linux/autoconf-netfilter.c +@@ -1,5 +1,11 @@ + #include + ++unsigned int ++new_style_hook(const struct nf_hook_ops *ops, /* not: unsigned int hook; */ ++ struct sk_buff *skb, ++ const struct net_device *in, const struct net_device *out, ++ int (*okfn)(struct sk_buff *)); ++ + unsigned int + new_style_hook(const struct nf_hook_ops *ops, /* not: unsigned int hook; */ + struct sk_buff *skb, +diff --git a/runtime/linux/autoconf-nmi-uaccess-okay.c b/runtime/linux/autoconf-nmi-uaccess-okay.c +index fd4f54957..0cb4f63db 100644 +--- a/runtime/linux/autoconf-nmi-uaccess-okay.c ++++ b/runtime/linux/autoconf-nmi-uaccess-okay.c +@@ -3,6 +3,8 @@ + + /* this function was no longer an inline since upstream kernel commit + * af5c40c6ee */ ++bool foo(void); ++ + bool foo(void) + { + return nmi_uaccess_okay(); +diff --git a/runtime/linux/autoconf-pagefault_disable.c b/runtime/linux/autoconf-pagefault_disable.c +index c1b2c3a33..2a65f3f08 100644 +--- a/runtime/linux/autoconf-pagefault_disable.c ++++ b/runtime/linux/autoconf-pagefault_disable.c +@@ -1,5 +1,6 @@ + #include +- ++int foo (int c); ++ + int foo (int c) + { + pagefault_disable(); +diff --git a/runtime/linux/autoconf-pde_data.c b/runtime/linux/autoconf-pde_data.c +index e8b582330..d5f7d5b0d 100644 +--- a/runtime/linux/autoconf-pde_data.c ++++ b/runtime/linux/autoconf-pde_data.c +@@ -4,6 +4,8 @@ + + #include + ++void* __something(const struct inode* i); ++ + void* __something(const struct inode* i) + { + return pde_data (i); +diff --git a/runtime/linux/autoconf-perf-structpid.c b/runtime/linux/autoconf-perf-structpid.c +index cbf07ffa1..4fd390821 100644 +--- a/runtime/linux/autoconf-perf-structpid.c ++++ b/runtime/linux/autoconf-perf-structpid.c +@@ -1,5 +1,7 @@ + #include + ++void fn (void); ++ + void fn (void) { + struct perf_event_attr *attr = NULL; + int cpu = 0; +diff --git a/runtime/linux/autoconf-proc_ops.c b/runtime/linux/autoconf-proc_ops.c +index e3d2f93a9..1d302a254 100644 +--- a/runtime/linux/autoconf-proc_ops.c ++++ b/runtime/linux/autoconf-proc_ops.c +@@ -7,6 +7,9 @@ + #include + #include + ++int ++proc_open_file_test(struct inode *inode, struct file *filp); ++ + int + proc_open_file_test(struct inode *inode, struct file *filp) + { +diff --git a/runtime/linux/autoconf-procfs-owner.c b/runtime/linux/autoconf-procfs-owner.c +index dcec58b19..0545a0a50 100644 +--- a/runtime/linux/autoconf-procfs-owner.c ++++ b/runtime/linux/autoconf-procfs-owner.c +@@ -1,7 +1,7 @@ + #include + + /* kernel commit 4d38a69c6 */ +- ++void bar (void); + void bar (void) { + struct proc_dir_entry foo; + foo.owner = (void*) 0; +diff --git a/runtime/linux/autoconf-rcu_is_watching.c b/runtime/linux/autoconf-rcu_is_watching.c +index aca153e2a..4636e9057 100644 +--- a/runtime/linux/autoconf-rcu_is_watching.c ++++ b/runtime/linux/autoconf-rcu_is_watching.c +@@ -4,7 +4,8 @@ + // + // We need to use rcu_is_watching() where available to skip probes in + // rcu-idle state. +- ++struct context * _stp_runtime_get_context(void); ++ + struct context * _stp_runtime_get_context(void) + { + if (! rcu_is_watching()) +diff --git a/runtime/linux/autoconf-real-parent.c b/runtime/linux/autoconf-real-parent.c +index 16c26c479..fe7e3b567 100644 +--- a/runtime/linux/autoconf-real-parent.c ++++ b/runtime/linux/autoconf-real-parent.c +@@ -8,6 +8,7 @@ + + struct task_struct t; + ++void foo (void); + void foo (void) + { + struct task_struct *p; +diff --git a/runtime/linux/autoconf-regset.c b/runtime/linux/autoconf-regset.c +index 9d994b03c..895f58fd9 100644 +--- a/runtime/linux/autoconf-regset.c ++++ b/runtime/linux/autoconf-regset.c +@@ -1,5 +1,6 @@ + #include + ++int foobar(int n); + int foobar(int n) { + const struct user_regset_view *rsv = task_user_regset_view(current); + const struct user_regset *rs = & rsv->regsets[0]; +diff --git a/runtime/linux/autoconf-relay-umode_t.c b/runtime/linux/autoconf-relay-umode_t.c +index a9e5126c0..6ebadbcda 100644 +--- a/runtime/linux/autoconf-relay-umode_t.c ++++ b/runtime/linux/autoconf-relay-umode_t.c +@@ -27,6 +27,8 @@ static struct rchan_callbacks __stp_relay_callbacks = { + .create_buf_file = umode_t_callback, + }; + ++void foo (void); ++ + void foo (void) { + (void) __stp_relay_callbacks.create_buf_file; + } +diff --git a/runtime/linux/autoconf-relay_buf-per_cpu_ptr.c b/runtime/linux/autoconf-relay_buf-per_cpu_ptr.c +index c105b3301..aae72376b 100644 +--- a/runtime/linux/autoconf-relay_buf-per_cpu_ptr.c ++++ b/runtime/linux/autoconf-relay_buf-per_cpu_ptr.c +@@ -19,6 +19,8 @@ + #include + #include + ++struct rchan_buf *relay_buf_test(struct rchan *chan, unsigned int cpu); ++ + struct rchan_buf *relay_buf_test(struct rchan *chan, unsigned int cpu) + { + BUILD_BUG_ON(sizeof(chan->buf) != sizeof(struct rchan_buf **)); +diff --git a/runtime/linux/autoconf-ring_buffer-flags.c b/runtime/linux/autoconf-ring_buffer-flags.c +index 7d7b8df03..7f4e5fa3e 100644 +--- a/runtime/linux/autoconf-ring_buffer-flags.c ++++ b/runtime/linux/autoconf-ring_buffer-flags.c +@@ -1,5 +1,5 @@ + #include +- ++void ___autoconf_func(void); + void ___autoconf_func(void) + { + (void)ring_buffer_lock_reserve(NULL, 0, 0); +diff --git a/runtime/linux/autoconf-ring_buffer_lost_events.c b/runtime/linux/autoconf-ring_buffer_lost_events.c +index df3e315b3..52f3f7982 100644 +--- a/runtime/linux/autoconf-ring_buffer_lost_events.c ++++ b/runtime/linux/autoconf-ring_buffer_lost_events.c +@@ -2,7 +2,7 @@ + ring_buffer peek and consume calls. */ + #include + #include +- ++struct ring_buffer_event *foo (void); + struct ring_buffer_event *foo (void) + { + /* last field is not always there */ +diff --git a/runtime/linux/autoconf-ring_buffer_read_prepare.c b/runtime/linux/autoconf-ring_buffer_read_prepare.c +index 03dc6ea10..22fa46d44 100644 +--- a/runtime/linux/autoconf-ring_buffer_read_prepare.c ++++ b/runtime/linux/autoconf-ring_buffer_read_prepare.c +@@ -2,6 +2,7 @@ + #include + #include + ++void foo (void); + void foo (void) + { + ring_buffer_read_prepare(NULL, 1); +diff --git a/runtime/linux/autoconf-save-stack-trace-no-bp.c b/runtime/linux/autoconf-save-stack-trace-no-bp.c +index 5c940f2d3..f1485ef8a 100644 +--- a/runtime/linux/autoconf-save-stack-trace-no-bp.c ++++ b/runtime/linux/autoconf-save-stack-trace-no-bp.c +@@ -3,6 +3,8 @@ + #include + #include + ++void foo(struct task_struct *foo); ++ + void foo(struct task_struct *foo) + { + struct stack_trace trace; +diff --git a/runtime/linux/autoconf-save-stack-trace.c b/runtime/linux/autoconf-save-stack-trace.c +index 07d45c312..922017126 100644 +--- a/runtime/linux/autoconf-save-stack-trace.c ++++ b/runtime/linux/autoconf-save-stack-trace.c +@@ -3,6 +3,8 @@ + #include + #include + ++void foo(struct task_struct *foo); ++ + void foo(struct task_struct *foo) + { + struct stack_trace trace; +@@ -16,6 +18,8 @@ void foo(struct task_struct *foo) + + static const struct stacktrace_ops print_stack_ops; + ++void dumper(struct task_struct *foo); ++ + void dumper(struct task_struct *foo) + { + dump_trace(foo, 0, 0, 0, &print_stack_ops, 0); +diff --git a/runtime/linux/autoconf-set_fs.c b/runtime/linux/autoconf-set_fs.c +index 939e22f83..3fbdf8fac 100644 +--- a/runtime/linux/autoconf-set_fs.c ++++ b/runtime/linux/autoconf-set_fs.c +@@ -1,6 +1,7 @@ + #include + + // XXX set_fs is an inline function, so we can't detect it with exportconf: ++void __something(void); + void __something(void) + { + mm_segment_t oldfs = get_fs(); +diff --git a/runtime/linux/autoconf-smpcall-4args.c b/runtime/linux/autoconf-smpcall-4args.c +index 2966d95ee..168b6c991 100644 +--- a/runtime/linux/autoconf-smpcall-4args.c ++++ b/runtime/linux/autoconf-smpcall-4args.c +@@ -1,11 +1,15 @@ + #include + #include + ++void foo (void *arg); ++ + void foo (void *arg) + { + (void) arg; + } + ++void bar (void); ++ + void bar (void) + { + smp_call_function_single (0, &foo, 0, 1); +diff --git a/runtime/linux/autoconf-smpcall-5args.c b/runtime/linux/autoconf-smpcall-5args.c +index 83060f48d..1c8a948ea 100644 +--- a/runtime/linux/autoconf-smpcall-5args.c ++++ b/runtime/linux/autoconf-smpcall-5args.c +@@ -1,11 +1,15 @@ + #include + #include + ++void foo (void *arg); ++ + void foo (void *arg) + { + (void) arg; + } + ++void bar (void); ++ + void bar (void) + { + smp_call_function_single (0, &foo, 0, 1, 0); +diff --git a/runtime/linux/autoconf-stack-trace-save-regs.c b/runtime/linux/autoconf-stack-trace-save-regs.c +index 1fd515f8f..d1e541a9f 100644 +--- a/runtime/linux/autoconf-stack-trace-save-regs.c ++++ b/runtime/linux/autoconf-stack-trace-save-regs.c +@@ -1,5 +1,7 @@ + #include + ++unsigned int foo (void); ++ + unsigned int foo (void) + { + unsigned long e[10]; +diff --git a/runtime/linux/autoconf-stacktrace_h.c b/runtime/linux/autoconf-stacktrace_h.c +index ced52b2cb..236e41331 100644 +--- a/runtime/linux/autoconf-stacktrace_h.c ++++ b/runtime/linux/autoconf-stacktrace_h.c +@@ -3,6 +3,8 @@ + // Check to see if there is an + // and a struc stack_frame defined. + // Older kernels have struct stack_frame in . ++int stack_frame_size(void); ++ + int stack_frame_size(void) { + return sizeof(struct stack_frame); + } +diff --git a/runtime/linux/autoconf-stacktrace_ops-int-address.c b/runtime/linux/autoconf-stacktrace_ops-int-address.c +index 8ca277a6e..fb215ef11 100644 +--- a/runtime/linux/autoconf-stacktrace_ops-int-address.c ++++ b/runtime/linux/autoconf-stacktrace_ops-int-address.c +@@ -4,6 +4,10 @@ + // check for 4.6 patch which changed the function signature of + // stacktrace_ops 'address' member. + ++int print_stack_address(void *data __attribute__ ((unused)), ++ unsigned long addr __attribute__ ((unused)), ++ int reliable __attribute__ ((unused))); ++ + int print_stack_address(void *data __attribute__ ((unused)), + unsigned long addr __attribute__ ((unused)), + int reliable __attribute__ ((unused))) +diff --git a/runtime/linux/autoconf-stacktrace_ops-warning.c b/runtime/linux/autoconf-stacktrace_ops-warning.c +index 9c00f0583..75243e79f 100644 +--- a/runtime/linux/autoconf-stacktrace_ops-warning.c ++++ b/runtime/linux/autoconf-stacktrace_ops-warning.c +@@ -2,6 +2,8 @@ + #include + #include + ++void foo (void); ++ + void foo (void) + { + struct stacktrace_ops t; +diff --git a/runtime/linux/autoconf-syscall_get_args_3args.c b/runtime/linux/autoconf-syscall_get_args_3args.c +index c08faa915..3435d99b0 100644 +--- a/runtime/linux/autoconf-syscall_get_args_3args.c ++++ b/runtime/linux/autoconf-syscall_get_args_3args.c +@@ -7,6 +7,7 @@ struct task_struct *task; + struct pt_regs *regs; + unsigned long *args; + ++void __something(void); + void __something(void) + { + syscall_get_arguments(task, regs, args); +diff --git a/runtime/linux/autoconf-task-state.c b/runtime/linux/autoconf-task-state.c +index 27a1d7c13..2941f2ef3 100644 +--- a/runtime/linux/autoconf-task-state.c ++++ b/runtime/linux/autoconf-task-state.c +@@ -13,6 +13,8 @@ + + #include + ++unsigned int bar (struct task_struct *foo); ++ + unsigned int bar (struct task_struct *foo) { + return (foo->state = 0); + } +diff --git a/runtime/linux/autoconf-task-uid.c b/runtime/linux/autoconf-task-uid.c +index 8e40f8314..614b450e2 100644 +--- a/runtime/linux/autoconf-task-uid.c ++++ b/runtime/linux/autoconf-task-uid.c +@@ -1,5 +1,7 @@ + #include + ++int bar (struct task_struct *foo); ++ + int bar (struct task_struct *foo) { + return (foo->uid = 0); + } +diff --git a/runtime/linux/autoconf-task_work-struct.c b/runtime/linux/autoconf-task_work-struct.c +index b6dbf14d2..aedaea9ed 100644 +--- a/runtime/linux/autoconf-task_work-struct.c ++++ b/runtime/linux/autoconf-task_work-struct.c +@@ -2,6 +2,8 @@ + + /* Original task_work code used 'struct task_work' (and + * init_task_work() had 3 arguments). */ ++void __autoconf_func(void); ++ + void __autoconf_func(void) + { + struct task_work work; +diff --git a/runtime/linux/autoconf-trace-printk.c b/runtime/linux/autoconf-trace-printk.c +index c7515bc64..dbed8880c 100644 +--- a/runtime/linux/autoconf-trace-printk.c ++++ b/runtime/linux/autoconf-trace-printk.c +@@ -1,6 +1,7 @@ + #include + #include + ++int bar (void); + int bar (void) { + static char *fmt = "%s\n"; + trace_printk (fmt, "hello world"); +diff --git a/runtime/linux/autoconf-tracepoint-has-data.c b/runtime/linux/autoconf-tracepoint-has-data.c +index 777c31378..c34c6db38 100644 +--- a/runtime/linux/autoconf-tracepoint-has-data.c ++++ b/runtime/linux/autoconf-tracepoint-has-data.c +@@ -1,6 +1,9 @@ + #include + #include + ++ ++void baz (void *cb_data, struct task_struct *parent, struct task_struct *child); ++ + void baz (void *cb_data, struct task_struct *parent, struct task_struct *child) { + (void) cb_data; + (void) parent; +@@ -10,6 +13,8 @@ void baz (void *cb_data, struct task_struct *parent, struct task_struct *child) + /* Until 2.6.35 (commit 38516ab59fbc5b), register_trace_* took one argument. + Until 5.7.0 (commit a2806ef77ff9a9), this could be checked by checking + for the absence of DECLARE_TRACE_NOARGS. Now _NOARGS variant is removed. */ ++void bar (void); ++ + void bar (void) { + register_trace_sched_process_fork(baz, NULL); + } +diff --git a/runtime/linux/autoconf-tracepoint-strings.c b/runtime/linux/autoconf-tracepoint-strings.c +index 1b4785c8d..fcfaa0c2e 100644 +--- a/runtime/linux/autoconf-tracepoint-strings.c ++++ b/runtime/linux/autoconf-tracepoint-strings.c +@@ -1,6 +1,7 @@ + #include + + /* Until 3.15 (commit de7b2973903c), tracepoints used strings to register. */ ++void foo (void); + void foo (void) { + (void) tracepoint_probe_register("foo", NULL, NULL); + tracepoint_probe_unregister("foo", NULL, NULL); +diff --git a/runtime/linux/autoconf-twa_resume.c b/runtime/linux/autoconf-twa_resume.c +index 306cd28ef..5a6a1d958 100644 +--- a/runtime/linux/autoconf-twa_resume.c ++++ b/runtime/linux/autoconf-twa_resume.c +@@ -2,6 +2,8 @@ + + // Check to see if there is a define or enum for TWA_RESUME. + // Older kernels just pass in true or false into task_work_add() ++int twa_resume_exist(void); ++ + int twa_resume_exist(void) { + return (TWA_RESUME == TWA_RESUME); + } +diff --git a/runtime/linux/autoconf-udelay_simple.c b/runtime/linux/autoconf-udelay_simple.c +index 3a7b19fb3..755448e7c 100644 +--- a/runtime/linux/autoconf-udelay_simple.c ++++ b/runtime/linux/autoconf-udelay_simple.c +@@ -1,5 +1,7 @@ + #include + ++void foo (unsigned long long usecs); ++ + void foo (unsigned long long usecs) + { + udelay_simple(usecs); +diff --git a/runtime/linux/autoconf-unwind-stack-trace.c b/runtime/linux/autoconf-unwind-stack-trace.c +index 2ec399e67..8f784ffa4 100644 +--- a/runtime/linux/autoconf-unwind-stack-trace.c ++++ b/runtime/linux/autoconf-unwind-stack-trace.c +@@ -1,6 +1,8 @@ + #include + #include + ++void unwind_stack_trace (void); ++ + void unwind_stack_trace (void) + { + struct unwind_state state; +diff --git a/runtime/linux/autoconf-user-access-begin-2-args.c b/runtime/linux/autoconf-user-access-begin-2-args.c +index 2ecc5af9e..32a82ae7a 100644 +--- a/runtime/linux/autoconf-user-access-begin-2-args.c ++++ b/runtime/linux/autoconf-user-access-begin-2-args.c +@@ -1,5 +1,7 @@ + #include + ++bool foo(const void __user *ptr, size_t size); ++ + bool foo(const void __user *ptr, size_t size) + { + return user_access_begin(ptr, size); +diff --git a/runtime/linux/autoconf-user-access-begin-3-args.c b/runtime/linux/autoconf-user-access-begin-3-args.c +index 2942ddf08..2bb795b5f 100644 +--- a/runtime/linux/autoconf-user-access-begin-3-args.c ++++ b/runtime/linux/autoconf-user-access-begin-3-args.c +@@ -1,5 +1,7 @@ + #include + ++bool foo(int mode, const void __user *ptr, size_t size); ++ + bool foo(int mode, const void __user *ptr, size_t size) + { + return user_access_begin(mode, ptr, size); +diff --git a/runtime/linux/autoconf-user-access-end.c b/runtime/linux/autoconf-user-access-end.c +index 4eafb8222..6109d42b6 100644 +--- a/runtime/linux/autoconf-user-access-end.c ++++ b/runtime/linux/autoconf-user-access-end.c +@@ -1,5 +1,5 @@ + #include +- ++void foo(void); + void foo(void) + { + user_access_end(); +diff --git a/runtime/linux/autoconf-utrace-via-tracepoints.c b/runtime/linux/autoconf-utrace-via-tracepoints.c +index 89ba29822..95f844015 100644 +--- a/runtime/linux/autoconf-utrace-via-tracepoints.c ++++ b/runtime/linux/autoconf-utrace-via-tracepoints.c +@@ -13,6 +13,10 @@ + #error "CONFIG_TRACEPOINTS is not enabled" + #endif + ++void __sched_process_fork(void *cb_data __attribute__((unused)), ++ struct task_struct *parent __attribute__((unused)), ++ struct task_struct *child __attribute__((unused))); ++ + void __sched_process_fork(void *cb_data __attribute__((unused)), + struct task_struct *parent __attribute__((unused)), + struct task_struct *child __attribute__((unused))) +@@ -20,12 +24,18 @@ void __sched_process_fork(void *cb_data __attribute__((unused)), + return; + } + ++void __sched_process_exit(void *cb_data __attribute__((unused)), ++ struct task_struct *task __attribute__((unused))); + void __sched_process_exit(void *cb_data __attribute__((unused)), + struct task_struct *task __attribute__((unused))) + { + return; + } + ++void __sched_process_exec(void *cb_data __attribute__ ((unused)), ++ struct task_struct *task __attribute__((unused)), ++ pid_t old_pid __attribute__((unused)), ++ struct linux_binprm *bprm __attribute__((unused))); + void __sched_process_exec(void *cb_data __attribute__ ((unused)), + struct task_struct *task __attribute__((unused)), + pid_t old_pid __attribute__((unused)), +@@ -34,6 +44,9 @@ void __sched_process_exec(void *cb_data __attribute__ ((unused)), + return; + } + ++void __sys_enter(void *cb_data __attribute__ ((unused)), ++ struct pt_regs *regs __attribute__((unused)), ++ long id __attribute__((unused))); + void __sys_enter(void *cb_data __attribute__ ((unused)), + struct pt_regs *regs __attribute__((unused)), + long id __attribute__((unused))) +@@ -41,6 +54,9 @@ void __sys_enter(void *cb_data __attribute__ ((unused)), + return; + } + ++void __sys_exit(void *cb_data __attribute__ ((unused)), ++ struct pt_regs *regs __attribute__((unused)), ++ long ret __attribute__((unused))); + void __sys_exit(void *cb_data __attribute__ ((unused)), + struct pt_regs *regs __attribute__((unused)), + long ret __attribute__((unused))) +@@ -48,7 +64,8 @@ void __sys_exit(void *cb_data __attribute__ ((unused)), + return; + } + +-void __autoconf_func(void) ++void __autoconf_func(void); ++void __autoconf_func(void) + { + (void) register_trace_sched_process_fork(__sched_process_fork, NULL); + (void) register_trace_sched_process_exit(__sched_process_exit, NULL); +diff --git a/runtime/linux/autoconf-vm-area-pte.c b/runtime/linux/autoconf-vm-area-pte.c +index 6493cb0d1..f1541e931 100644 +--- a/runtime/linux/autoconf-vm-area-pte.c ++++ b/runtime/linux/autoconf-vm-area-pte.c +@@ -1,6 +1,8 @@ + #include + + /* kernel commit cd12909cb576d373 */ ++struct vm_struct * foo (void); ++ + struct vm_struct * foo (void) { + return alloc_vm_area(PAGE_SIZE, NULL); + } +diff --git a/runtime/linux/autoconf-walk-stack.c b/runtime/linux/autoconf-walk-stack.c +index c6c972917..2b02e45ba 100644 +--- a/runtime/linux/autoconf-walk-stack.c ++++ b/runtime/linux/autoconf-walk-stack.c +@@ -2,6 +2,8 @@ + #include + #include + ++void foo (void); ++ + void foo (void) + { + struct stacktrace_ops t; +diff --git a/runtime/linux/perf_event_counter_context.c b/runtime/linux/perf_event_counter_context.c +index 04d5912cb..88ff2bc87 100644 +--- a/runtime/linux/perf_event_counter_context.c ++++ b/runtime/linux/perf_event_counter_context.c +@@ -1,6 +1,13 @@ + #include + + /* void *context parameter is new since linux commit 4dc0da. */ ++struct perf_event * ++pref_ec_context(struct perf_event_attr *attr, ++ int cpu, ++ struct task_struct *task, ++ perf_overflow_handler_t callback, ++ void *context); ++ + struct perf_event * + pref_ec_context(struct perf_event_attr *attr, + int cpu, +diff --git a/runtime/linux/runtime.h b/runtime/linux/runtime.h +index a0a9ac389..1fa62c7ed 100644 +--- a/runtime/linux/runtime.h ++++ b/runtime/linux/runtime.h +@@ -457,6 +457,7 @@ static int stap_init_module (void) + + module_init(stap_init_module); + ++void stap_cleanup_module(void); + void stap_cleanup_module(void) + { + _stp_transport_close(); +diff --git a/runtime/linux/task_finder2.c b/runtime/linux/task_finder2.c +index 3e97dd817..9c2f5ad88 100644 +--- a/runtime/linux/task_finder2.c ++++ b/runtime/linux/task_finder2.c +@@ -695,6 +695,10 @@ __stp_call_callbacks(struct stap_task_finder_target *tgt, + } + } + ++bool ++__verify_build_id(struct task_struct *tsk, unsigned long addr, ++ unsigned const char *build_id, int build_id_len); ++ + bool + __verify_build_id(struct task_struct *tsk, unsigned long addr, + unsigned const char *build_id, int build_id_len) +diff --git a/runtime/sym.c b/runtime/sym.c +index 720ba2239..d702d1f11 100644 +--- a/runtime/sym.c ++++ b/runtime/sym.c +@@ -368,9 +368,9 @@ static void _stp_filename_lookup_5(struct _stp_module *mod, char ** filename, + + #endif /* STP_NEED_LINE_DATA */ + +-unsigned long _stp_linenumber_lookup(unsigned long addr, struct task_struct *task, +- char ** filename, int need_filename, +- struct context *c) ++static unsigned long _stp_linenumber_lookup(unsigned long addr, struct task_struct *task, ++ char ** filename, int need_filename, ++ struct context *c) + { + struct _stp_module *m; + struct _stp_section *sec; +diff --git a/runtime/transport/symbols.c b/runtime/transport/symbols.c +index 64ade9e0f..92635f3be 100644 +--- a/runtime/transport/symbols.c ++++ b/runtime/transport/symbols.c +@@ -154,6 +154,8 @@ struct stap_module_sect_attrs + void get_module_sect_attrs(struct module* mod, + struct stap_module_sect_attrs* as); + ++void put_module_sect_attrs(struct stap_module_sect_attrs* as); ++ + void put_module_sect_attrs(struct stap_module_sect_attrs* as) + { + _stp_kfree(as->sections); +diff --git a/tapset/linux/aux_syscalls.stp b/tapset/linux/aux_syscalls.stp +index 0a7cd74dc..cf54aa152 100644 +--- a/tapset/linux/aux_syscalls.stp ++++ b/tapset/linux/aux_syscalls.stp +@@ -152,6 +152,8 @@ _stp_lookup_or_str(const _stp_val_array * const array, long val, char *ptr, + + #ifndef STAPCONF_SIGSET_FROM_COMPAT_EXPORTED + void ++sigset_from_compat(sigset_t *set, compat_sigset_t *compat); ++void + sigset_from_compat(sigset_t *set, compat_sigset_t *compat) + { + switch (_NSIG_WORDS) { +diff --git a/tapsets.cxx b/tapsets.cxx +index 4b8fa853d..05ad07e75 100644 +--- a/tapsets.cxx ++++ b/tapsets.cxx +@@ -12229,6 +12229,7 @@ tracepoint_derived_probe_group::emit_module_decls (systemtap_session& s) + if (used_args.empty()) + { + tpop->newline() << "STP_TRACE_ENTER_REAL_NOARGS(" << enter_real_fn << ");"; ++ s.op->newline() << "STP_TRACE_ENTER_REAL_NOARGS(" << enter_real_fn << ");"; + s.op->newline() << "STP_TRACE_ENTER_REAL_NOARGS(" << enter_real_fn << ")"; + } + else +@@ -12242,6 +12243,14 @@ tracepoint_derived_probe_group::emit_module_decls (systemtap_session& s) + s.op->newline() << ", int64_t __tracepoint_arg_" << used_args[j]->name; + } + tpop->line() << ");"; ++ s.op->newline() << ");"; ++ s.op->indent(-2); ++ s.op->newline() << "STP_TRACE_ENTER_REAL(" << enter_real_fn; ++ s.op->indent(2); ++ for (unsigned j = 0; j < used_args.size(); ++j) ++ { ++ s.op->newline() << ", int64_t __tracepoint_arg_" << used_args[j]->name; ++ } + s.op->newline() << ")"; + s.op->indent(-2); + } +@@ -12294,6 +12303,8 @@ tracepoint_derived_probe_group::emit_module_decls (systemtap_session& s) + + + // emit normalized registration functions ++ s.op->newline() << "int register_tracepoint_probe_" << i << "(void);"; ++ tpop->newline() << "int register_tracepoint_probe_" << i << "(void);" << endl; + tpop->newline() << "int register_tracepoint_probe_" << i << "(void) {"; + tpop->newline(1) << "return STP_TRACE_REGISTER(" << p->tracepoint_name + << ", " << enter_fn << ");"; +@@ -12303,16 +12314,16 @@ tracepoint_derived_probe_group::emit_module_decls (systemtap_session& s) + // can only occur if the tracepoint doesn't exist (yet?), or if we + // weren't even registered. The former should be OKed by the initial + // registration call, and the latter is safe to ignore. ++ ++ // declare normalized registration functions ++ s.op->newline() << "void unregister_tracepoint_probe_" << i << "(void);"; ++ tpop->newline() << "void unregister_tracepoint_probe_" << i << "(void);" << endl; + tpop->newline() << "void unregister_tracepoint_probe_" << i << "(void) {"; + tpop->newline(1) << "(void) STP_TRACE_UNREGISTER(" << p->tracepoint_name + << ", " << enter_fn << ");"; + tpop->newline(-1) << "}"; + tpop->newline(); + +- // declare normalized registration functions +- s.op->newline() << "int register_tracepoint_probe_" << i << "(void);"; +- s.op->newline() << "void unregister_tracepoint_probe_" << i << "(void);"; +- + tpop->assert_0_indent(); + } + +diff --git a/translate.cxx b/translate.cxx +index 675ef589f..24091d62b 100644 +--- a/translate.cxx ++++ b/translate.cxx +@@ -1211,6 +1211,7 @@ c_unparser::emit_common_header () + o->newline( 0) << "#define STP_ON_THE_FLY_INTERVAL (100*1000*1000)"; // default to 100 ms + o->newline( 0) << "#endif"; + ++ o->newline( 0) << "hrtimer_return_t module_refresh_timer_cb(struct hrtimer *timer);"; + o->newline( 0) << "hrtimer_return_t module_refresh_timer_cb(struct hrtimer *timer) {"; + o->newline(+1) << "if (atomic_cmpxchg(&need_module_refresh, 1, 0) == 1)"; + // NB: one might like to invoke systemtap_module_refresh(NULL) directly from diff --git a/pr31373-deal-with-the-removal-of-strlcpy-from-linux-6.8.patch b/pr31373-deal-with-the-removal-of-strlcpy-from-linux-6.8.patch new file mode 100644 index 0000000..8fc28d5 --- /dev/null +++ b/pr31373-deal-with-the-removal-of-strlcpy-from-linux-6.8.patch @@ -0,0 +1,40 @@ +From: William Cohen +Date: Wed Feb 14 09:33:30 2024 -0500 +Subject: PR31373: Deal with the removal of strlcpy() from linux 6.8 +Git-commit: 60c3d8b1c90c58ca7c048ef24e1b03c6c04b36ad +References: bsc#1222249 +Signed-off-by: Tony Jones + + PR31373: Deal with the removal of strlcpy() from linux 6.8 + + The Linux 6.8 kernels removed strlcpy() with git commit d26270061a in + January 2024. All the kernel's strlcpy() uses were converted to + strscpy(). Systemtap needed to do the same. This is implemented in + systemtap with a strlcpy macro in the runtime that translates the + strscpy() return value into the equivalent strlcpy() value. + +diff --git a/runtime/linux/runtime.h b/runtime/linux/runtime.h +index 1fa62c7ed..0e9fe3fea 100644 +--- a/runtime/linux/runtime.h ++++ b/runtime/linux/runtime.h +@@ -48,6 +48,20 @@ + #include + #endif + ++// PR31373: Linux 6.8 kernel removed strlcpy ++// This provides equivalent to strlcpy using strscpy ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) ++#define strlcpy(dest, src, count) ({ \ ++ size_t size=(count); \ ++ ssize_t retval = strscpy((dest), (src), size);\ ++ if (retval<0) \ ++ retval = size; /* was truncated */ \ ++ else \ ++ retval++; /* count the NULL */ \ ++ retval; \ ++}) ++#endif ++ + // PR26811: Replace some declarations after set_fs() removal in kernel 5.10+. + // Should use the STP_* prefixed defines outside of STAPCONF_SET_FS. + #if defined(STAPCONF_SET_FS) diff --git a/staprun-fix-build-against-upcoming-gcc14.patch b/staprun-fix-build-against-upcoming-gcc14.patch new file mode 100644 index 0000000..7b31027 --- /dev/null +++ b/staprun-fix-build-against-upcoming-gcc14.patch @@ -0,0 +1,30 @@ +From: Sergei Trofimovich +Date: Thu Dec 21 10:00:06 2023 +0000 +Subject: staprun: fix build against upcoming `gcc-14` +Git-commit: 52596f023652114642faba5726c99488529029ce +References: bsc#1221706 +Signed-off-by: Tony Jones + + staprun: fix build against upcoming `gcc-14` (`-Werror=calloc-transposed-args`) + + `gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It + detected minor infelicity in `calloc()` API usage in `systemtap`: + + staprun.c: In function 'main': + staprun.c:550:50: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args] + 550 | char ** new_argv = calloc(sizeof(char *),argc+2); + | ^~~~ + +diff --git a/staprun/staprun.c b/staprun/staprun.c +index 8437f3af6..d1b0b221b 100644 +--- a/staprun/staprun.c ++++ b/staprun/staprun.c +@@ -547,7 +547,7 @@ int main(int argc, char **argv) + us to extend argv[], with all the C fun that entails. */ + #ifdef HAVE_OPENAT + if (relay_basedir_fd >= 0) { +- char ** new_argv = calloc(sizeof(char *),argc+2); ++ char ** new_argv = calloc(argc+2, sizeof(char *)); + const int new_Foption_size = 10; /* -FNNNNN */ + char * new_Foption = malloc(new_Foption_size); + int i; diff --git a/stapvirt.c-more-gcc-14-werror-calloc-transposed-args-compatibility.patch b/stapvirt.c-more-gcc-14-werror-calloc-transposed-args-compatibility.patch new file mode 100644 index 0000000..a2febb2 --- /dev/null +++ b/stapvirt.c-more-gcc-14-werror-calloc-transposed-args-compatibility.patch @@ -0,0 +1,40 @@ +From: Frank Ch. Eigler +Date: Thu Jan 18 16:37:39 2024 -0500 +Subject: stapvirt.c: More gcc-14 -Werror=calloc-transposed-args compatibility +Git-commit: 6c0b92b340db23ccc49e18007d4ecbdef3306bd6 +References: bsc#1221706 +Signed-off-by: Tony Jones + + stapvirt.c: More gcc-14 -Werror=calloc-transposed-args compatibility + +diff --git a/stapvirt.c b/stapvirt.c +index 0a10fa8fe..af02a4f76 100644 +--- a/stapvirt.c ++++ b/stapvirt.c +@@ -119,7 +119,7 @@ getActiveDomains(virConnectPtr conn, int **ids) + if (idsn <= 0) + return idsn; + +- *ids = (int*) calloc(sizeof(int), idsn); ++ *ids = (int*) calloc(idsn, sizeof(int)); + if (*ids == NULL) + return -1; + +@@ -145,7 +145,7 @@ getInactiveDomains(virConnectPtr conn, char ***names) + if (namesn <= 0) + return namesn; + +- *names = (char**) calloc(sizeof(char*), namesn); ++ *names = (char**) calloc(namesn, sizeof(char*)); + if (*names == NULL) + return -1; + +@@ -188,7 +188,7 @@ getAllDomains(virConnectPtr conn, virDomainPtr **domains) + goto cleanup_names; + + // Time to prepare virDomainPtr array +- *domains = (virDomainPtr*) calloc(sizeof(virDomainPtr), idsn+namesn); ++ *domains = (virDomainPtr*) calloc(idsn+namesn, sizeof(virDomainPtr)); + if (*domains == NULL) { + err("Can't allocate domains array\n"); + goto cleanup_names; diff --git a/systemtap.changes b/systemtap.changes index 15107e9..e4ff0d0 100644 --- a/systemtap.changes +++ b/systemtap.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Tue Apr 2 17:32:02 UTC 2024 - Tony Jones + +- Fix runtime issues with v6.8 kernel (bsc#1222249) + New patch: get-shm_flag-defines-from-the-appropriate-include-file-for-linux-6.8-kernel.patch + New patch: pr31373-deal-with-the-removal-of-strlcpy-from-linux-6.8.patch + +------------------------------------------------------------------- +Thu Mar 28 01:06:45 UTC 2024 - Tony Jones + +- Fix gcc14 build errors (bsc#1221706) + New patch: bpf-translate.cxx-fix-build-against-upcoming-gcc14.patch + New patch: pr31288-build-with-gcc14-cont.patch + New patch: pr31288-build-with-gcc14.patch + New patch: staprun-fix-build-against-upcoming-gcc14.patch + New patch: stapvirt.c-more-gcc-14-werror-calloc-transposed-args-compatibility.patch + ------------------------------------------------------------------- Fri Mar 8 15:56:21 UTC 2024 - pgajdos@suse.com diff --git a/systemtap.spec b/systemtap.spec index d7f5c24..5619a00 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -33,6 +33,13 @@ Source3: README-BEFORE-ADDING-PATCHES Source4: README-KEYRING Source5: stap-server.conf Patch1: systemtap-build-source-dir.patch +Patch2: staprun-fix-build-against-upcoming-gcc14.patch +Patch3: bpf-translate.cxx-fix-build-against-upcoming-gcc14.patch +Patch4: stapvirt.c-more-gcc-14-werror-calloc-transposed-args-compatibility.patch +Patch5: pr31288-build-with-gcc14.patch +Patch6: pr31288-build-with-gcc14-cont.patch +Patch7: get-shm_flag-defines-from-the-appropriate-include-file-for-linux-6.8-kernel.patch +Patch8: pr31373-deal-with-the-removal-of-strlcpy-from-linux-6.8.patch BuildRequires: autoconf >= 2.71 BuildRequires: automake