I am trying to build GNU toolchain for OpenRISC by following the guide given at http://openrisc.net/toolchain-build.html on Fedora Virtual Box Image.
I am getting error saying
Configure: error: cannot run /bin/sh ../gcc-svn/config.sub
when I try to configure gcc.
I am new to Linux. I could not find any solution online. Any help to solve the issue is highly appreciated.
Open config.sub with a hex editor to see if the line endings are \r\n instead of just \n. If so, make a backup of the entire folder and then type:
dos2unix *
That will change all line endings from \r\n to \n, and it does it in place, overwriting each file. Then, again try:
./configure (with any options you desire)
I had this problem on cygwin for Windows where GitHub had converted all files to \r\n, so I had to convert them back with dos2unix.
1.check and install libtools
yum install libtool
yum install libtool-ltdl
yum install libtool-ltdl-devel
2.try run "../gcc-svn/config.sub" through shell
/bin/bash ../gcc-svn/config.sub
see if shows as follows:
[root@centos jemalloc]# /bin/bash ./config.sub
: command not foundine 6:
: command not foundine 8:
: command not foundine 30:
: command not foundine 31:
: command not foundine 39:
: command not foundine 42:
: command not foundine 50:
: command not foundine 57:
: command not foundine 59:
: command not foundine 72:
: command not foundine 82:
: command not foundine 85:
'/config.sub.bak: line 88: syntax error near unexpected token in
'/config.sub.bak: line 88: ` case $1 in
3.find the system config.sub
find / -name config.sub
it shows:
/usr/share/libtool/config/config.sub
compare the two config.sub to see if they are similar.
4.replace config.sub
with system file
mv ../gcc-svn/config.sub ../gcc-svn/config.sub.bak
cp /usr/share/libtool/config/config.sub ../gcc-svn/config.sub
mv ../gcc-svn/config.guess ../gcc-svn/config.guess.bak
cp /usr/share/libtool/config/config.guess ../gcc-svn/config.guess
What is the first line of your ../gcc-svn/config.sub file? I'm guessing it may have a typo. It should be
#!/bin/sh
and not
/bin/sh
If it is
#!/bin/sh
Make sure that the file /bin/sh exists and is executable
ls -l /bin/sh
Should show something like
-rwxrwxrwx 1 root root 4 Feb 3 2009 /bin/sh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With