Configure: error: cannot run /bin/sh

Chethan N picture Chethan N · Jun 11, 2014 · Viewed 27.9k times · Source

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.

Answer

Dave Lampert picture Dave Lampert · Oct 28, 2016

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.