- How to start using arm-linux-gcc in Cygwin
- Details of the question (mostly written before 2018/3/2)
- Install the ARM cross compiler toolchain on your Linux PC
- Install the Cross Compilers, utilities, etc.
- Try the cross C compiler
- Try the cross C++ compiler
- Related products
- Configure arm linux gcc
- Next, the installation method of the two ARM-Linux-GCC cross-compilation tool chain:
- method one:
- Method Two:
- Note: Some of the above steps still cannot use ARM-Linux-GCC, the error shown below:
How to start using arm-linux-gcc in Cygwin
The problem was that it told me file cygcloog-0.dll is missing. I don’t understand what is going wrong. Based on simple searching, cygcloog-0.dll may be part of cygwin. Is it true? Or maybe it’s just because the ARM Linux Toolchain I got is too old to be compatible with Cygwin today? Then where can I get ARM Linux Toolchain for Cygwin?
To be honest, I thought it would be an easy question. But it turns out that maybe not many people are using Cygwin. Is it really that hard to do it on Cygwin, that, I should install Linux?
Details of the question (mostly written before 2018/3/2)
I want to do cross compiling so I downloaded ARM Linux Toolchain for Cygwin from SourceForge.net. But I can’t find any offical downloads and manual about that. So I’m not sure how to install and use arm-linux-gcc in Cygwin.
The first part is how to install. This is what I’ve done so far.
- I extracted the downloaded arm-linux-toolchain-cygwin-2010q1.tar.bz2 file under windows system (say Z:\ ). So folder Z:\arm-linux is created.
- Then I opened Cygwin and added the environment path Z:\arm-linux\bin by typing declare -x PATH=$PATH:/cygdrive/z/arm-linux/bin in Cygwin’s Bash command.
- Then I type arm-linux-gcc -v and it seems ok. The output is
$ arm-linux-gcc -v Using built-in specs. Target: arm-linux Configured with: /home/stargaze/gcc-4.4.3/configure --enable-languages=c,c++ --build=i686-pc-cygwin --disable-libmudflap --disable-libssp --disable-libgomp --disable-libstdcxx-pch --enable-__cxa_atexit --enable-symvers=gnu --enable-clocale=gnu --enable-c99 --enable-long-long --with-dwarf2 -v --target=arm-linux --prefix=/opt/arm-linux --disable-shared --disable-threads --with-gcc --with-gnu-as --with-gnu-ld --enable-interwork --enable-multilib --with-sysroot=/opt/arm-linux/sysroot --disable-nls Thread model: single gcc version 4.4.3 (GCC)
- But when I tried to get more information typing arm-linux-gcc —target-help , I was told that a dll file is missing
$ arm-linux-gcc --target-help Z:/arm-linux/libexec/gcc/arm-linux/4.4.3/cc1.exe: error while loading shared libraries: cygcloog-0.dll: cannot open shared object file: No such file or directory
The cygcloog-0.dll should be a missing file of Cygwin.
That’s all I’ve done so far to install. I’m not sure whether that’s all the install process.
Part 2, how to use arm-linux-gcc . I didn’t do further testing because I don’t know how to use arm-linux-gcc yet.
EDIT: After @matzeri ‘s reply, I followed his instruction and it works. So I can find the manual of arm-linux-gcc now. It is the arm-linux-gcc.1 file. His instruction is cd /cygdrive/z/arm-linux and man man/man1/arm-linux-gcc.1 . It is the same as my operation which is declare -x PATH=$PATH:/cygdrive/z/arm-linux/bin and man arm-linux-gcc . I was asking because I thought there was something wrong. Now I’m sure there’s nothing wrong.
Install the ARM cross compiler toolchain on your Linux PC
This article illustrates how to install on a Linux PC the complete toolchain to cross compile the Linux Kernel, device drivers and applications for the Acme Systems Linux board.
This procedure has been tested on: Ubuntu 18.04.4 LTS and Debian Buster 10
Install the Cross Compilers, utilities, etc.
Install the GCC, G++ cross compilers and support programs by typing:
sudo apt update sudo apt install libc6-armel-cross libc6-dev-armel-cross binutils-arm-linux-gnueabi libncurses5-dev build-essential bison flex libssl-dev bc
If you are using an Acqua or RoadRunner board:
Now you are ready to cross-compile on your PC all the source available for the Acme Boards based on Microchip MPUs.
Try the cross C compiler
Let’s try to cross compile a Hello World example in C and running it on an Acme board.
#include "stdio.h" int main(void)
Compile it by typing, if you are using an Arietta, Aria or FOX G20 board:
or, if you are using an Acqua or RoadRunner board:
As you can see we are using the ARM version of gcc just installed on your PC. It will generate an executable file for your Linux board.
Copy the executable file on the board via ssh:
Then open a command session on your board and run the example:
Try the cross C++ compiler
Let’s try to cross compile a Hello World example in C++ and running it on an Acme board.
#include "iostream" using namespace std; int main(int argc, char *argv[])
Compile it typing, if you are using an Arietta, Aria or FOX G20 board:
or, if you are using an Acqua or RoadRunner board:
As you can see we are using the ARM version of gcc just installed on your PC. It will generate an executable file for your Linux board.
Copy the executable file on the board via ssh:
Then open a command session on your board and run the example:
Related products
- CPU Microchip SAMA5D27
- Cortex A5 @ 500 MHz
- Very low power consumption:
396mW in full speed mode
198mW at Linux prompt
17mW in standby mode
10mW in suspend to RAM mode - Armhf architecture
- DDR3L RAM 256 MB
- QuadSPI 0/16/64/128MB
- Size: 40×30 mm
- Plug-in module
- 200 pins 0.4 mm pitch
- TFT parallel interface
- Boot from internal Quad SPI or external uSD/eMMC
- Linux Kernel 5.15 LTS
- Debian, Buildroot and Yocto
- Open source drivers
- Single Board Computer based on RoadRunner Linux SOM (Included)
- Classic «Credit Card» form factor
- Two USB Host 2.0 ports (one configurable as USB client on the USB-C connector)
- One 10/100 Mbit/s Lan port
- Two AcmeSensor ports
- Double placements for 2.54mm pitch 20×2 pinstrips (not soldered) for GPIOS, SPI, I2C, Serial etc ports
- All the circuitries you need to test the RoadRunner SOM
- USB host, USB device, Ethernet port, MicroSD socket
- Test points for power consumption measurements
- All the Roadrunner signals exposed on 2.54mm pitch pins
- On-board supercap for RTC and backup memory circuit
Configure arm linux gcc
Download address: https://pan.baidu.com/s/1xuh8m8bqhfzt_w6h4vrkeg
Extraction code: UK85
Next, the installation method of the two ARM-Linux-GCC cross-compilation tool chain:
(The method is from the network reprint possible to have a problem, the method is that I personally verify that there is no problem)
method one:
We all know that Ubuntu has a tool APT specifically used to install the software, we can use it to fully install the ARM-Linux-GCC.
This method is installed is the latest version. If you want to install a particular version of the unhefeited recommendation! Also pay attention to this need to use the domestic APT software source server, if this method is not, the method is used:
First, CTRL + Alt + T pop-up terminal, use the following command to install the ARM-Linux-GCC installation:
sudo apt-get install gcc-arm-linux-gnueabihf
Use the following command to make ARM-Linux-g ++ installation:
sudo apt-get install g++-arm-linux-gnueabihf
If you want to uninstall, use the following command to remove, the uninstall of the ARM-Linux-GCC:
sudo apt-get remove gcc-arm-linux-gnueabihf
sudo apt-get remove g++-arm-linux-gnueabihf
Method Two:
Install 64-bit cross-compilation tool, first download the installation package according to the download address provided above: ARM-Linux-GCC-4.6.4-ARM-X86_64.tar.bz2
1. First move the downloaded installation package to the TMP directory under the root directory (/ TMP)
2. Using the tar command to extract the installation package, you enter the following command in Terminal: (the front Sudo means executing this command using root privileges)
sudo tar -xjvf /tmp/arm-linux-gcc-4.6.4-arm-x86_64.tar.bz2 -C /
Note that the uppercase letter C, this command will extract the installation package to the OPT of the root directory (/ OPT / TuxamitosoftToolchains)
Look at the location of GCC-4.6.4, find GCC-4.6.4: / OPT / TuxamitosoftToolchains / ARM-ARM1176JZFSSF-Linux-Gnueabi
3. After the decompression is completed, create a new directory ARM in (/ usr / local), ie, enter the following command in Terminal:
After the creation of the ARM directory is successful, you need to give it to all permissions, that is, enter the following command in Terminal:
sudo chmod 777 /usr/local/arm
4. Find and copy the entire GCC-4.6.4 directory in the unzipped directory to the ARM directory, the command is as follows:
Pre-CD switch to GCC-4.6.4 «» After switching, look at the GCC-4.6.4 directory):
cd /opt/TuxamitoSoftToolchains/arm-arm1176jzfssf-linux-gnueabi/
Perform the CP copy command, -r represents the entire directory and anything inside
sudo cp -r gcc-4.6.4 /usr/local/arm
5. Open (/ etc / profile) Configure environment variables and library variables, the purpose is to use the cross compiler in any location, command as follows:
After opening with VI or VIM, add two rows in the file, and enter the following code: The first line is the environment variable of the execution program, the second line is the path of the library file.
- export PATH=$PATH:/usr/local/arm/gcc-4.6.4/bin
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/arm/gcc-4.6.4/lib
6. Use the Source command to reload the effectiveness of the configuration file
7. Check if the installation is successful, and enter the following command to output the version information in Terminal:
The result is as shown in the figure: Get the 4.6.6 version just installed
Just write a 1.c file, you can compile successfully explained perfect installation. E.g:
Then File Command Views the executable of the compiled is not ARM:
It can be seen that the compiled executable is running on the 32-bit ARM architecture.
Note: Some of the above steps still cannot use ARM-Linux-GCC, the error shown below:
This is to add two sentences as «/ etc / profile» in «.bashrc» in «.bashrc» in the «/ home / user name» directory.
- export PATH=$PATH:/usr/local/arm/gcc-4.6.4/bin
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/arm/gcc-4.6.4/lib
This «.bashrc» is a hidden file that requires a ls -a command to see! The username is your own Linux login account.
Also open it with VI or VIM, in the last addition two lines:
[email protected]:/usr/local/arm/gcc-4.6.4/bin$ sudo vim /etc/profile [email protected]:/usr/local/arm/gcc-4.6.4/bin$ sudo vim /etc/environment [email protected]:/usr/local/arm/gcc-4.6.4/bin$ [email protected]:/usr/local/arm/gcc-4.6.4/bin$ [email protected]:/usr/local/arm/gcc-4.6.4/bin$ cat /etc/environment PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/arm/gcc-4.6.4/bin:/usr/local/arm/gcc-4.6.4/lib" [email protected]:/usr/local/arm/gcc-4.6.4/bin$ cat /etc/profile # /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) # and Bourne compatible shells (bash(1), ksh(1), ash(1), . ). if [ "$" ]; then if [ "$" ] && [ "$BASH" != "/bin/sh" ]; then # The file bash.bashrc already sets the default PS1. # PS1='\h:\w\$ ' if [ -f /etc/bash.bashrc ]; then . /etc/bash.bashrc fi else if [ "`id -u`" -eq 0 ]; then PS1='# ' else PS1='$ ' fi fi fi if [ -d /etc/profile.d ]; then for i in /etc/profile.d/*.sh; do if [ -r $i ]; then . $i fi done unset i fi export PATH=$PATH:/usr/local/arm/gcc-4.6.4/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/arm/gcc-4.6.4/lib [email protected]:/usr/local/arm/gcc-4.6.4/bin$