Binutils doesn't compile when disregarding instructions

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
shervingav
Posts: 11
Joined: Sun May 11, 2014 6:19 am
Location: Iran

Binutils doesn't compile when disregarding instructions

Post 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
"Sometimes it is the people who no one imagines anything of, who do the things that no one can IMAGINE."
_Alan Turing
Nable
Member
Member
Posts: 453
Joined: Tue Nov 08, 2011 11:35 am

Re: cross compiler build: binutils make error

Post 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.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: cross compiler build: binutils make error

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: Binutils doesn't compile when disregarding instructions

Post 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.
Andrej
Posts: 19
Joined: Wed Jun 22, 2016 2:52 pm

Re: Binutils doesn't compile when disregarding instructions

Post 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
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Binutils doesn't compile when disregarding instructions

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
heat
Member
Member
Posts: 103
Joined: Sat Mar 28, 2015 11:23 am
Libera.chat IRC: heat

Re: Binutils doesn't compile when disregarding instructions

Post 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?
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx
Andrej
Posts: 19
Joined: Wed Jun 22, 2016 2:52 pm

Re: Binutils doesn't compile when disregarding instructions

Post 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.
Post Reply