Compiling libptrace

Trying to compile libptrace ( http://sourceforge.net/projects/libptrace/ ). The project did not advertise any preferred methods of requesting support (unfortunately, this project did not indicate the best way to get help). Anywho, the problem I am facing is as follows:

% ./build.sh
% ...[SUCCESS]
% ./configure
% ...[SUCCESS]
% make
Making all in src
make[2]: Entering directory `/home/xxx/build/libptrace-git.git/src'
make[2]: *** No rule to make target `../lib/libgnu.la', needed by `libptrace.la'.  Stop.
make[2]: Leaving directory `/home/xxx/build/libptrace-git.git/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/xxx/build/libptrace-git.git'
make: *** [all] Error 2
%

If you use google libptrace and libgnu.la, you get null images. The grapping for it in the source is taken from git, you get:

% grep -sre libgnu.la *
src/Makefile.in:libptrace_la_DEPENDENCIES = ../lib/libgnu.la
src/Makefile.in:libptrace_la_LIBADD = ../lib/libgnu.la
src/Makefile.am:libptrace_la_LIBADD = ../lib/libgnu.la
src/Makefile:libptrace_la_DEPENDENCIES = ../lib/libgnu.la
src/Makefile:libptrace_la_LIBADD = ../lib/libgnu.la

I do not know how to create the libtool archive file, and the source does not seem to have any goals or scripts for this.

Admin note: add the `libptrace 'tag to this question - obviously a very popular topic - I cannot do this because I do not agree with the point number 1.5K :(


Mel build.sh, , `make ':

gcc -DHAVE_CONFIG_H -I. -I../.. -I../../src    -g -O2 -Wall -MT test-linux-dlsym.o -MD -MP -MF                     .deps/test-linux-dlsym.Tpo -c -o test-linux-dlsym.o test-linux-dlsym.c
mv -f .deps/test-linux-dlsym.Tpo .deps/test-linux-dlsym.Po
/bin/sh ../../libtool --tag=CC   --mode=link gcc  -g -O2 -Wall   -o test-linux-dlsym test-linux-dlsym.o            ../../src/libptrace.la 
libtool: link: gcc -g -O2 -Wall -o .libs/test-linux-dlsym test-linux-dlsym.o  ../../src/.libs/libptrace.so         -Wl,-rpath -Wl,/usr/local/lib
test-linux-dlsym.o: In function `main':
/home/XXX/dev/insecurity/build/libptrace-git/tests/linux/test-linux-dlsym.c:24: undefined reference to             `ptrace_elf_get_link_map_head'
/home/XXX/dev/insecurity/build/libptrace-git/tests/linux/test-linux-dlsym.c:40: undefined reference to             `ptrace_elf_get_link_map_next'
/home/XXX/dev/insecurity/build/libptrace-git/tests/linux/test-linux-dlsym.c:31: undefined reference to             `ptrace_elf_get_symtab'
/home/XXX/dev/insecurity/build/libptrace-git/tests/linux/test-linux-dlsym.c:32: undefined reference to             `ptrace_elf_get_strtab'
/home/XXX/dev/insecurity/build/libptrace-git/tests/linux/test-linux-dlsym.c:33: undefined reference to             `ptrace_elf_get_hash'
/home/XXX/dev/insecurity/build/libptrace-git/tests/linux/test-linux-dlsym.c:34: undefined reference to             `ptrace_elf_get_hash_chains'
collect2: ld returned 1 exit status
make[2]: *** [test-linux-dlsym] Error 1
make[2]: Leaving directory `/home/XXX/dev/insecurity/build/libptrace-git.git/tests/linux'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/XXX/dev/insecurity/build/libptrace-git.git'
make: *** [all] Error 2
+3
3

gnulib: http://www.gnu.org/software/gnulib/

Debian apt-get install gnulib

0

Ubuntu 10.10, gnulib , , , , (autoconf, automake)

, git cc97c9e3d830bd1d567011ec099846343cef547a

diff - git a/src/Makefile.am b/src/Makefile.am index 6de8cf2..5f8d9bc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@-23,8 +23,8 @@endif   TARGET_LINUX  libptrace_la_SOURCES + = libptrace_linux.c libptrace_linux.h \                        libptrace_wrapper.c libptrace_wrapper.h \ - libptrace_linux_procfs.c libptrace_linux_procfs.h - # libptrace_elf.c libptrace_elf.h
+ libptrace_linux_procfs.c libptrace_linux_procfs.h \ + libptrace_elf.c libptrace_elf.h
 libptrace_la_HEADERS + = libptrace_linux.h libptrace_wrapper.h   TARGET_I386  libptrace_la_SOURCES + = libptrace_linux_x86.c libptrace_linux_x86.h @@-38,8 +38,8 @@endif

TARGET_FREEBSD  libptrace_la_SOURCES + = libptrace_freebsd.c libptrace_freebsd.h \ - libptrace_wrapper.c libptrace_wrapper.h
- # libptrace_elf.c libptrace_elf.h
+ libptrace_wrapper.c libptrace_wrapper.h \ + libptrace_elf.c libptrace_elf.h
 libptrace_la_HEADERS + = libptrace_freebsd.h libptrace_wrapper.h   TARGET_I386  libptrace_la_SOURCES + = libptrace_freebsd_x86.c libptrace_freebsd_x86.h

0

First of all, it only works on Linux. If you want this to work on other systems, you will need to write the src / libptrace_config.h header in the configure.ac file, as you can see on grep COMPILE_HDR configure.ac.

Secondly, the next patch is all I need to get the point at which the generated header is missing on my system. Of course, gnulib must be installed, and the gnulib tool must be in $ PATH.

diff --git a/build.sh b/build.sh
index 81caf8a..cc195c4 100755
--- a/build.sh
+++ b/build.sh
@@ -1,7 +1,7 @@
 #!/bin/sh

 # Import gnulib modules which we use
-gnulib-tool --import stdint
+gnulib-tool --libtool --import stdint

 # Update timestamp to make sure autoconf rebuilds everything.
 touch configure.ac
0
source

All Articles