On Tue, Nov 27, 2012 at 4:07 PM, Petr Machata <[email protected]> wrote:
> Randy MacLeod <[email protected]> writes: > ... > > > I also built for mips-32 and found that it compiles but doesn't run. > See below. > > This result contradicts the README so if other people confirm that mips > is busted, > > then the README should be changed. > > Could you please try plain 0.7.0 as well? This should be about the > same, but chances are I broke something on master since 0.7.0. Sedat > Dilek and Edgar Iglesias both reported that 0.7.0 worked on 32-bit MIPS. > I think they meant 32-bit MIPS CPU, not even MIPS64 running in 32-bit > mode (n32 ABI). > I tried that. It didn't work either. > > HEAD = commit 4fb13f6aa2eb371a724e2e02e744cf993ddea8f2 > > > > mips64-wrs-linux-libtool: compile: mips64-wrswrap-linux-gnu-gcc -meb > -mabi=64 -mhard-float > --sysroot=/home/rmacleod/wrs/5.0/b/ltrace-mips64/bitbake_build/tmp/sysroots/ > > qemumips-64 -DHAVE_CONFIG_H -I. -I../../.. > > -I../../../sysdeps/linux-gnu/mips -I../../../sysdeps/linux-gnu > -I../../../sysdeps -I../../.. -Wall -Wsign-compare -Wfloat-equal > -Wformat-security -Werror -O2 -pipe -g > > -fno-omit-frame-pointer -fvisibility=default > > -c plt.c -fPIC -DPIC -o .libs/plt.o > > | plt.c: In function 'arch_elf_add_plt_entry': > > | plt.c:360:4: error: format '%llx' expects argument of type 'long long > unsigned int', but argument 5 has type 'GElf_Addr' [-Werror=format] > > | plt.c:369:3: error: format '%llx' expects argument of type 'long long > unsigned int', but argument 5 has type 'GElf_Addr' [-Werror=format] > > | cc1: all warnings being treated as errors > > | make[4]: *** [plt.lo] Error 1 > > > > I added a (long long unsigned int) for both cases as a quick fix to > > see what else was broken. > > I think this should be fixed like this (not tested though): > > diff --git a/sysdeps/linux-gnu/mipsel/plt.c > b/sysdeps/linux-gnu/mipsel/plt.c > index b277fbc..9dd003f 100644 > --- a/sysdeps/linux-gnu/mipsel/plt.c > +++ b/sysdeps/linux-gnu/mipsel/plt.c > @@ -26,6 +26,7 @@ > #include <errno.h> > #include <gelf.h> > #include <sys/ptrace.h> > +#include <inttypes.h> > > #include "common.h" > #include "debug.h" > @@ -356,8 +357,8 @@ arch_elf_add_plt_entry(struct Process *proc, struct > ltelf *lte, > > name = strdup(a_name); > if (name == NULL) { > - fprintf(stderr, "%s: failed %s(%#llx): %s\n", __func__, > - name, addr, strerror(errno)); > + fprintf(stderr, "%s: failed %s(%#"PRIx64"): %s\n", > + __func__, name, addr, strerror(errno)); > goto fail; > } > > @@ -366,7 +367,8 @@ arch_elf_add_plt_entry(struct Process *proc, struct > ltelf *lte, > if (library_symbol_init(libsym, > (arch_addr_t) (uintptr_t) addr, > name, 1, LS_TOPLT_EXEC) < 0) { > - fprintf(stderr, "%s: failed %s : %llx\n", __func__, name, > addr); > + fprintf(stderr, "%s: failed %s : %"PRIx64"\n", > + __func__, name, addr); > goto fail; > } > > > If you can verify that this fixes MIPS64 builds and doesn't break MIPS32 > builds, I'll put this in. I didn't get to this today. We'll see about tomorrow. > The rest is more difficult though. > Agreed. :) > ... > > root@qemu0:~# ltrace echo a > > --- SIGSEGV (Segmentation fault) --- > > +++ killed by SIGSEGV +++ > > Right, ltrace kills the process. This usually means a misplaced > breakpoint, a mangled instruction or some such. > > Unfortunately I can't even tell you how much work fixing MIPS64 would > be. I never played with MIPS, dunno what all is missing. Chances are > Edgar will have some insight here. -- ../Randy/..
_______________________________________________ Ltrace-devel mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/ltrace-devel
