Add ltrace (and libelf) utilities.

Marked as BROKEN for others to debug that if they need it.
This commit is contained in:
Yann E. MORIN" 2007-07-13 12:22:34 +00:00
parent c6025fb66a
commit e4a493abc9
6 changed files with 221 additions and 2 deletions

2
TODO
View File

@ -15,6 +15,6 @@ O: Finished
- Memcheck http://hald.dnsalias.net/projects/memcheck/
- MemCheck Deluxe http://prj.softpixel.com/mcd/
- Memwatch http://www.linkdata.se/sourcecode.html
+ ltrace ???
! ltrace ftp://ftp.debian.org/debian/pool/main/l/ltrace/
O strace http://sourceforge.net/projects/strace/
- Valgrind http://valgrind.org/

41
config/debug/ltrace.in Normal file
View File

@ -0,0 +1,41 @@
# ltrace
menuconfig LTRACE
bool
prompt "ltrace"
default n
depends on BROKEN
select LIBELF
help
ltrace is currently BROKEN! It depends on libelf, and I don't
know how to configure/compile that so that ltrace can successfully
use it. I you manage to build ltrace (and libelf!), please be so
kind as to tell me! Thank you!
if LTRACE
choice
bool
prompt "ltrace version"
config LTRACE_V_0_3_36
bool
prompt "0.3.36"
depends on OBSOLETE
config LTRACE_V_0_4
bool
prompt "0.4"
# CT_INSERT_VERSION_ABOVE
# Don't remove above line!
endchoice
config LTRACE_VERSION
string
default "0.3.36" if LTRACE_V_0_3_36
default "0.4" if LTRACE_V_0_4
# CT_INSERT_VERSION_STRING_ABOVE
# # Don't remove above line!
endif

84
config/tools/libelf.in Normal file
View File

@ -0,0 +1,84 @@
# libelf config file
menuconfig LIBELF
bool
prompt "libelf"
default n
depends on BROKEN
help
libelf lets you read, modify or create ELF files in an
architecture-independent way.
libelf is BROKEN! If you manage to make it actually _work_,
please be so kind as to tell me. (By working, I mean it is
useable at least by ltrace.) Thank you!
if LIBELF
choice
bool
prompt "libelf version"
config LIBELF_V_0_8_0
bool
prompt "0.8.0"
depends on OBSOLETE
config LIBELF_V_0_8_2
bool
prompt "0.8.2"
depends on OBSOLETE
config LIBELF_V_0_8_3
bool
prompt "0.8.3"
depends on OBSOLETE
config LIBELF_V_0_8_4
bool
prompt "0.8.4"
depends on OBSOLETE
config LIBELF_V_0_8_5
bool
prompt "0.8.5"
depends on OBSOLETE
config LIBELF_V_0_8_6
bool
prompt "0.8.6"
depends on OBSOLETE
config LIBELF_V_0_8_7
bool
prompt "0.8.7"
depends on OBSOLETE
config LIBELF_V_0_8_8
bool
prompt "0.8.8"
depends on OBSOLETE
config LIBELF_V_0_8_9
bool
prompt "0.8.9"
# CT_INSERT_VERSION_ABOVE
# Don't remove above line!
endchoice
config LIBELF_VERSION
string
default "0.8.0" if LIBELF_V_0_8_0
default "0.8.2" if LIBELF_V_0_8_2
default "0.8.3" if LIBELF_V_0_8_3
default "0.8.4" if LIBELF_V_0_8_4
default "0.8.5" if LIBELF_V_0_8_5
default "0.8.6" if LIBELF_V_0_8_6
default "0.8.7" if LIBELF_V_0_8_7
default "0.8.8" if LIBELF_V_0_8_8
default "0.8.9" if LIBELF_V_0_8_9
# CT_INSERT_VERSION_STRING_ABOVE
# Don't remove above line!
endif

View File

@ -0,0 +1,44 @@
# Build script for ltrace
is_enabled="${CT_LTRACE}"
do_print_filename() {
[ "${CT_LTRACE}" = "y" ] || return 0
echo "ltrace-${CT_LTRACE_VERSION}.orig"
}
do_debug_ltrace_get() {
CT_GetFile "ltrace_${CT_LTRACE_VERSION}.orig" ftp://ftp.de.debian.org/debian/pool/main/l/ltrace/
# Create a link so that the following steps are easier to do:
cd "${CT_TARBALLS_DIR}"
ltrace_ext=`CT_GetFileExtension "ltrace_${CT_LTRACE_VERSION}.orig"`
ln -sf "ltrace_${CT_LTRACE_VERSION}.orig${ltrace_ext}" "ltrace-${CT_LTRACE_VERSION}${ltrace_ext}"
}
do_debug_ltrace_extract() {
CT_ExtractAndPatch "ltrace-${CT_LTRACE_VERSION}"
}
do_debug_ltrace_build() {
CT_DoStep INFO "Installing ltrace"
mkdir -p "${CT_BUILD_DIR}/build-ltrace"
CT_Pushd "${CT_BUILD_DIR}/build-ltrace"
CT_DoLog EXTRA "Configuring ltrace"
# CFLAGS="-I${CT_SYSROOT_DIR}/usr/include" \
# LDFLAGS="-L${CT_SYSROOT_DIR}/usr/include" \
"${CT_SRC_DIR}/ltrace-${CT_LTRACE_VERSION}/configure" \
--build=${CT_BUILD} \
--host=${CT_TARGET} \
--prefix=/usr
CT_DoLog EXTRA "Building ltrace"
make
CT_DoLog EXTRA "Installing ltrace"
make DESTDIR="${CT_DEBUG_INSTALL_DIR}" install
CT_Popd
CT_EndStep
}

View File

@ -0,0 +1,48 @@
# Build script for libelf
is_enabled="${CT_LIBELF}"
do_print_filename() {
[ "{CT_LIBELF}" = "y" ] || return 0
echo "libelf-${CT_LIBELF_VERSION}"
}
do_tools_libelf_get() {
# The server hosting libelf will return an "HTTP 300 : Multiple Choices"
# error code if we try to download a file that does not exists there.
# So we have to request the file with an explicit extension.
CT_GetFile "libelf-${CT_LIBELF_VERSION}" .tar.gz http://www.mr511.de/software/
}
do_tools_libelf_extract() {
CT_ExtractAndPatch "libelf-${CT_LIBELF_VERSION}"
}
do_tools_libelf_build() {
CT_DoStep INFO "Installing libelf"
mkdir -p "${CT_BUILD_DIR}/build-libelf"
CT_Pushd "${CT_BUILD_DIR}/build-libelf"
CT_DoLog EXTRA "Configuring libelf"
CC="${CT_TARGET}-gcc" \
"${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure" \
--build=${CT_BUILD} \
--host=${CT_TARGET} \
--target=${CT_TARGET} \
--prefix=/usr \
--enable-compat \
--enable-elf64 \
--enable-shared \
--enable-extended-format \
--enable-static 2>&1 |CT_DoLog ALL
CT_DoLog EXTRA "Building libelf"
make 2>&1 |CT_DoLog ALL
CT_DoLog EXTRA "Installing libelf"
make instroot="${CT_SYSROOT_DIR}" install 2>&1 |CT_DoLog ALL
CT_Popd
CT_EndStep
}

View File

@ -8,7 +8,7 @@ doHelp() {
Usage: ${myname} <tool> [option] <version>
'tool' in one of:
--gcc, --binutils, --glibc, --uClibc, --linux,
--gdb, --dmalloc, --duma, --strace
--gdb, --dmalloc, --duma, --strace, --ltrace, --libelf
Valid options for all tools:
--experimental, -x
@ -57,6 +57,8 @@ while [ $i -le $# ]; do
--dmalloc) cat=DMALLOC; tool=dmalloc; tool_prefix=debug/ tool_suffix=;;
--duma) cat=DUMA; tool=duma; tool_prefix=debug/ tool_suffix=;;
--strace) cat=STRACE; tool=strace; tool_prefix=debug/ tool_suffix=;;
--ltrace) cat=LTRACE; tool=ltrace; tool_prefix=debug/ tool_suffix=;;
--libelf) cat=LIBELF; tool=libelf; tool_prefix=tools/ tool_suffix=;;
# Tools options:
-x|--experimental) EXP=1; OBS=;;
-o|--obsolete) OBS=1; EXP=;;