简体   繁体   English

如何在Cygwin上安装GCC Cross Compiler(ix86)

[英]How to install GCC Cross Compiler (ix86) on Cygwin

Are there any packages available in Cygwin as cross compile toolchain for Linux-i386-elf . Cygwin中是否有任何软件包可作为Linux-i386-elf交叉编译工具链使用。 I am unable to find any while installing cygwin packages. 安装cygwin软件包时找不到任何东西。 But here , while anwering this question, it says that it is available. 但是在这里 ,在回答这个问题的同时,它说它是可用的。

However, Cygwin has no package corresponding to linux-*-gcc-* in Devel category 但是,Cygwin在Devel类别中没有与linux-*-gcc-*对应的软件包

If anyone has any idea. 如果有人有任何想法。 please let me know. 请告诉我。

The cygwinports.org mirror no longer contains the extra packages, ie, those that are not part of the official cygwin.org packages. cygwinports.org镜像不再包含额外的软件包,即那些不属于cygwin.org官方软件包的软件包。

These extras are now only available in the cygports-extras project on Github. 现在,这些附加功能仅在Github上的cygports-extras项目中可用。 See eg https://github.com/cygwinports-extras/linux-x86_64-gcc . 参见例如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. 您应该可以下载此仓库,或将其复制到/usr/src或cygwin安装树中的类似文件中。 This will let you build a cross-compiler that runs in cygwin and targets the X86-64 architecture on the linux os. 这将使您构建一个在cygwin中运行并针对linux操作系统上的X86-64体系结构的交叉编译器。 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. 它目前具有补丁程序,并将构建GCC 4.8.2,因为自2015年8月以来尚未进行更新。完整的交叉编译器工具链和运行时,您还需要许多其他软件包。 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/ . 一个更简单的解决方案是从https://www.virtualbox.org/下载虚拟机​​,例如Virtual Box。 Install a minimal linux from an ISO image or download a prebuilt virtual disk with the os and software you need. 从ISO映像安装最小的Linux,或使用所需的OS和软件下载预构建的虚拟磁盘。 VBox runs nicely on a Win7 or Win10 machine. VBox可以在Win7或Win10机器上很好地运行。 You won't need a huge virtual disk, just enough for the os, the gcc compiler tool chain and a bit of work space. 您将不需要巨大的虚拟磁盘,只需足够的操作系统,gcc编译器工具链和少量工作空间即可。 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. 您可以摆弄设置以使其与Windows无缝兼容,或者只是让它在窗口中运行控制台或linux桌面。

You could also look at the Windows Subsytem for Linux (WSL) that runs on Win10. 您还可以查看在Win10上运行的Linux的Windows子系统(WSL)。 I have not used it, but I think you can install a Ubuntu system with access to all the packages available for Ubuntu. 我没有使用过它,但我认为您可以安装Ubuntu系统,并可以访问可用于Ubuntu的所有软件包。

HTH HTH
Doug 道格

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM