Page 1 of 1

newlib make install ranlib not found

Posted: Mon Aug 22, 2016 1:47 pm
by szhou42
I am following this tutorial http://wiki.osdev.org/Porting_Newlib.
Everything is fine until I do this

Code: Select all

make DESTDIR=${SYSROOT} install

Code: Select all

Making install in doc
make[3]: Entering directory `/home/vagrant/test/build-newlib/i686-pc-simpleos/newlib/doc'
make[4]: Entering directory `/home/vagrant/test/build-newlib/i686-pc-simpleos/newlib/doc'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/home/vagrant/test/build-newlib/i686-pc-simpleos/newlib/doc'
make[3]: Leaving directory `/home/vagrant/test/build-newlib/i686-pc-simpleos/newlib/doc'
Making install in .
make[3]: Entering directory `/home/vagrant/test/build-newlib/i686-pc-simpleos/newlib'
make[4]: Entering directory `/home/vagrant/test/build-newlib/i686-pc-simpleos/newlib'
make[4]: Nothing to be done for `install-exec-am'.
 /bin/mkdir -p '/home/vagrant/cross//usr/i686-pc-simpleos/lib'
 /usr/bin/install -c -m 644  libm.a libc.a '/home/vagrant/cross//usr/i686-pc-simpleos/lib'
 ( cd '/home/vagrant/cross//usr/i686-pc-simpleos/lib' && i686-pc-simpleos-ranlib libm.a )
/bin/bash: line 5: i686-pc-simpleos-ranlib: command not found
make[4]: *** [install-toollibLIBRARIES] Error 127
make[4]: Leaving directory `/home/vagrant/test/build-newlib/i686-pc-simpleos/newlib'
make[3]: *** [install-am] Error 2
make[3]: Leaving directory `/home/vagrant/test/build-newlib/i686-pc-simpleos/newlib'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/vagrant/test/build-newlib/i686-pc-simpleos/newlib'
make[1]: *** [install-target-newlib] Error 2
make[1]: Leaving directory `/home/vagrant/test/build-newlib'
make: *** [install] Error 2
vagrant@vagrant-ubuntu-trusty-32:~/test/build-newlib$ i686-pc-simpleos-ranlib
Usage: i686-pc-simpleos-ranlib [options] archive
 Generate an index to speed access to archives
 The options are:
  @<file>                      Read options from <file>
  -D                           Use zero for symbol map timestamp
  -U                           Use actual symbol map timestamp (default)
  -t                           Update the archive's symbol map timestamp
  -h --help                    Print this help message
  -v --version                 Print version information
i686-pc-simpleos-ranlib: supported targets: elf32-i386 elf32-little elf32-big srec symbolsrec verilog tekhex binary ihex
Why is it saying i686-pc-simpleos-ranlib: command not found? I can run this i686-pc-simpleos-ranlib anywhere without problems.

Re: newlib make install ranlib not found

Posted: Mon Aug 22, 2016 2:19 pm
by Octacone
Make sure your i686 compiler is actually exported.
If it says not found, then it is not there.
Try replacing that with your actual path to it and see if that works out.

Re: newlib make install ranlib not found

Posted: Mon Aug 22, 2016 2:27 pm
by szhou42
octacone wrote:Make sure your i686 compiler is actually exported.
If it says not found, then it is not there.
Try replacing that with your actual path to it and see if that works out.
Hi, I have exported the path where i686-pc-simpleos-ranlib is in, and I tried running i686-pc-simpleos-ranlib anywhere, absolutely no problems.

I exported it by adding this line into ~/.profile
export PATH="$HOME/cross/bin:$PATH"

------------------------------------------
edit:
weird, it works if I replace i686-pc-simpleos-ranlib with the absolute path

Re: newlib make install ranlib not found

Posted: Mon Aug 22, 2016 2:43 pm
by Octacone
szhou42 wrote: edit:
weird, it works if I replace i686-pc-simpleos-ranlib with the absolute path
There you go. You probably did not export your path correctly.
Take a look at: http://askubuntu.com/questions/60218/ho ... to-my-path
Don't forget to add wanted binary name at the end of your path:

/home/yourUserName/opt/cross/bin/i386-elf-gcc (from my makefile, replace with your info)

Re: newlib make install ranlib not found

Posted: Mon Aug 22, 2016 11:16 pm
by szhou42
octacone wrote:
szhou42 wrote: edit:
weird, it works if I replace i686-pc-simpleos-ranlib with the absolute path
There you go. You probably did not export your path correctly.
Take a look at: http://askubuntu.com/questions/60218/ho ... to-my-path
Don't forget to add wanted binary name at the end of your path:

/home/yourUserName/opt/cross/bin/i386-elf-gcc (from my makefile, replace with your info)
Thank you octacone :D