u-boot-fw-utils_2019.07.bb:do_compile) failed with exit code '1' - RAUC(Yocto) - embedded-linux

I am integrating the software update mechanism RAUC in my yocto project for my device. I followed these instructions in README file and I read the rauc documentation. Unfortunately I couldn't make it work and I got this error: u-boot-fw-utils_2019.07.bb:do_compile) failed with exit code '1'
The log.do_compile file content is :
DEBUG: Executing shell function do_compile
NOTE: make -j 16 CROSS_COMPILE=arm-poky-linux-gnueabi- CC=arm-poky-linux-gnueabi-gcc -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/bsp/build/tmp/work/amr1-poky-linux-gnueabi/u-boot-fw-utils/1_2019.07-r0/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/bsp/build/tmp/work/amr1-poky-linux-gnueabi/u-boot-fw-utils/1_2019.07-r0=/usr/src/debug/u-boot-fw-utils/1_2019.07-r0 -fdebug-prefix-map=/bsp/build/tmp/work/amr1-poky-linux-gnueabi/u-boot-fw-utils/1_2019.07-r0=/usr/src/debug/u-boot-fw-utils/1_2019.07-r0 -fdebug-prefix-map=/bsp/build/tmp/work/amr1-poky-linux-gnueabi/u-boot-fw-utils/1_2019.07-r0/recipe-sysroot= -fdebug-prefix-map=/bsp/build/tmp/work/amr1-poky-linux-gnueabi/u-boot-fw-utils/1_2019.07-r0/recipe-sysroot-native= -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now HOSTCC=gcc -isystem/bsp/build/tmp/work/amr1-poky-linux-gnueabi/u-boot-fw-utils/1_2019.07-r0/recipe-sysroot-native/usr/include -O2 -pipe -L/bsp/build/tmp/work/amr1-poky-linux-gnueabi/u-boot-fw-utils/1_2019.07-r0/recipe-sysroot-native/usr/lib -L/bsp/build/tmp/work/amr1-poky-linux-gnueabi/u-boot-fw-utils/1_2019.07-r0/recipe-sysroot-native/lib -Wl,--enable-new-dtags -Wl,-rpath-link,/bsp/build/tmp/work/amr1-poky-linux-gnueabi/u-boot-fw-utils/1_2019.07-r0/recipe-sysroot-native/usr/lib -Wl,-rpath-link,/bsp/build/tmp/work/amr1-poky-linux-gnueabi/u-boot-fw-utils/1_2019.07-r0/recipe-sysroot-native/lib -Wl,-rpath,/bsp/build/tmp/work/amr1-poky-linux-gnueabi/u-boot-fw-utils/1_2019.07-r0/recipe-sysroot-native/usr/lib -Wl,-rpath,/bsp/build/tmp/work/amr1-poky-linux-gnueabi/u-boot-fw-utils/1_2019.07-r0/recipe-sysroot-native/lib -Wl,-O1 -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=/bsp/build/tmp/sysroots-uninative/x86_64-linux/lib/ld-linux-x86-64.so.2 V=1 tx6q-1036_mfg_config tx6q-1036_config
set -e; \
for i in tx6q-1036_mfg_config tx6q-1036_config; do \
make -f ./Makefile $i; \
done
make -f ./scripts/Makefile.build obj=scripts/basic
rm -f .tmp_quiet_recordmcount
make -f ./scripts/Makefile.build obj=scripts/kconfig tx6q-1036_mfg_config
scripts/kconfig/conf --defconfig=arch/../configs/tx6q-1036_mfg_defconfig Kconfig
***
*** Can't find default configuration "arch/../configs/tx6q-1036_mfg_defconfig"!
***
scripts/kconfig/Makefile:128: recipe for target 'tx6q-1036_mfg_defconfig' failed
make[2]: *** [tx6q-1036_mfg_defconfig] Error 1
Makefile:516: recipe for target 'tx6q-1036_mfg_config' failed
make[1]: *** [tx6q-1036_mfg_config] Error 2
Makefile:498: recipe for target '__build_one_by_one' failed
make: *** [__build_one_by_one] Error 2
ERROR: oe_runmake failed
WARNING: exit code 1 from a shell command.
ERROR: Execution of '/bsp/build/tmp/work/amr1-poky-linux-gnueabi/u-boot-fw-utils/1_2019.07-r0/temp/run.do_compile.25964' failed with exit code 1:
set -e; \
for i in tx6q-1036_mfg_config tx6q-1036_config; do \
make -f ./Makefile $i; \
done
make -f ./scripts/Makefile.build obj=scripts/basic
rm -f .tmp_quiet_recordmcount
make -f ./scripts/Makefile.build obj=scripts/kconfig tx6q-1036_mfg_config
scripts/kconfig/conf --defconfig=arch/../configs/tx6q-1036_mfg_defconfig Kconfig
***
*** Can't find default configuration "arch/../configs/tx6q-1036_mfg_defconfig"!
***
scripts/kconfig/Makefile:128: recipe for target 'tx6q-1036_mfg_defconfig' failed
make[2]: *** [tx6q-1036_mfg_defconfig] Error 1
Makefile:516: recipe for target 'tx6q-1036_mfg_config' failed
make[1]: *** [tx6q-1036_mfg_config] Error 2
Makefile:498: recipe for target '__build_one_by_one' failed
make: *** [__build_one_by_one] Error 2
WARNING: exit code 1 from a shell command.
Anybody could help in this.

Are you aware of the meta-rauc-community project? In order to make Rauc work with your board in yocto, you either need to add the necessary meta-rauc-community layer or extend support to the board. There are some bbappends that u-boot uses in order to permit the use of Rauc.
To address your specific issue though, it appears as if the defconfig u-boot requires is missing. This error doesn't seem to be related to rauc as far as I can tell. Are you sure you're setting the correct UBOOT_MACHINE in your machine config file?

I fixed that, the problem was with u-boot-fw-utils in the karo-bsp zeus release, I upgraded to the Hardknott release and u-boot-fw-utils compiles fine.

Related

cross-compile iperf from x86_64 for ARM64 target

I want to cross compile iperf-2.0.5 from my x86_64 ubuntu linux machine for a ARM64 target. Therefore I installed the cross compiler:
sudo apt install gcc make gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu g++-aarch64-linux-gnu
then I tried to configure:
./configure --build=aarch64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --enable-static --disable-shared
which gives me this warning: configure: WARNING: unrecognized options: --enable-static, --disable-shared
apart from this warning i'm not getting any errors but I'm not sure how to verify that the build and host parameters are selected correctly.
When I run make I get the following error.
make all-recursive
make[1]: Entering directory '/home/recherma/Documents/iperf-2.0.5'
Making all in compat
make[2]: Entering directory '/home/recherma/Documents/iperf-2.0.5/compat'
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT delay.o -MD -MP -MF ".deps/delay.Tpo" -c -o delay.o delay.cpp; \
then mv -f ".deps/delay.Tpo" ".deps/delay.Po"; else rm -f ".deps/delay.Tpo"; exit 1; fi
In file included from /usr/include/c++/9/stdlib.h:36,
from ../include/headers.h:78,
from ../include/Timestamp.hpp:63,
from delay.cpp:53:
/usr/include/c++/9/cstdlib:151:11: error: ‘::malloc’ has not been declared
151 | using ::malloc;
| ^~~~~~
In file included from ../include/headers.h:78,
from ../include/Timestamp.hpp:63,
from delay.cpp:53:
/usr/include/c++/9/stdlib.h:65:12: error: ‘std::malloc’ has not been declared
65 | using std::malloc;
| ^~~~~~
In file included from /usr/include/c++/9/cmath:42,
from /usr/include/c++/9/math.h:36,
from ../include/headers.h:85,
from ../include/Timestamp.hpp:63,
from delay.cpp:53:
/usr/include/c++/9/bits/cpp_type_traits.h:214:12: error: redefinition of ‘struct std::__is_integer<int>’
214 | struct __is_integer<int>
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/cpp_type_traits.h:138:12: note: previous definition of ‘struct std::__is_integer<int>’
138 | struct __is_integer<bool>
| ^~~~~~~~~~~~~~~~~~
make[2]: *** [Makefile:273: delay.o] Error 1
make[2]: Leaving directory '/home/recherma/Documents/iperf-2.0.5/compat'
make[1]: *** [Makefile:252: all-recursive] Error 1
make[1]: Leaving directory '/home/recherma/Documents/iperf-2.0.5'
make: *** [Makefile:190: all] Error 2
So I guess the configuration failed. Does anyone know now to configure it correctly?
EDIT:
I think --host should be changed to aarch64-unknown-linux-gnu. But this changes nothing and I get the exact same errors.
Try removing DAST_CHECK_BOOL from configure.ac and try reconfigure again.
If that didn't help, after configure, comment #define bool int in config.h and try rebuild.

riscv-gcc Fails to build [GCC_NO_EXECUTABLES]

I want to use riscv-gcc to implement an Ibex (RISCV core) example on an Arty-A7 but I haven't been able to build it properly.
It's been failing after the 'make' phase. It seems to have something to do with zlib however I'm not so sure since this is the first time I'm building anything from source. I got the source from https://github.com/riscv/riscv-gcc
I've configure it executed make as
../riscv-gcc/configure --enable-multilib
make
it then exits with the following error
checking whether the gcc -m32 linker (ld -m elf_x86_64 -m elf_i386) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
make[2]: *** [configure-stage1-zlib] Error 1
make[2]: Leaving directory `/home/alfred/Desktop/Work/riscv_gcc_install'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/alfred/Desktop/Work/riscv_gcc_install'
make: *** [all] Error 2
I've also tried running make (same configuration) with
make all-gcc
but it produces this error instead
checking if gcc -m32 supports -fno-rtti -fno-exceptions... no
checking for gcc -m32 option to produce PIC... -fPIC -DPIC
checking if gcc -m32 PIC flag -fPIC -DPIC works... yes
checking if gcc -m32 static flag -static works... no
checking if gcc -m32 supports -c -o file.o... yes
checking if gcc -m32 supports -c -o file.o... (cached) yes
checking whether the gcc -m32 linker (ld -m elf_x86_64 -m elf_i386) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
make: *** [configure-zlib] Error 1
I'm not sure what to do so far besides check prerequisite libraries as suggested by https://gcc.gnu.org/install/prerequisites.html . Can Anyone help me out?
[UPDATE 27/11/19]
I tried to install the complete riscv-gnu-toolchain from < https://github.com/riscv/riscv-gnu-toolchain> to avoid missing dependencies however I still had an error. I did run the suggested apt-get command to install the prerequisites.
I ran the configuration suggested to target riscv32 and proceeded with make as follows
./configure --prefix=/opt/riscv --with-arch=rv32gc --with-abi=ilp32d
make linux
I then got this error
make[3]: Entering directory `/home/alfred/Desktop/Work/riscv-gnu-toolchain/build-binutils-linux/binutils'
/bin/bash /home/alfred/Desktop/Work/riscv-gnu-toolchain/riscv-binutils/binutils/../ylwrap /home/alfred/Desktop/Work/riscv-gnu-toolchain/riscv-binutils/binutils/arparse.y y.tab.c arparse.c y.tab.h `echo arparse.c | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/` y.output arparse.output -- bison -y -d
m4: unrecognized option '--gnu'
Try `m4 --help' for more information.
make[4]: Entering directory `/home/alfred/Desktop/Work/riscv-gnu-toolchain/build-binutils-linux/binutils'
/bin/bash /home/alfred/Desktop/Work/riscv-gnu-toolchain/riscv-binutils/binutils/../ylwrap /home/alfred/Desktop/Work/riscv-gnu-toolchain/riscv-binutils/binutils/arparse.y y.tab.c arparse.c y.tab.h `echo arparse.c | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/` y.output arparse.output -- bison -y -d
m4: unrecognized option '--gnu'
Try `m4 --help' for more information.
make[4]: Leaving directory `/home/alfred/Desktop/Work/riscv-gnu-toolchain/build-binutils-linux/binutils'
/bin/bash /home/alfred/Desktop/Work/riscv-gnu-toolchain/riscv-binutils/binutils/../ylwrap /home/alfred/Desktop/Work/riscv-gnu-toolchain/riscv-binutils/binutils/sysinfo.y y.tab.c sysinfo.c y.tab.h `echo sysinfo.c | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/` y.output sysinfo.output -- bison -y -d
/home/alfred/Desktop/Work/riscv-gnu-toolchain/riscv-binutils/binutils/sysinfo.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
m4: unrecognized option '--gnu'
Try `m4 --help' for more information.
if [ -r sysinfo.c ]; then \
gcc -c -I. -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -I/home/alfred/Desktop/Work/riscv-gnu-toolchain/riscv-binutils/binutils/../zlib -g -O2 sysinfo.c ; \
else \
gcc -c -I. -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -I/home/alfred/Desktop/Work/riscv-gnu-toolchain/riscv-binutils/binutils/../zlib -g -O2 /home/alfred/Desktop/Work/riscv-gnu-toolchain/riscv-binutils/binutils/sysinfo.c ; \
fi
gcc: error: /home/alfred/Desktop/Work/riscv-gnu-toolchain/riscv-binutils/binutils/sysinfo.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
make[3]: *** [sysinfo.o] Error 4
make[3]: Leaving directory `/home/alfred/Desktop/Work/riscv-gnu-toolchain/build-binutils-linux/binutils'
make[2]: *** [all-binutils] Error 2
make[2]: Leaving directory `/home/alfred/Desktop/Work/riscv-gnu-toolchain/build-binutils-linux'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/alfred/Desktop/Work/riscv-gnu-toolchain/build-binutils-linux'
make: *** [stamps/build-binutils-linux] Error 2
I noticed that m4 did not recognize a certain argument
--gnu
should I be concerned with this?
[UPDATE 16/12/2019]
As recommended, I tried to build the tool-chain in Ubuntu 18.04.03 (originally I was on 14.04) and it seems to have solved the problem quite well! Turns out that the tool-chain is indeed "fragile" when it comes to OS dependencies. Thanks so much for the help!
The error "Link tests are not allowed" is something connected to incomplete toolchain (like ld, binutils, libc), similar to report inhttps://gcc.gnu.org/ml/gcc-help/2012-07/msg00018.html.
It is unclear from your question which instruction did you use to build gcc. I think you should search not for gcc only build, but for complete toolchain instruction like https://github.com/riscv/riscv-gnu-toolchain or something from Ibex authors web-site.
Ibex documentation in page https://ibex-core.readthedocs.io/en/latest/verification.html#getting-started has some link to "GCC setup", but it is for verification and without complete instruction.
In issue https://github.com/riscv/riscv-gcc/issues/143 there is information that "You can't build gcc without binutils." and "You can't build a useful gcc without a C library.", so try to build complete toolchain, not the gcc only.
In earlier project by lowrisc there was instruction to build toolchain (combined gcc + binutils + newlib): https://www.lowrisc.org/blog/2017/09/building-upstream-risc-v-gccbinutilsnewlib-the-quick-and-dirty-way/ - you may want to modify the instruction with another git (riscv-gcc). Or just try https://github.com/riscv/riscv-gnu-toolchain
I have found that the RISC-V toolchain is very fragile with respect to OS dependencies. The toolchain team uses Ubuntu 16, and a lot of errors folks see arise from the changes to the Linux ecosystem since that version.
I got around this issue by creating a Vagrantfile that is configured to use Ubuntu 16, and goes through the official steps, and at least for me, it builds the tools just fine. If you're interested, it's posted inside the stackoverflow question I asked along these lines. If you need to configure the tools differently, it's straightforward to do in the Vagrantfile.
Try this version for integer riscv. I tried it already and passed.
git clone https://github.com/riscv/riscv-gnu-toolchain
git checkout 411d134
git submodule update --init --recursive
mkdir build
cd build
../configure --prefix=/opt/riscv32i --with-arch=rv32i --with-abi=ilp32
make -j8
If your riscv has mul/div module, add M standard extension.
../configure --prefix=/opt/riscv32im --with-arch=rv32im --with-abi=ilp32
If your riscv is 64-bit integer core:
../configure --prefix=/opt/riscv64i --with-arch=riscv64i --with-abi=lp64
select option that you want to build:
"M" Standard Extension for Integer Multiplication and Divison
"A" Standard Extension for Atomic Instructions
"F" Standard Extension for Single-Precision Floating-Point
"D" Standard Extension for Double-Precision Floating-Point
"Q" Standard Extension for Quard-Precision Floating-point
"C" Standard Extension for Compressed Instruction
"G" combination of I, M, A, F and D.
ilp32/ilp32f/ilp32d int-32bits long-32bits pointer-32bits
lp64/lp64f/lp64d int-32bits long-64bits pointer-64bits
The vexrisc full project implement riscv on arty a7 35t, includes toolchain compile and using IntelliJ IDE build riscv project and internal USB jtag debugging may help you.
https://fatalfeel.blogspot.com/2013/12/risc-v-on-arty-a7-35t.html
Maybe you want to try Linux on riscv. It's based on vexrisc
https://github.com/SpinalHDL/SaxonSoc

fatal error: png.h: No such file or directory(MiddleBury Evaluation)

I am testing stereo algorithm in MiddleBury Stereo Evaluation
One of step was to compile the tools in code/as follows.
cd code/imageLib
make
cd ..
make
cd ..
In this case, there is error in first make as follows,
$ make
g++ -O3 -W -Wall -g -c -o ImageIOpng.o ImageIOpng.cpp
ImageIOpng.cpp:19:17: fatal error: png.h: No such file or directory
compilation terminated.
make: *** [<builtin>: ImageIOpng.o] Error 1
and, regarding second make,
$ make
g++ -g -O3 -W -Wall -IimageLib ii.cpp -LimageLib -lImg.i686-g -lpng -lz -o ii
/usr/lib/gcc/i686-pc-cygwin/5.4.0/../../../../i686-pc-cygwin/bin/ld: cannot find -lImg.i686-g
/usr/lib/gcc/i686-pc-cygwin/5.4.0/../../../../i686-pc-cygwin/bin/ld: cannot find -lpng
collect2: error: ld returned 1 exit status
make: *** [<builtin>: ii] Error 1
In previous step, make worked fine.
So, what was the problem? I downloaded sample algorithm and did not edit/change contents in any file.
png.h is part of libpng16-devel and the specific include
directory must be added to the include path of your project.
$ cygcheck -l libpng16-devel |grep png.h
/usr/include/libpng16/png.h

'glib.h' file not found on Max OSX 10.9

I'm trying to compile msg2pdf which is a tool to convert messages in mu4e (mu for Emacs) to pdf.
I'm receiving the following error :
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in .
CC msg2pdf.o
In file included from msg2pdf.c:20:
In file included from ../../lib/mu-msg.h:24:
../../lib/mu-flags.h:24:10: fatal error: 'glib.h' file not found
#include <glib.h>
^
1 error generated.
make[2]: *** [msg2pdf.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Oddly, I checked the Makefile and GLIB_CFLAGS seem to be pointing on the right folder (where brew installed it).
In fact, glib.h is located in /usr/local/Cellar/glib/2.40.0_1/include/glib-2.0.
GLIB_CFLAGS = -D_REENTRANT -I/usr/local/Cellar/glib/2.40.0_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.40.0_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include
GLIB_LIBS = -L/usr/local/Cellar/glib/2.40.0_1/lib -L/usr/local/opt/gettext/lib -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl
How can I succeed compiling the file? Is there any command line "hack" I can use while calling
make?
Edit
Here are the files in the directory
https://github.com/flexdec/temp
Edit 2
This is the output when using make V=1
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in .
gcc -DHAVE_CONFIG_H -I. -I../.. -I../../lib -DICONDIR='""' -Wall -Wextra -Wno-unused-parameter -Wdeclaration-after-statement -g -O2 -MT msg2pdf.o -MD -MP -MF .deps/msg2pdf.Tpo -c -o msg2pdf.o msg2pdf.c
In file included from msg2pdf.c:20:
In file included from ../../lib/mu-msg.h:24:
../../lib/mu-flags.h:24:10: fatal error: 'glib.h' file not found
#include <glib.h>
^
1 error generated.
make[2]: *** [msg2pdf.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Edit 3
The new error I get using make V=1 now that GLIB_CFLAGS issue is fixed
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in .
gcc -DHAVE_CONFIG_H -I. -I../.. -I../../lib -D_REENTRANT -I/usr/local/Cellar/glib/2.40.0_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.40.0_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -DICONDIR='""' -Wall -Wextra -Wno-unused-parameter -Wdeclaration-after-statement -g -O2 -MT msg2pdf.o -MD -MP -MF .deps/msg2pdf.Tpo -c -o msg2pdf.o msg2pdf.c
msg2pdf.c:24:10: fatal error: 'gtk/gtk.h' file not found
#include <gtk/gtk.h>
^
1 error generated.
make[2]: *** [msg2pdf.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
make V=1 instead of make will tell you what the C compiler command looks like (instead of just "CC msg2pdf.o")—check that and make sure it includes the flags you need.
Based on a quick look at your Makefile.am, you are including $(GTK_CFLAGS) and $(WEBKIT_CFLAGS) in your AM_CPPFLAGS but not $(GLIB_CFLAGS).
You need to run ./configure in mu's top-level directory on the machine where you want to compile it. configure will tell you about any missing dependencies. Optional components (such as msg2pdf) are skipped if their dependencies are not there.
Then, after configure succeeds, do a 'make'.
In any case, if configure has run successfully, the top-level 'make' should succeed as well (that's why we have configure!), otherwise please file a bug.

Compiling libptrace

Trying to compile libptrace (http://sourceforge.net/projects/libptrace/). The project has not advertised any preferred means of requesting support (Unfortunately, this project hasn't indicated the best way to get help). Anywho, the problem I'm running into 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 google libptrace and libgnu.la, you get zero hits. Grepping for it in the source take fresh out of 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 have no idea how to generate a libtool archive file, and source doesn't seem to have any make targets or scripts otherwise to do so.
An note on admin: please add the tag `libptrace' to this question - obviously a very popular topic - I can't do so as I don't meet the 1.5K point count :(
In response to Mel's amendment to build.sh, Here are the new errors generated on `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
This is gnulib: http://www.gnu.org/software/gnulib/
It can be install in Debian with apt-get install gnulib
builds on Ubuntu 10.10, gnulib is required as noted above and probably a whole bunch of build tools (autoconf, automake)
below patch fixes a link error which occurs when building 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
if 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
if TARGET_I386
libptrace_la_SOURCES += libptrace_linux_x86.c libptrace_linux_x86.h
## -38,8 +38,8 ## endif
if 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
if TARGET_I386
libptrace_la_SOURCES += libptrace_freebsd_x86.c libptrace_freebsd_x86.h
First of all, this only works on linux. If you want this to work on other systems, you will need to write a src/libptrace_config.h header in configure.ac as can be seen by grep COMPILE_HDR configure.ac.
Secondly, the following patch is all I need to get the point where the generated header is missing on my system. Of course gnulib needs to be installed and 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

Resources