OSDev.org
https://forum.osdev.org/

unable to build binutils for my cross compiler
https://forum.osdev.org/viewtopic.php?f=1&t=26171
Page 1 of 1

Author:  dansmahajan [ Wed Jan 09, 2013 12:40 pm ]
Post subject:  unable to build binutils for my cross compiler

hi everyone,i am trying to build binutils 2.19.1 with mingw/msys using following commands:
Code:
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:
/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

Author:  dansmahajan [ Wed Jan 09, 2013 1:29 pm ]
Post subject:  Re: unable to build binutils for my cross compiler

i've also tried the command
Code:
make CFLAGS="-Os -w"

bt still the same problem persists

Author:  jnc100 [ Wed Jan 09, 2013 1:31 pm ]
Post subject:  Re: unable to build binutils for my cross compiler

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.

Author:  dansmahajan [ Wed Jan 09, 2013 1:37 pm ]
Post subject:  Re: unable to build binutils for my cross compiler

no i am using the latest version of msys

Author:  jnc100 [ Wed Jan 09, 2013 1:44 pm ]
Post subject:  Re: unable to build binutils for my cross compiler

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

Regards,
John.

Author:  qw [ Thu Jan 10, 2013 3:03 am ]
Post subject:  Re: unable to build binutils for my cross compiler

Does MSYS support "cygpath"?

EDIT: After some Googling and testing, I think the answer is "no". Then why does libtool try to invoke it?

Author:  sortie [ Thu Jan 10, 2013 8:11 am ]
Post subject:  Re: unable to build binutils for my cross compiler

Quote:
../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.

Author:  Combuster [ Thu Jan 10, 2013 8:21 am ]
Post subject:  Re: unable to build binutils for my cross compiler

Not using a several years old binutils will probably help as well.

Author:  dansmahajan [ Thu Jan 10, 2013 1:08 pm ]
Post subject:  Re: unable to build binutils for my cross compiler

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

Author:  dansmahajan [ Thu Jan 10, 2013 1:16 pm ]
Post subject:  Re: unable to build binutils for my cross compiler

Quote:
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:
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

Author:  dansmahajan [ Wed Feb 06, 2013 11:36 am ]
Post subject:  Re: unable to build binutils for my cross compiler

[Solved]
Code:
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

Author:  greatleo [ Tue Jul 30, 2013 4:36 am ]
Post subject:  Re: unable to build binutils for my cross compiler

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:
echo "MAKEINFO = :" >> Makefile


viewtopic.php?f=1&t=17530

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/