diff options
Diffstat (limited to 'meta-oe/recipes-devtools/ltrace/ltrace')
11 files changed, 255 insertions, 30 deletions
diff --git a/meta-oe/recipes-devtools/ltrace/ltrace/0001-ARM-code-has-unreachable-code-after-switch-statement.patch b/meta-oe/recipes-devtools/ltrace/ltrace/0001-ARM-code-has-unreachable-code-after-switch-statement.patch index 4d0e0392f7..c896e3ebb0 100644 --- a/meta-oe/recipes-devtools/ltrace/ltrace/0001-ARM-code-has-unreachable-code-after-switch-statement.patch +++ b/meta-oe/recipes-devtools/ltrace/ltrace/0001-ARM-code-has-unreachable-code-after-switch-statement.patch @@ -11,6 +11,8 @@ sysdeps/linux-gnu/arm/trace.c:173:33: error: statement will never be executed [- Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + sysdeps/linux-gnu/arm/trace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta-oe/recipes-devtools/ltrace/ltrace/0001-Fix-type-of-single-bit-bitfields.patch b/meta-oe/recipes-devtools/ltrace/ltrace/0001-Fix-type-of-single-bit-bitfields.patch new file mode 100644 index 0000000000..61932269bd --- /dev/null +++ b/meta-oe/recipes-devtools/ltrace/ltrace/0001-Fix-type-of-single-bit-bitfields.patch @@ -0,0 +1,86 @@ +From 491b3b153f6b5cbf2d23a9778e5676eb29a6705f Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 6 Feb 2023 16:37:19 -0800 +Subject: [PATCH] Fix type of single bit bitfields + +clang16 warns +trace.c:311:22: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] + +quash the warning by using an unsigned type to allow +an assignment of 0 or 1 without implicit conversion. + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + library.h | 6 +++--- + prototype.h | 2 +- + sysdeps/linux-gnu/trace.h | 10 +++++----- + 3 files changed, 9 insertions(+), 9 deletions(-) + +--- a/library.h ++++ b/library.h +@@ -71,20 +71,20 @@ struct library_symbol { + * looking up one in LIB->protolib. */ + struct prototype *proto; + +- int own_name : 1; ++ unsigned int own_name : 1; + + /* This is relevant for PLT symbols. Latent PLT symbols are + * those that don't match any of the -e rules, but that might + * potentially become active if a library implementing them + * appears that matches a -l rule. Ltrace core is responsible + * for clearing latent flag. */ +- int latent : 1; ++ unsigned latent : 1; + + /* Delayed symbols are those for which a breakpoint shouldn't + * be enabled yet. They are similar to latent symbols, but + * backend is responsible for clearing the delayed flag. See + * proc_activate_delayed_symbol. */ +- int delayed : 1; ++ unsigned int delayed : 1; + + struct arch_library_symbol_data arch; + struct os_library_symbol_data os; +--- a/prototype.h ++++ b/prototype.h +@@ -162,7 +162,7 @@ struct protolib_cache { + + /* For tracking uses of cache during cache's own + * initialization. */ +- int bootstrap : 1; ++ unsigned int bootstrap : 1; + }; + + /* Initialize CACHE. Returns 0 on success or a negative value on +--- a/sysdeps/linux-gnu/trace.h ++++ b/sysdeps/linux-gnu/trace.h +@@ -33,11 +33,11 @@ + struct pid_task { + pid_t pid; /* This may be 0 for tasks that exited + * mid-handling. */ +- int sigstopped : 1; +- int got_event : 1; +- int delivered : 1; +- int vforked : 1; +- int sysret : 1; ++ unsigned int sigstopped : 1; ++ unsigned int got_event : 1; ++ unsigned int delivered : 1; ++ unsigned int vforked : 1; ++ unsigned int sysret : 1; + }; + + struct pid_set { +--- a/sysdeps/linux-gnu/trace.c ++++ b/sysdeps/linux-gnu/trace.c +@@ -1043,7 +1043,7 @@ ltrace_exiting_install_handler(struct pr + struct process_vfork_handler + { + struct event_handler super; +- int vfork_bp_refd:1; ++ unsigned int vfork_bp_refd:1; + }; + + static Event * diff --git a/meta-oe/recipes-devtools/ltrace/ltrace/0001-Use-correct-enum-type.patch b/meta-oe/recipes-devtools/ltrace/ltrace/0001-Use-correct-enum-type.patch index 01a35842c8..38a7d055dc 100644 --- a/meta-oe/recipes-devtools/ltrace/ltrace/0001-Use-correct-enum-type.patch +++ b/meta-oe/recipes-devtools/ltrace/ltrace/0001-Use-correct-enum-type.patch @@ -7,6 +7,8 @@ Clang warns about wrong enum initializtion Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + sysdeps/linux-gnu/aarch64/fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-oe/recipes-devtools/ltrace/ltrace/0001-configure-Recognise-linux-musl-as-a-host-OS.patch b/meta-oe/recipes-devtools/ltrace/ltrace/0001-configure-Recognise-linux-musl-as-a-host-OS.patch index 52264a17e6..f3a6d9e599 100644 --- a/meta-oe/recipes-devtools/ltrace/ltrace/0001-configure-Recognise-linux-musl-as-a-host-OS.patch +++ b/meta-oe/recipes-devtools/ltrace/ltrace/0001-configure-Recognise-linux-musl-as-a-host-OS.patch @@ -5,6 +5,8 @@ Subject: [PATCH] configure: Recognise linux-musl as a host OS Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-oe/recipes-devtools/ltrace/ltrace/0001-mips-Use-hardcodes-values-for-ABI-syscall-bases.patch b/meta-oe/recipes-devtools/ltrace/ltrace/0001-mips-Use-hardcodes-values-for-ABI-syscall-bases.patch new file mode 100644 index 0000000000..f83e0a2738 --- /dev/null +++ b/meta-oe/recipes-devtools/ltrace/ltrace/0001-mips-Use-hardcodes-values-for-ABI-syscall-bases.patch @@ -0,0 +1,50 @@ +From ed8dbe1c793f2f770fef61adc4390277f903cceb Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 9 Jul 2021 01:32:42 -0700 +Subject: [PATCH] mips: Use hardcodes values for ABI syscall bases + +mips kernels 5.13+ have stopped exposing the UAPIs which provided these +defines, the values are more or less static so just use the hardcoded +values for now. Use __NR_syscalls to get number of syscalls supported +and include asm-generic/unistd.h to get this definition + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + sysdeps/linux-gnu/mips/trace.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/sysdeps/linux-gnu/mips/trace.c b/sysdeps/linux-gnu/mips/trace.c +index d54818e..e72184d 100644 +--- a/sysdeps/linux-gnu/mips/trace.c ++++ b/sysdeps/linux-gnu/mips/trace.c +@@ -33,6 +33,7 @@ + #include <asm/unistd.h> + #include <assert.h> + #include <asm/unistd.h> ++#include <asm-generic/unistd.h> + + #include "backend.h" + #include "common.h" +@@ -135,12 +136,12 @@ syscall_p(struct process *proc, int status, int *sysnum) + int min_syscall, max_syscall, sigreturn, rt_sigreturn; + struct callstack_element *top = NULL; + int depth = proc->callstack_depth; +- const int syscallbase[] = {__NR_O32_Linux, __NR_N32_Linux, +- __NR_64_Linux, __NR_O32_Linux}; +- const int syscallnum[] = {__NR_O32_Linux_syscalls, +- __NR_N32_Linux_syscalls, +- __NR_64_Linux_syscalls, +- __NR_O32_Linux_syscalls}; ++ const int syscallbase[] = {4000, 6000, ++ 5000, 4000}; ++ const int syscallnum[] = {__NR_syscalls, ++ __NR_syscalls, ++ __NR_syscalls, ++ __NR_syscalls}; + const int rt_sigreturn_list[] = {193, 211, 211, 193}; + const int sigreturn_list[] = {119, -1, -1, 119}; + +-- +2.32.0 + diff --git a/meta-oe/recipes-devtools/ltrace/ltrace/0001-mips-plt.c-Delete-include-error.h.patch b/meta-oe/recipes-devtools/ltrace/ltrace/0001-mips-plt.c-Delete-include-error.h.patch index 76ba7de785..ce4dcf8a98 100644 --- a/meta-oe/recipes-devtools/ltrace/ltrace/0001-mips-plt.c-Delete-include-error.h.patch +++ b/meta-oe/recipes-devtools/ltrace/ltrace/0001-mips-plt.c-Delete-include-error.h.patch @@ -7,6 +7,8 @@ Its not needed Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + sysdeps/linux-gnu/mips/plt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/meta-oe/recipes-devtools/ltrace/ltrace/0001-ppc-Remove-unused-host_powerpc64-function.patch b/meta-oe/recipes-devtools/ltrace/ltrace/0001-ppc-Remove-unused-host_powerpc64-function.patch new file mode 100644 index 0000000000..35062debf2 --- /dev/null +++ b/meta-oe/recipes-devtools/ltrace/ltrace/0001-ppc-Remove-unused-host_powerpc64-function.patch @@ -0,0 +1,39 @@ +From 4517bf59838f40eb6e3f46e39adb5e5090c59df8 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 15 Jun 2021 18:14:36 -0700 +Subject: [PATCH] ppc: Remove unused host_powerpc64 function + +This function is dead code, remove it which avoids compiler warnings +with clang + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + sysdeps/linux-gnu/ppc/plt.c | 10 ---------- + 1 file changed, 10 deletions(-) + +diff --git a/sysdeps/linux-gnu/ppc/plt.c b/sysdeps/linux-gnu/ppc/plt.c +index 5f81889..9d1838b 100644 +--- a/sysdeps/linux-gnu/ppc/plt.c ++++ b/sysdeps/linux-gnu/ppc/plt.c +@@ -142,16 +142,6 @@ + #define PPC64_PLT_STUB_SIZE 4 + #endif + +-static inline int +-host_powerpc64() +-{ +-#ifdef __powerpc64__ +- return 1; +-#else +- return 0; +-#endif +-} +- + static void + mark_as_resolved(struct library_symbol *libsym, GElf_Addr value) + { +-- +2.32.0 + diff --git a/meta-oe/recipes-devtools/ltrace/ltrace/0001-ppc-plt-do-not-free-symbol-libsym.patch b/meta-oe/recipes-devtools/ltrace/ltrace/0001-ppc-plt-do-not-free-symbol-libsym.patch new file mode 100644 index 0000000000..4793e561c0 --- /dev/null +++ b/meta-oe/recipes-devtools/ltrace/ltrace/0001-ppc-plt-do-not-free-symbol-libsym.patch @@ -0,0 +1,29 @@ +From f47672bed5905ae382e80b09dafca9a8da45aa67 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 19 Apr 2022 18:44:36 -0700 +Subject: [PATCH] ppc/plt: do not free symbol libsym + +delete_symbol_chain() will call free as well if sybol is non-null +it also fixes use-after-free warnings that compiler emits + +Upstream-Status: Submitted [https://gitlab.com/cespedes/ltrace/-/merge_requests/2] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + sysdeps/linux-gnu/ppc/plt.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/sysdeps/linux-gnu/ppc/plt.c b/sysdeps/linux-gnu/ppc/plt.c +index 5f81889..7c1c025 100644 +--- a/sysdeps/linux-gnu/ppc/plt.c ++++ b/sysdeps/linux-gnu/ppc/plt.c +@@ -687,7 +687,6 @@ arch_elf_add_func_entry(struct process *proc, struct ltelf *lte, + if (libsym == NULL + || library_symbol_init(libsym, addr, full_name, 1, + LS_TOPLT_NONE) < 0) { +- free(libsym); + delete_symbol_chain(libsym); + libsym = NULL; + fprintf(stderr, "Couldn't add symbol %s" +-- +2.36.0 + diff --git a/meta-oe/recipes-devtools/ltrace/ltrace/0002-Fix-const-qualifier-error.patch b/meta-oe/recipes-devtools/ltrace/ltrace/0002-Fix-const-qualifier-error.patch index c152771923..f78db5b0db 100644 --- a/meta-oe/recipes-devtools/ltrace/ltrace/0002-Fix-const-qualifier-error.patch +++ b/meta-oe/recipes-devtools/ltrace/ltrace/0002-Fix-const-qualifier-error.patch @@ -8,6 +8,8 @@ error: duplicate 'const' declaration specifier [-Werror,-Wduplicate-decl-specifi Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + dict.h | 2 +- library.c | 2 +- vect.h | 2 +- diff --git a/meta-oe/recipes-devtools/ltrace/ltrace/add_ppc64le.patch b/meta-oe/recipes-devtools/ltrace/ltrace/add_ppc64le.patch new file mode 100644 index 0000000000..dcd0285db6 --- /dev/null +++ b/meta-oe/recipes-devtools/ltrace/ltrace/add_ppc64le.patch @@ -0,0 +1,41 @@ +Upstream-Status: Pending + +--- a/sysdeps/linux-gnu/ppc/ptrace.h ++++ b/sysdeps/linux-gnu/ppc/ptrace.h +@@ -18,4 +18,5 @@ + * 02110-1301 USA + */ + ++#include <asm/ptrace.h> + #include <sys/ptrace.h> +--- a/sysdeps/linux-gnu/ppc/regs.c ++++ b/sysdeps/linux-gnu/ppc/regs.c +@@ -23,11 +23,14 @@ + + #include "config.h" + ++#include <string.h> + #include <sys/types.h> + #include <sys/ptrace.h> + #include <asm/ptrace.h> + #include <errno.h> ++#ifdef HAVE_ERROR_H + #include <error.h> ++#endif + + #include "proc.h" + #include "common.h" +@@ -49,8 +52,11 @@ get_instruction_pointer(struct process * + void + set_instruction_pointer(struct process *proc, void *addr) + { +- if (ptrace(PTRACE_POKEUSER, proc->pid, sizeof(long)*PT_NIP, addr) != 0) +- error(0, errno, "set_instruction_pointer"); ++ if (ptrace(PTRACE_POKEUSER, proc->pid, sizeof(long)*PT_NIP, addr) != 0){ ++ report_global_error("%s: set_instruction_pointer", ++ strerror(errno)); ++ exit(1); ++ } + } + + void * diff --git a/meta-oe/recipes-devtools/ltrace/ltrace/include_unistd_nr.patch b/meta-oe/recipes-devtools/ltrace/ltrace/include_unistd_nr.patch deleted file mode 100644 index e4490bbb9e..0000000000 --- a/meta-oe/recipes-devtools/ltrace/ltrace/include_unistd_nr.patch +++ /dev/null @@ -1,30 +0,0 @@ -kernel headers have restructured mips syscall generation in kernel -in recent versions, however, ltrace still has logic to define the -syscall numbers based on old logic, this patch includes the legacy -UAPI headers to get these defines - -Fixes errors e.g. -../../../../git/sysdeps/linux-gnu/mips/trace.c:138:29: error: '__NR_O32_Linux' undeclared (first use in this function) - const int syscallbase[] = {__NR_O32_Linux, __NR_N32_Linux, - -Upstream-Status: Pending -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- a/sysdeps/linux-gnu/mips/trace.c -+++ b/sysdeps/linux-gnu/mips/trace.c -@@ -34,6 +34,16 @@ - #include <assert.h> - #include <asm/unistd.h> - -+#ifndef __NR_O32_Linux -+#include <asm/unistd_nr_o32.h> -+#endif -+#ifndef __NR_N32_Linux -+#include <asm/unistd_nr_n64.h> -+#endif -+#ifndef __NR_N64_Linux -+#include <asm/unistd_nr_n32.h> -+#endif -+ - #include "backend.h" - #include "common.h" - #include "debug.h" |