How can I cross compile an arm linux target project on windows? - linux

I want to use arm-linux-gnueabi-gcc on windows.
How can I get this toolchain to work on my windows 10 OS?

Related

Toolchain to crosscompile Applications for BBB

My native machine is ubuntu based 14.04 LTS x86_64 system, I want to cross-compile applications and QT programs for Beaglebone black, which is an armv7 based system running on Debian 2015 distribution.
Which toolchain I should install on my native system, to get this done?
Here is a very usefull link how to set up the crosscompiler, uboot, kernel and the filesystem for a beaglebone black.
If you only want to crosscompiler, then just follow the few code lines in the Crosscompiler chapter
https://eewiki.net/display/linuxonarm/BeagleBone+Black
To cross-compile applications you need to use the ' arm-linux-gnueabihf ' compiler in the Ubuntu. Ubuntu 14.04 LTS was released with gcc-4.8.2. It is really important that the version of this GCC compiler matches the version deployed on the beaglebone black image. The reason for this is that different compilers have different libc versions, and version mismatching causes linker errors that are very tricky to solve.
You can try running,
gcc --version
on both your native Ubuntu system and the Beaglebone Black and see if the gcc version matches. If yes, you are good to go. Otherwise, install the appropriate toolchains.

Linux cross-compiler for Cygwin -- not able to find the Linux Cygwin compiler tool chain online

I have installed Cygwin and followed the necessary steps to install the right packages to allow for Linux cross-compilation on Windows.
More info on procedure here Compiling Linux binaries (x86/x86-64) under Windows
However, I am not able to obtain the actual Linux compiler tools from the source above, or anywhere online (after hours of searching). The download to the Linux cross-compiler for Cygwin points to Metamod-P, I wonder what Metamod-P is.
How or where can I get the required Linux cross-compiler for cygwin?
The Cygwin Ports repository contains cross-compilers for i686, x86_64, armv7hl, and aarch64 GNU/Linux targets. Look for the linux-*-gcc-* packages under the Devel category.

Install a GCC ARM Embedded toolchain

I would like to load a very simple, hello world program, on an Embedded ARM processor. For this, I would like to install a toolchain in order to cross compile my code. I am currently working on a 64-bit Linux OS. Does anyone know of a GCC ARM embedded toolchain that I can download? I've downloaded a pre-built version of Linaro GCC but it only runs on a 32-bit Linux machine and I can't install the ia32-libs package because my Linux machine has no internet connection.
The gcc-arm toolchain I'm using for ARM Cortex-M processors can be found here-
https://launchpad.net/gcc-arm-embedded
It also builds for Cortex-A targets, which should cover the majority of embedded ARM systems.
You can download standalone distributions for many operating systems, including linux.
There are also 64bit builds of Linaro toolchain here. Just download the x86_64 and not the i686 version.

Compiled gcc4.4.6 on one machine, how to let another machine use it?

I built gcc 4.4.6 (to use CUDA) on a fast server, it takes about 10 min. However, on my own desktop, it takes kinda for ever to compile.
So both machines are 64 bit Linux, although 1 is Ubuntu while the other is Arch Linux. Arch Linux has new kernel version.
So on the server, I installed the built gcc-4.4.6 to /opt. And I just copy /opt/gcc-4.4.6 to my PC's /opt/gcc-4.4.6.
em, seems like it doesn't quite work, when I tried
./x86_64-unknown-linux-gnu-gcc ~/Development/c/hello/hello.c
it shows
x86_64-unknown-linux-gnu-gcc: error trying to exec 'cc1': execvp: No such file or directory
So what can I do now?
Thanks,
Alfred
If the systems are similar enough, you could compile GCC on the big machine (don't forget that GCC needs to be configured and built in a directory outside of its source tree), then run make -j3 all and then make install DESTDIR=/tmp/gccinst/ and copy that /tmp/gccinst directory to your small machine, and finally copy it into the root filesystem (on the small machine).
However, GCC 4.4.6 is quite old today, if you are compiling GCC try to compile GCC 4.6.2 (or 4.6.1 at least).
And (shameless plug for my work) if you compile a GCC 4.6, please enable plugins on it, then you might try the GCC MELT [meta-] plugin (MELT is a high level domain specific language to ease the development of GCC extensions).

Which cross compiler?

What is the difference between
MinGW cross compiler and
GCC Cross compiler.
Which one used in which operating system?
I need to create an EXE file in the Linux operating system using Qt, hence which is the cross compiler to be used?
MinGW is a GCC cross compiler for Windows environments. (There are multiple GCC cross compilers for various different targets.)
To compile Windows executables on your Linux box, you want a MinGW install for your distribution of Linux.
If you're running
Debian, you want http://packages.debian.org/lenny/mingw32 (apt-get install mingw32)
Ubuntu, you want http://packages.ubuntu.com/jaunty/mingw32 (apt-get install mingw32)
Red Hat Linux or CentOS, you want several of the MinGW packages from http://download.fedora.redhat.com/pub/epel/5/i386/repoview/M.group.html (see EPEL how-to then yum install mingw32-binutils and mingw32-gcc-g++ at minimum)
Gentoo, see http://www.gentoo-wiki.info/MinGW
openSUSE, then you can find builds at http://download.opensuse.org/repositories/CrossToolchain:/mingw/
MingW32 is a port of GCC with "win32 target".
There are two architecture in a cross-compiler: host and target. The host is the platform the compiler run on; the target is what the result code will run.
Assume you are using Ubuntu, you can see the package here.
MinGW is basically a port of GCC and related tools, allowing them to run natively on Windows machines.
Cross compiling is the act of using a compiler on one operating system/architecture to generate a binary/EXE/DLL/object that is compatible with another operating system/architecture. Basically, you ask the compiler to generate assembly and startup routines for something other than the host OS's default.
If you were on a Linux machine, you'd use GCC to compile it for the Linux machine... If you were on a Windows machine, you'd use MinGW, but with flags to tell it to compile for the Linux machine's specifications.
GCC is usually used in Linux.. MinGW is just a Windows port of GCC to compile source to EXE files.

Resources