unable to build binutils for my cross compiler

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
dansmahajan
Member
Member
Posts: 62
Joined: Mon Jan 07, 2013 10:38 am

unable to build binutils for my cross compiler

Post by dansmahajan »

hi everyone,i am trying to build binutils 2.19.1 with mingw/msys using following commands:

Code: Select all

export PREFIX=/usr/local/cross
export TARGET=i586-elf
cd /usr/src
mkdir build-binutils
cd /usr/src/build-binutils
../binutils-x.xx/configure --target=$TARGET --prefix=$PREFIX --disable-nls
make all
make install
and im getting following errors:

Code: Select all

/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../binuti
ls-2.19.1/bfd -I. -D__USE_MINGW_FSEEK    -I. -I../../binutils-2.19.1/bfd -I../..
/binutils-2.19.1/bfd/../include     -W -Wall -Wstrict-prototypes -Wmissing-proto
types -Wno-format -Werror -g -O2 -D__USE_MINGW_ACCESS -c -o archive.lo ../../bin
utils-2.19.1/bfd/archive.c
./libtool: line 2258: cygpath: command not found
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.19.1/bfd -I. -D__U
SE_MINGW_FSEEK -I. -I../../binutils-2.19.1/bfd -I../../binutils-2.19.1/bfd/../in
clude -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-format -Werror -g -
O2 -D__USE_MINGW_ACCESS -c "" -o archive.o
gcc.exe: error: : No such file or directory
gcc.exe: fatal error: no input files
compilation terminated.
make[3]: *** [archive.lo] Error 1
make[3]: Leaving directory `/usr/src/build-binutils/bfd'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/usr/src/build-binutils/bfd'
make[1]: *** [install-bfd] Error 2
make[1]: Leaving directory `/usr/src/build-binutils'
make: *** [install] Error 2
/x.sh: line 8: ../gcc-4.5.0/configure: No such file or directory
make: *** No rule to make target `all-gcc'.  Stop.
make: *** No rule to make target `install-gcc'.  Stop.
i am getting the same error even for the diff binutils version,i have tried binutils-2.19.1, 2.22.0, 2.23.1
so what can be the problem ??
also my mingw's gcc compiler version is 4.6.2
dansmahajan
Member
Member
Posts: 62
Joined: Mon Jan 07, 2013 10:38 am

Re: unable to build binutils for my cross compiler

Post by dansmahajan »

i've also tried the command

Code: Select all

make CFLAGS="-Os -w"
bt still the same problem persists
Last edited by dansmahajan on Wed Jan 09, 2013 1:36 pm, edited 1 time in total.
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Re: unable to build binutils for my cross compiler

Post by jnc100 »

From a quick google, the 'libtool ... cygpath: command not found' error seems to be a common occurrence with older versions of msys - the only recommended solutions appear to be either not to try building whatever you are trying to build as a shared library or to upgrade your msys version. Are you using a particularly old msys?

Regards,
John.
dansmahajan
Member
Member
Posts: 62
Joined: Mon Jan 07, 2013 10:38 am

Re: unable to build binutils for my cross compiler

Post by dansmahajan »

no i am using the latest version of msys
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Re: unable to build binutils for my cross compiler

Post by jnc100 »

In that case perhaps try passing the '--disable-shared' option to configure?

Regards,
John.
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: unable to build binutils for my cross compiler

Post by qw »

Does MSYS support "cygpath"?

EDIT: After some Googling and testing, I think the answer is "no". Then why does libtool try to invoke it?
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: unable to build binutils for my cross compiler

Post by sortie »

../binutils-x.xx/configure --target=$TARGET --prefix=$PREFIX --disable-nls
That looks like you are not providing the exact commands you use to build, could you provide those, if you still have the problem? I suspect that the configure script thinks its running under Cygwin. Do you have (or have had) Cygwin installed? Perhaps there are some environmental variables around, type 'env' in your bash and show the results here. Try passing the correct --build=whatever-msys-mingw-triple to help configure figure out what platform it is running on.
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: unable to build binutils for my cross compiler

Post by Combuster »

Not using a several years old binutils will probably help as well.
"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 ]
dansmahajan
Member
Member
Posts: 62
Joined: Mon Jan 07, 2013 10:38 am

Re: unable to build binutils for my cross compiler

Post by dansmahajan »

i have tried the disable-shared and make configure-host commands but still the result is same, the same error and annoying part is i am not able to get info about this error on google
dansmahajan
Member
Member
Posts: 62
Joined: Mon Jan 07, 2013 10:38 am

Re: unable to build binutils for my cross compiler

Post by dansmahajan »

That looks like you are not providing the exact commands you use to build, could you provide those, if you still have the problem? I suspect that the configure script thinks its running under Cygwin. Do you have (or have had) Cygwin installed? Perhaps there are some environmental variables around, type 'env' in your bash and show the results here. Try passing the correct --build=whatever-msys-mingw-triple to help configure figure out what platform it is running on.
no i dont have cygwin installed.
these are the result for the env command

Code: Select all

HOMEPATH=\
APPDATA=D:\Documents and Settings\Manish\Application Data
TERM=cygwin
PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 7, GenuineIntel
WINDIR=D:\WINDOWS
PT5HOME=c:\Program Files\Cisco Packet Tracer 5.3
OLDPWD=/home/Manish
USERDOMAIN=MANISH
OS=Windows_NT
ALLUSERSPROFILE=D:\Documents and Settings\All Users
VBOX_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\
JRE_HOME=D:\Program Files\Java\jre7
!::=::\
TEMP=/tmp
COMMONPROGRAMFILES=D:\Program Files\Common Files
USERNAME=Manish
PROCESSOR_LEVEL=15
PATH=.:/usr/local/bin:/mingw/bin:/bin:/d/WINDOWS/system32:/d/WINDOWS:/d/WINDOWS/
System32/Wbem:/d/Program Files/Java/jdk1.7.0/bin:/d/Program Files/Microsoft Netw
ork Monitor 3/:/c/Program Files/Apache Software Foundation/apache-tomcat-6.0.32/
lib/:/d/WINDOWS/system32/WindowsPowerShell/v1.0:/c/Program Files/MinGW/bin:/c/Pr
ogram Files/NASM:.
MSYSCON=sh.exe
FP_NO_HOST_CHECK=NO
PWD=/usr/src/build-binutils
SYSTEMDRIVE=D:
JAVA_HOME=D:\Program Files\Java\jdk1.7.0
USERPROFILE=D:\Documents and Settings\Manish
CLIENTNAME=Console
PS1=\[\033]0;$MSYSTEM:\w\007
\033[32m\]\u@\h \[\033[33m\w\033[0m\]
$
LOGONSERVER=\\MANISH
PROCESSOR_ARCHITECTURE=x86
!C:=C:\msys\1.0\bin
HOME=/home/Manish
SHLVL=1
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PSC1
HOMEDRIVE=D:
PROMPT=$P$G
MSYSTEM=MINGW32
COMSPEC=D:\WINDOWS\system32\cmd.exe
LOGNAME=Manish
TMP=/tmp
SYSTEMROOT=D:\WINDOWS
PROCESSOR_REVISION=0407
CLASSPATH=;
MAKE_MODE=unix
PROGRAMFILES=D:\Program Files
NUMBER_OF_PROCESSORS=2
SESSIONNAME=Console
HISTFILE=/home/Manish/.bash_history
COMPUTERNAME=MANISH
dansmahajan
Member
Member
Posts: 62
Joined: Mon Jan 07, 2013 10:38 am

Re: unable to build binutils for my cross compiler

Post by dansmahajan »

[Solved]

Code: Select all

export PREFIX=/usr/local/cross
export TARGET=i586-elf
cd /usr/src/build-binutils
../binutils-2.19.1/configure --target=$TARGET --prefix=$PREFIX --disable-nls --disable-shared -disable-libssp --disable-multilib --disable-werror
make configure-host
make
make install
cd /usr/src/build-gcc
export PATH=$PATH:$PREFIX/bin
../gcc-4.5.0/configure --target=$TARGET --prefix=$PREFIX --disable-nls --enable-languages=c --without-headers
make all-gcc
make install-gcc
above is the script that solved my problem and one thing should be kept in mind that the whole script should be executed at one go as it has caused some problems to me
greatleo
Posts: 1
Joined: Wed May 28, 2008 10:01 pm

Re: unable to build binutils for my cross compiler

Post by greatleo »

I also faced the same error. But the above solution is not working for me. Getting the same error again.

But as said in the below thread executing the below code after configure making things correct. If this the proposed one is not working, you can try this.

Code: Select all

echo "MAKEINFO = :" >> Makefile
http://forum.osdev.org/viewtopic.php?f=1&t=17530
Post Reply