Page 1 of 1

Binutils doesn't compile when disregarding instructions

Posted: Sun May 18, 2014 5:57 am
by shervingav
hi,
im trying to build the cross compiler.
but when running make in binutils all i get is this:

sudo make
Making info in doc make[1]: Entering directory `/home/ali/Desktop/cross/binutils-2.24/build-binutils/doc' make[1]: Nothing to be done for `info'. make[1]: Leaving directory `/home/ali/Desktop/cross/binutils-2.24/build-binutils/doc'
Making info in po make[1]: Entering directory `/home/ali/Desktop/cross/binutils-2.24/build-binutils/po' make[1]: Nothing to be done for `info'. make[1]: Leaving directory `/home/ali/Desktop/cross/binutils-2.24/build-binutils/po' make[1]: Entering directory `/home/ali/Desktop/cross/binutils-2.24/build-binutils' make[1]: Nothing to be done for `info-am'. make[1]: Leaving directory `/home/ali/Desktop/cross/binutils-2.24/build-binutils'
make[1]: Nothing to be done for `info-am'. make[1]: Leaving directory `/home/ali/Desktop/cross/binutils-2.24/build-binutils' make all-recursive make[1]: Entering directory `/home/ali/Desktop/cross/binutils-2.24/build-binutils' Making all in doc make[2]: Entering directory `/home/ali/Desktop/cross/binutils-2.24/build-binutils/doc'
make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/home/ali/Desktop/cross/binutils-2.24/build-binutils/doc'
Making all in po make[2]: Entering directory `/home/ali/Desktop/cross/binutils-2.24/build-binutils/po' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/home/ali/Desktop/cross/binutils-2.24/build-binutils/po' make[2]: Entering directory `/home/ali/Desktop/cross/binutils-2.24/build-binutils'
gcc -DHAVE_CONFIG_H -I. -I../binutils -I. -I../binutils -I../bfd -I../binutils/../bfd -I../binutils/../include -DLOCALEDIR="\"/home/ali/opt/cross/share/locale\"" -Dbin_dummy_emulation=bin_vanilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -g -O2 -MT size.o -MD -MP -MF .deps/size.Tpo -c -o size.o ../binutils/size.c
In file included from ../binutils/size.c:33:0: ../binutils/sysdep.h:30:20: fatal error: bfdver.h: No such file or directory #include "bfdver.h" ^ compilation terminated. make[2]: *** [size.o] Error 1 make[2]: Leaving directory `/home/ali/Desktop/cross/binutils-2.24/build-binutils' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/ali/Desktop/cross/binutils-2.24/build-binutils' make: *** [all] Err

Re: cross compiler build: binutils make error

Posted: Sun May 18, 2014 8:57 am
by Nable
Did you run ./configure before trying to run make?
What arguments did you pass to ./configure script?
Btw, 'sudo make' is a very bad idea.

Re: cross compiler build: binutils make error

Posted: Sun May 18, 2014 3:15 pm
by Combuster
sudo make
In other words, follow the tutorial properly. If you deviate from it like you do now, all bets are off in the first place.

Re: Binutils doesn't compile when disregarding instructions

Posted: Tue May 20, 2014 11:47 am
by sortie
Looking at this again, it appears you are doing an out-of-directory build of binutils inside a binutils subdirectory. This isn't supported and won't work. Building as root is strongly discouraged, but it ought to work.

Re: Binutils doesn't compile when disregarding instructions

Posted: Mon Jul 18, 2016 3:26 pm
by Andrej
Hi,
I have a similar problem. The commands I've executed:

Code: Select all

export PREFIX="$HOME/cross_compiler"
export TARGET=i686-elf
export PATH="$PREFIX/bin:$PATH"

cd /inside/binutils/sourcedir
mkdir build-binutils
cd build-binutils
../binutils-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
make
I've also tried:

Code: Select all

cd /outside/binutils/sourcedir
mkdir build-binutils
cd build-binutils
../binutils-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
make
But doesn't matters what I'm doing, the result is the same:

if [ -r sysinfo.c ]; then \
gcc -c -I. -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -I../binutils/../zlib sysinfo.c ; \
else \
gcc -c -I. -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -I../binutils/../zlib ../binutils/sysinfo.c ; \
fi
gcc -c -I. -I../binutils -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -I../binutils/../zlib ../binutils/syslex_wrap.c
gcc -o sysinfo sysinfo.o syslex_wrap.o
./sysinfo -d <../binutils/sysroff.info >sysroff.h
Making info in doc
make[1]: Entering directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils/doc'
if test -f cxxfilt.man; then \
man=cxxfilt.man; \
else \
man=../../binutils/doc/cxxfilt.man; \
fi; \
sed -e 's/@PROGRAM@/c++filt/' \
-e 's/cxxfilt/c++filt/' < $man \
> c++filt.1
make[1]: Leaving directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils/doc'
Making info in po
make[1]: Entering directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils/po'
make[1]: Nothing to be done for `info'.
make[1]: Leaving directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils/po'
make[1]: Entering directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils'
make[1]: Nothing to be done for `info-am'.
make[1]: Leaving directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils'
make all-recursive
make[1]: Entering directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils'
Making all in doc
make[2]: Entering directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils/doc'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils/doc'
Making all in po
make[2]: Entering directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils/po'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils/po'
make[2]: Entering directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils'
gcc -DHAVE_CONFIG_H -I. -I../binutils -I. -I../binutils -I../bfd -I../binutils/../bfd -I../binutils/../include -DLOCALEDIR="\"/home/andrej/cross_compiler/share/locale\"" -Dbin_dummy_emulation=bin_vanilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -I../binutils/../zlib -g -O2 -MT size.o -MD -MP -MF .deps/size.Tpo -c -o size.o ../binutils/size.c
In file included from ../binutils/size.c:31:0:
../binutils/sysdep.h:28:20: fatal error: bfdver.h: Nincs ilyen fájl vagy könyvtár
#include "bfdver.h"
^
compilation terminated.
make[2]: *** [size.o] Error 1
make[2]: Leaving directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils'
make: *** [all] Error 2

Thank You in advance,
Andrej

Re: Binutils doesn't compile when disregarding instructions

Posted: Mon Jul 18, 2016 4:29 pm
by Combuster
I know, reading and following instructions can be really hard, but I suggest that you at least try to do it that way.

Re: Binutils doesn't compile when disregarding instructions

Posted: Mon Jul 18, 2016 6:36 pm
by heat
Andrej wrote:Hi,
I have a similar problem. The commands I've executed:

Code: Select all

export PREFIX="$HOME/cross_compiler"
export TARGET=i686-elf
export PATH="$PREFIX/bin:$PATH"

cd /inside/binutils/sourcedir
mkdir build-binutils
cd build-binutils
../binutils-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
make
I've also tried:

Code: Select all

cd /outside/binutils/sourcedir
mkdir build-binutils
cd build-binutils
../binutils-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
make
But doesn't matters what I'm doing, the result is the same:

if [ -r sysinfo.c ]; then \
gcc -c -I. -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -I../binutils/../zlib sysinfo.c ; \
else \
gcc -c -I. -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -I../binutils/../zlib ../binutils/sysinfo.c ; \
fi
gcc -c -I. -I../binutils -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -I../binutils/../zlib ../binutils/syslex_wrap.c
gcc -o sysinfo sysinfo.o syslex_wrap.o
./sysinfo -d <../binutils/sysroff.info >sysroff.h
Making info in doc
make[1]: Entering directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils/doc'
if test -f cxxfilt.man; then \
man=cxxfilt.man; \
else \
man=../../binutils/doc/cxxfilt.man; \
fi; \
sed -e 's/@PROGRAM@/c++filt/' \
-e 's/cxxfilt/c++filt/' < $man \
> c++filt.1
make[1]: Leaving directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils/doc'
Making info in po
make[1]: Entering directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils/po'
make[1]: Nothing to be done for `info'.
make[1]: Leaving directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils/po'
make[1]: Entering directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils'
make[1]: Nothing to be done for `info-am'.
make[1]: Leaving directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils'
make all-recursive
make[1]: Entering directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils'
Making all in doc
make[2]: Entering directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils/doc'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils/doc'
Making all in po
make[2]: Entering directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils/po'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils/po'
make[2]: Entering directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils'
gcc -DHAVE_CONFIG_H -I. -I../binutils -I. -I../binutils -I../bfd -I../binutils/../bfd -I../binutils/../include -DLOCALEDIR="\"/home/andrej/cross_compiler/share/locale\"" -Dbin_dummy_emulation=bin_vanilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -I../binutils/../zlib -g -O2 -MT size.o -MD -MP -MF .deps/size.Tpo -c -o size.o ../binutils/size.c
In file included from ../binutils/size.c:31:0:
../binutils/sysdep.h:28:20: fatal error: bfdver.h: Nincs ilyen fájl vagy könyvtár
#include "bfdver.h"
^
compilation terminated.
make[2]: *** [size.o] Error 1
make[2]: Leaving directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/andrej/myfiles/cross_compiler/src/binutils-2.26/build-binutils'
make: *** [all] Error 2

Thank You in advance,
Andrej
Where are you making the build from(in-tree or out)? In-tree isn't supported, even if it's a sub-directory inside the "binutils-x.y.z" directory. What's your GCC and Binutils version? What system? Are you sure "../binutils-x.y.z/configure" is running successfully?

Re: Binutils doesn't compile when disregarding instructions

Posted: Sun Jul 24, 2016 8:25 am
by Andrej
Hi,
Finally I've succeeded. No idea what was going wrong, just deleted everything what was needed for the process, even the source files and started everything again, it seems to work this time.