arm-none-eabi commands will not install correctly - linux

I'm attempting to install a toolchain for assembly code on the raspberry pi. I used the following procedure to install the package files:
$ wget http://www.cl.cam.ac.uk/freshers/raspberrypi/tutorials/os/downloads/arm-none-eabi.tar.bz2
--2012-08-16 18:26:29-- http://www.cl.cam.ac.uk/freshers/raspberrypi/tutorials/os/downloads/arm-none-eabi.tar.bz2
Resolving www.cl.cam.ac.uk (www.cl.cam.ac.uk)... 128.232.0.20, 2001:630:212:267::80:14
Connecting to www.cl.cam.ac.uk (www.cl.cam.ac.uk)|128.232.0.20|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 32108070 (31M) [application/x-bzip2]
Saving to: `arm-none-eabi.tar.bz2'
100%[======================================>] 32,108,070 668K/s in 67s
2012-08-16 18:27:39 (467 KB/s) - `arm-none-eabi.tar.bz2' saved [32108070/32108070]
$ tar xjvf arm-none-eabi.tar.bz2
arm-2008q3/arm-none-eabi/
arm-2008q3/arm-none-eabi/lib/
arm-2008q3/arm-none-eabi/lib/libsupc++.a
arm-2008q3/arm-none-eabi/lib/libcs3arm.a
...
arm-2008q3/share/doc/arm-arm-none-eabi/info/gprof.info
arm-2008q3/share/doc/arm-arm-none-eabi/info/cppinternals.info
arm-2008q3/share/doc/arm-arm-none-eabi/LICENSE.txt
$ export PATH=$PATH:$HOME/arm-2008q3/bin
That appeared to work, the package files are in the correct place.
~/arm-2008q3/bin $ ls
arm-none-eabi-addr2line arm-none-eabi-gcc-4.3.2 arm-none-eabi-objdump
arm-none-eabi-ar arm-none-eabi-gcov arm-none-eabi-ranlib
arm-none-eabi-as arm-none-eabi-gdb arm-none-eabi-readelf
arm-none-eabi-c++ arm-none-eabi-gdbtui arm-none-eabi-run
arm-none-eabi-c++filt arm-none-eabi-gprof arm-none-eabi-size
arm-none-eabi-cpp arm-none-eabi-ld arm-none-eabi-sprite
arm-none-eabi-g++ arm-none-eabi-nm arm-none-eabi-strings
arm-none-eabi-gcc arm-none-eabi-objcopy arm-none-eabi-strip
However, when I go to make, I get the following outcome.
arm-none-eabi-as -I source/ source/main.s -o build/main.o
make: arm-none-eabi-as: Command not found
make: *** [build/main.o] Error 127
Thanks in advance for any help.

export PATH=$PATH:$HOME/arm-2008q3/bin is only valid in the shell it is executed in (and any shells spawned from that shell). So you either use that shell instead of opening a new one to execute make or edit your ~/.bashrc (see Unix: Getting Export PATH to "Stick")

I encountered the same problem and in my case the problem was that I was running a 64-bit operating system and the package to be used is a 32-bit. The fix was to install i32-libs package which allows running 32-bit applications on a 64-bit system.
# apt-get install ia32-libs

You have to direct your compiler to the right path where arm-none-eabi-as is located. You can do so by
export PATH=$PATH:/file_path_goes_here/
When you compile, you should have no problems as the compiler will now know where to look.

Related

Multixterm - "can't find package Expect"

I am attempting to open multixterm on my desktop machine, but I end up with the error:
usr:~> multixterm
can't find package Expect
while executing
"package require Expect"
(file "/usr/local/bin/multixterm" line 6")
Any help would be appreciated. I've tried running multixterm on my laptop and on a friend's machine, and there is no issue there. Both Expect and multixterm exist in the /usr/local/bin/ directory.
Update: I've also found that neither kibitz nor autoexpect will run. I now assume that there is an issue with where the programs are looking for Expect. Does anyone know how I can verify/check that?
First, run ldd /usr/local/bin/expect to find out where the Expect library (libexpect) is. For example:
% ldd /usr/bin/expect | grep libexpect
libexpect.so.5.45 => /usr/lib/x86_64-linux-gnu/libexpect.so.5.45 (0x00007f230f348000)
%
Then, export the TCLLIBPATH var with the libexpect directory. For example (seems like you're using csh):
% setenv TCLLIBPATH /usr/lib/x86_64-linux-gnu
Then run your multixterm command.
Expect was dropped from ubuntu's default installation,
run once:
conda install -c eumetsat Expect
and things should work again.
In my experience on Ubuntu, libexpect.so obtained through apt cannot be used for package require because the file contains 3 undefined-symbols. (E.g. Debian Bug report logs - #890228)
So I compiled the libexpect.so from its source. To do so, I had to compile 3 sources: Tcl, Tk, and Expect.
After decompressing sources, installing by following:
$ cd /path/to/install
$ mkdir tcl tk expect
$
$ /path/to/download/tcl8.*.*/unix/configure \
--prefix=/path/to/install/tcl
$ make ; make install
$
$ /path/to/download/tk8.*.*/unix/configure \
--with-tcl=/path/to/install/tcl \
--prefix=/path/to/install/tk
$ make ; make install
$
$ /path/to/download/expect5.*.*/configure \
--with-tclconfig=/path/to/install/tcl/lib \
--with-tkconfig=/path/to/install/tk/lib \
--prefix=/path/to/install/expect
$ make ; make install
gave me the file /path/to/install/expect/libexpect5.*.*.so for 64-bit architecture without undefined-symbols.
Here are 2 useful links about compiling:
How to Compile Tcl
[SOLVED] configuration error: Can't find Tcl configuration definition
Finally, in the case TCLLIBPATH does not work, unwarping approach using TclKits with sdx can be remedy. On Ubuntu, I used one for RHEL5 x86_64.

Automake - difficulty with installing version 'automake-1.14.1'

I have problem with installing automake 1.14.1 on Rapbian (2014-09-09-wheezy-raspbian) distro. I wrote sh ./configure and then I wrote make then terminal wrote me that:
$ make
CDPATH="${ZSH_VERSION+.}:" && cd . && "/home/pi/LIBRARY/automake-1.14./twrap/aclocal-1.14"
Can't locate /home/pi/LIBRARY/automake-1.14.1/bin/aclocal in #INC (#INC contains:
/etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5usr
/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at
/home/piLIBRARY/automake-1.14.1/t/wrap/aclocal-1.14 line 29.Makefile:2493: recipe
for target 'aclocal.m4' failed make: *** [aclocal.m4] Error 2
I don't know what does it mean. Can you help me what to do next?
I found out what is problem in. I use filezilla to transport automake to Raspberry Pi (running on Raspbian) in unpacked form. When I transported packed automake.tar through fillezila and then unpacked it on RPi and did installation of this one then I have no problem. However many thanks for all your answers and an effort to help me.
recipe for target 'aclocal.m4' failed make: *** [aclocal.m4] Error 2
Is saying where the failure occurred. So the failure is occurring when the make file calls aclocal.m4. This is due to that Can't locate /home/pi/LIBRARY/automake-1.14.1/bin/aclocal so check out if /home/pi/LIBRARY/automake-1.14.1/bin/aclocal can be found and if not then install what is needed to resolve the error.
I have successfully built on the same raspbian the automake-1.14.1 from ftp.gnu.org/gnu/automake source tarball. The bin/aclocal script should be created at 'make' stage. Makefile.in is already included in the tarball. There can be several reasons to such errors as you typed in your message:
Wrong distribution source is being used: use any from ftp.gnu.org/gnu/automake, http://ftp.gnu.org/gnu/automake/automake-1.14.1.tar.xz
you don't have space enough to create bin/aclocal stage at 'make' stage, check df output
there are problems with fs consistency, read dmesg.

Sys_error using ocamlmklib on an object file

I am compiling a theorem prover on cygwin and I get this error:
$ make
ocamlmklib -o bin/minisatinterface minisat/core/Solver.o minisat/simp/SimpSolver
.o bin/Ointerface.o -lstdc++
** Fatal error: Error while reading minisat/core/Solver.o: Sys_error("Invalid ar
gument")
Makefile:49: recipe for target `bin/libminisatinterface.a' failed
make: *** [bin/libminisatinterface.a] Error 2
It is not clear what kind of invalid argument is here?
The only documentation I have found for ocamlmklib did not help on understanding the error message. Could it not read the file itself or there is a problem with the contents? ls does list the file:
$ ls -l minisat/core/Solver.o
-rw-r--r-- 1 gbuday mkpasswd 2096 jan. 22 10.42 minisat/core/Solver.o
update: if I remove Solver.o I get a different error message:
** Fatal error: Cannot find file "minisat/core/Solver.o"
So the above error message is about the contents of the object file.
I happen to know that this specifically has to do with the build of the ATP Satallax, which can be used with Isabelle Sledgehammer, and I was asked to look at this.
I have no expertise with make files and ocaml. My success at building Satallax v2.7 came purely from following the instruction in INSTALL, with some minimal ability at guessing at what error codes meant, which I mainly needed when building Satallax v2.6 over a year ago.
The first important thing to do is make sure that the tar file is unzipped while working in a Cygwin terminal, rather than under Windows with something like WinZip.
Assuming that you're working in a Cygwin terminal, these are the notes which I made. After that I'll include text from the Satallax INSTALL, and few comments.
Sources: http://www.ps.uni-saarland.de/~cebrown/satallax/
0) tar xvzf satallax-2.7.tar.gz
1) Cygwin Package (these are also for other's like Leo-II):
zlib-devel, make, OCaml devel, gcc devel, g++ devel, libstdc++6-devel
Ubuntu 12 Packages:
sudo apt-get install build-essential
zlibg-dev using the Ubuntu Software Center
ocaml and g++ if they don't come with "build-essential"
2) Put eprover.exe in the path so that ./configure can find it.
a) There are the following lines in the configure files, which shows
that it's configured to find picomus, eprover has to be in the path
or `which eprover` has to be edited.
# Optionally set picomus to your picomus executable
picomus=${PWD}/picosat-936/picomus
# Optionally set eprover to your E theorem prover executable
eprover=`which eprover`
3) Follow the instructions in INSTALL.
a) export MROOT=`pwd` takes care of this next note, which I had to do
for v2.6, info I keep in here in case I need it in the future.
b) export MROOT=<minisat-dir>, where you replace "minisat-dir" with the
/cygdrive/e\E_2\binp\isaprove\satallax-2.6\cygwin\minisat
3) OLD v2.6 NOTE: If you get an error, delete the old source and try
untaring the sources again.
My build of v2.7 went through without problems, other than the test giving errors.
With Satallax v2.7, there is now the requirement that the build find the eprover. Note STEP 3 of INSTALL tells you to modify configure, or put eprover.exe in the path before the build. I put it in the path, which for me is
E:\E_2\dev\Isabelle2013-2\contrib\e-1.8\x86-cygwin
The INSTALL file then gives short instructions:
* Short Instructions
cd minisat
export MROOT=`pwd`
cd core
make Solver.o
cd ../simp
make SimpSolver.o
cd ../../picosat-936
./configure
make
cd ..
./configure
make
./test | grep ERROR
After downloading all needed packages, and putting eprover.exe in the path, it built without errors for me other than the test, but the executable works when used by Isabelle Sledgehammer.
STEP 3 of INSTALL talks about providing the location of the picomus executable, but I'm pretty sure that there's not need to do that because picosat-936\picomus.exe gets built in this build.
If you watch the build messages, it'll tell you what it's looking for and what it finds.
For completeness, I include the text from INSTALL, except for the instructions related to what's pertinent for Coq.
There are a number of requirements in order to compile Satallax.
In short, you need make, ocaml, g++ and the zlib header files.
In Debian and derived Linux systems, you can get these from
the build-essential and zlib1g-dev packages. You need
ocamlopt to obtain a standalone executable.
If you're not the administrator of the computer on which you're installing,
you can quote the previous paragraph to the administrator.
* Short Instructions
cd minisat
export MROOT=`pwd`
cd core
make Solver.o
cd ../simp
make SimpSolver.o
cd ../../picosat-936
./configure
make
cd ..
./configure
make
./test | grep ERROR
./bin/satallax.opt is the native code executable to use.
See test for examples of how to use it.
* Long Instructions
STEP 1:
Compile minisat (see minisat/README)
cd minisat
export MROOT=<minisat-dir> (or setenv in cshell)
cd core
make Solver.o
cd ../simp
make SimpSolver.o
cd ../..
STEP 2 (Optional. Only needed to extract proof information for proof terms.) :
Build picosat (including picomus):
cd picosat-936
./configure
make
cd ..
STEP 3:
If desired, edit the configure script to give the location of your picomus
and eprover executables. (If the executables are not found by the configure script,
you will need to give the location of the executables to satallax via the command line
options -P <picomus> -E <eprover> if they are needed.)
Run the configure script for Satallax.
./configure
STEP 4:
make
uses ocamlopt to make a standalone executable
./bin/satallax.opt
and uses ocamlc to make a bytecode executable
./bin/satallax
that depends on ocamlrun
STEP 5:
Test satallax using the examples in the script file:
./test
As long as you don't see a line with the word ERROR, it should be working.

asm/errno.h: No such file or directory

While building gcc, I get this error:
In file included from /usr/include/bits/errno.h:25,
from /usr/include/errno.h:36,
from ../.././gcc/tsystem.h:96,
from ../.././gcc/crtstuff.c:68:
/usr/include/linux/errno.h:4:23: error: asm/errno.h: No such file or directory
make[2]: *** [crtbegin.o] Error 1
make[2]: Leaving directory `/opt/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc'
I am building gcc 4.1 from source. I think I have to install build-essential. However installing that package in ubuntu 12.04 will automatically download and install gcc 4.6 and I don't want that.
Is there any other way?
I think the package you want is linux-libc-dev . I encountered this when building 32-on-64; so I needed linux-libc-dev:i386 .
This worked for me:
ln -s /usr/include/asm-generic /usr/include/asm
This worked for me:
sudo ln -s /usr/include/asm-generic /usr/include/asm
The reason being that what GCC expects to be called /usr/include/asm is renamed to /usr/include/asm-generic in some distros.
This fixed it for me.
sudo apt-get install linux-libc-dev:i386
This solved it for me on Debian 10, even though I was compiling with an LLVM-based compiler:
sudo apt install gcc-multilib
/usr/include/asm/errno.h is part of the linux headers. I can't speak directly to Ubuntu 12.04, but in general you can download the linux sources as a package for your distro and it shouldn't require you to download/install gcc. Failing that, you can manually download the linux headers for the version of your kernel (uname -a) and use an include directive to CFLAGS to specify the directory to look for those.
Edit: sudo apt-get install linux-headers-generic may work for you.
You are missing part of the development packages. I don't know Ubuntu, but you should be able to ask it's package management system to install the package containing /usr/include/asm/errno.h.
Do not copy some file with a similar name from somewhere on your system (or, even worse, from somewhere else). Missing files might mean that some package is damaged; again, ask your package manager to check everything and (re)install missing/broken pieces.
Unless you are running some LTS release, upgrade. Your Ubuntu is some 2 years old, i.e., ancient.
While we are at this, why on this beautiful planet are you building such an ancient compiler? Current GCC is just released 4.9.0, anything before 4.7 is ancient history, not longer supported.
On Ubuntu 16.04 x86_64 you could try this:
ln -s /usr/include/x86_64-linux-gnu/asm /usr/include/asm
This works on my server.
If you want to use errno.h that is in the asm file, simply go to /usr/(ctrl + l, type /usr/) and then search for errno.h and errno-base.h. Once you did find them, copy the code in these two files, and place them in your include folder. And be careful, in "errno.h" the file includes "errno-base.h" as:
#include <asm-generic/errno-base.h>
Either create a directory with the same name above or change the code above to something different which is suitable for you to use.
If you can find:
usr/include/asm-generic/errno.h
by executing:
find /usr/include -name errno.h
then try to execute:
cp --archive /usr/include/asm-generic /usr/include/asm
It may fix that problem.
I had this issue while compiling Asterisk 1.8.24.0 and solved it with:
mkdir /usr/include/asm-generic
cp /usr/include/asm/errno-base.h /usr/include/asm-generic/
Don't know if it is the "right way" but i've read the comments above and that gave me the idea... and it worked :)

Does anybody have a patch or a kludge trick so that I am able to cross-compile climm-0.6.4 with gnutls-2.12.5?

I am trying to cross-compile climm-0.6.4 to windows under Ubuntu with the following command:
./configure --host=i686-pc-mingw32 --enable-ssl=gnutls
and I get this error message:
**checking for libgnutls-config... no
checking for libgnutls - version >= 0.8.8... no
*** The libgnutls-config script installed by LIBGNUTLS could not be found
*** If LIBGNUTLS was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the LIBGNUTLS_CONFIG environment variable to the
*** full path to libgnutls-config.**
After some research on the Internet I found a hint here:
The package's ./configure script is trying to invoke libgnutls-config
and/or libgnutls-extra-config to search for the gnutls library. Newer
versions of gnutls do not ship these scripts anymore.
and I am using gnutls-2.12.5
Does anybody have a patch or a kludge trick so that I am able to cross-compile climm-0.6.4 with gnutls-2.12.5?
Thank you in advance!
cheers
Daniel
Try the --with-libgnutls-prefix=PFX option to the configure script telling where the library is.
Other option in to set the environment variable LIBGNUTLS_CONFIG to a program that outputs just the parameters you need to compile/link the library.
Update:
Try the following script, name it mygnutls_config:
#!/bin/bash
if [ "$1" == "--version" ]
then
shift
EXTRA="--modversion"
else
EXTRA=""
fi
pkg-config gnutls $EXTRA "$#"
And then
$ chmod a+x mygnutls_config
$ LIBGNUTLS_CONFIG=`pwd`'/mignutls_config' ./configure --enable-ssl=gnutls
note that for this to work you need pkg-config to detect the crosscompilation configuration, not the native one. So you may need the PKG_CONFIG_LIBDIR environment variable to point to the directory where the appropriate gnutls.pc file is.

Resources