[Ltrace-devel] mips/mips-64 status?

Randy MacLeod rwmacleod at gmail.com
Tue Nov 27 16:24:18 UTC 2012


I tried to compile ltrace.git/HEAD for mips-64. See compile errors below. I
guess this is the expected state.

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.

I have some but not loads of time to work on this. Let me know how I can
help.

// Randy

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.


Then:

| 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
| 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 trace.c  -fPIC -DPIC -o .libs/trace.o
| trace.c: In function 'arch_atomic_singlestep':
| trace.c:269:16: error: cast from pointer to integer of different size
[-Werror=pointer-to-int-cast]
| trace.c:276:23: error: cast to pointer from integer of different size
[-Werror=int-to-pointer-cast]
| cc1: all warnings being treated as errors
| make[4]: *** [trace.lo] Error 1


I looked at this briefly but it really seems like the mips support is only
for 32 bit targets.
I'm not in a position to add full mips-64 support so I'll likely just omit
it from the supported arches.


ltrace --help works of course but
ltrace echo a fails:
root at qemu0:~# ltrace echo a
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++


ltrace --debug 77 echo a
...
DEBUG: trace.c:164: continue_process: pid=347
DEBUG: events.c:144: next_event()
DEBUG: events.c:201: event from pid 347
DEBUG: events.c:262: event: SYSRET: pid=347, sysnum=91
DEBUG: handle_event.c:90: handle_event(pid=347, type=5)
DEBUG: handle_event.c:357: sysname(pid=347, sysnum=91)
DEBUG: handle_event.c:148: [347] event: sysret (SYS_munmap [91])
DEBUG: handle_event.c:536: handle_sysret(pid=347, sysnum=91)
DEBUG: handle_event.c:742: callstack_pop(pid=347)
DEBUG: trace.c:164: continue_process: pid=347
DEBUG: events.c:144: next_event()
DEBUG: events.c:201: event from pid 347
DEBUG: breakpoints.c:96: address2bpstruct(pid=347, addr=0x4000000)
DEBUG: dict.c:160: dict_find_entry()
DEBUG: events.c:327: event: SIGNAL: pid=347, signum=11
DEBUG: handle_event.c:90: handle_event(pid=347, type=1)
DEBUG: handle_event.c:332: shortsignal(pid=347, signum=11)
DEBUG: handle_event.c:121: [347] event: signal (SIGSEGV [11])
DEBUG: handle_event.c:393: handle_signal(pid=347, signum=11)
DEBUG: handle_event.c:332: shortsignal(pid=347, signum=11)
--- SIGSEGV (Segmentation fault) ---
DEBUG: trace.c:143: continue_after_signal: pid=347, signum=11
DEBUG: events.c:144: next_event()
DEBUG: events.c:201: event from pid 347
DEBUG: events.c:236: event: EXIT_SIGNAL: pid=347, signum=11
DEBUG: handle_event.c:90: handle_event(pid=347, type=3)
DEBUG: handle_event.c:332: shortsignal(pid=347, signum=11)
DEBUG: handle_event.c:134: [347] event: exit signal (SIGSEGV [11])
DEBUG: handle_event.c:414: handle_exit_signal(pid=347, signum=11)
DEBUG: handle_event.c:332: shortsignal(pid=347, signum=11)
+++ killed by SIGSEGV +++
DEBUG: proc.c:693: remove_proc(pid=347)
DEBUG: proc.c:685: detach_task 347 from leader 347
DEBUG: dict.c:182: dict_apply_to_all()
DEBUG: dict.c:80: dict_clear()
DEBUG: events.c:144: next_event()
DEBUG: events.c:153: event: No more traced programs: exiting


The interesting bits of the config are:

checking build system type... x86_64-pc-linux-gnu
checking host system type... mips-wrs-linux-gnu
checking for mips-wrs-linux-gcc... mips32-wrswrap-linux-gnu-gcc  -meb
-mabi=32   -mhard-float
--sysroot=/home/rmacleod/wrs/5.0/b/ltrace-mips/bitbake_build/tmp/sysroots/qemumips
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether mips32-wrswrap-linux-gnu-gcc  -meb -mabi=32   -mhard-float
--sysroot=/home/rmacleod/wrs/5.0/b/ltrace-mips/bitbake_build/tmp/sysroots/qemumips
accepts -g... yes
checking for mips32-wrswrap-linux-gnu-gcc  -meb -mabi=32   -mhard-float
--sysroot=/home/rmacleod/wrs/5.0/b/ltrace-mips/bitbake_build/tmp/sysroots/qemumips
option to accept ISO C89... none needed
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by mips32-wrswrap-linux-gnu-gcc  -meb -mabi=32
-mhard-float
--sysroot=/home/rmacleod/wrs/5.0/b/ltrace-mips/bitbake_build/tmp/sysroots/qemumips...
mips32-wrswrap-linux-gnu-ld
--sysroot=/home/rmacleod/wrs/5.0/b/ltrace-mips/bitbake_build/tmp/sysroots/qemumips
-m elf32btsmip
checking if the linker (mips32-wrswrap-linux-gnu-ld
--sysroot=/home/rmacleod/wrs/5.0/b/ltrace-mips/bitbake_build/tmp/sysroots/qemumips
-m elf32btsmip) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)...
mips32-wrswrap-linux-gnu-nm
checking the name lister (mips32-wrswrap-linux-gnu-nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 3458764513820540925
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-pc-linux-gnu file names to
mips-wrs-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain
format... func_convert_file_noop
checking for mips32-wrswrap-linux-gnu-ld
--sysroot=/home/rmacleod/wrs/5.0/b/ltrace-mips/bitbake_build/tmp/sysroots/qemumips
-m elf32btsmip option to reload object files... -r
checking for mips-wrs-linux-objdump... mips32-wrswrap-linux-gnu-objdump
checking how to recognize dependent libraries... pass_all
checking for mips-wrs-linux-dlltool... no
checking for dlltool... no

-- 
../Randy/..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/ltrace-devel/attachments/20121127/969948d5/attachment.html>


More information about the Ltrace-devel mailing list