alpha
alpha

Reputation: 43

How to install GCC Cross Compiler (ix86) on Cygwin

Are there any packages available in Cygwin as cross compile toolchain for Linux-i386-elf. I am unable to find any while installing cygwin packages. But here, while anwering this question, it says that it is available.

However, Cygwin has no package corresponding to linux-*-gcc-* in Devel category

If anyone has any idea. please let me know.

Upvotes: 1

Views: 1265

Answers (1)

Doug Henderson
Doug Henderson

Reputation: 898

The cygwinports.org mirror no longer contains the extra packages, i.e., those that are not part of the official cygwin.org packages.

These extras are now only available in the cygports-extras project on Github. See e.g. https://github.com/cygwinports-extras/linux-x86_64-gcc. You should be able to download, or clone this repo into /usr/src or something similar in the cygwin install tree. This will let you build a cross-compiler that runs in cygwin and targets the X86-64 architecture on the linux os. It currently has patches for and will build GCC 4.8.2 because it has not been updated since August 2015. There are a lot of other packages you will need for a complete cross-compiler tool chain and runtime. Then, if you need a more recent version of the compiler, you will need to develop any patches needed to make more recent versions of these package work.

That sounds like a lot of work. A much easier solution is to download a virtual machine, such as Virtual Box from https://www.virtualbox.org/. Install a minimal linux from an ISO image or download a prebuilt virtual disk with the os and software you need. VBox runs nicely on a Win7 or Win10 machine. You won't need a huge virtual disk, just enough for the os, the gcc compiler tool chain and a bit of work space. You can fiddle with the settings to get it working seamlessly with windows, or just let it run a console or the linux desktop in a window.

You could also look at the Windows Subsytem for Linux (WSL) that runs on Win10. I have not used it, but I think you can install a Ubuntu system with access to all the packages available for Ubuntu.

HTH
Doug

Upvotes: 1

Related Questions