Building latest GCC on Windows

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
rdos
Member
Member
Posts: 3306
Joined: Wed Oct 01, 2008 1:55 pm

Building latest GCC on Windows

Post by rdos »

I've struggled with Cygwin, trying to build latest GCC, but I cannot build one of the three required libraries with Cygwin (MPC).

Unless there is some solution for this that I've been unable to find, it would leave two possibilities:

1. Install a Linux dual-boot on my development machines
2. Install Linux in VirtualPC

The first setup have the obvious drawback that I need to reboot from time to time since my other tools doesn't work on Linux, while the second option probably doesn't work to build GCC since running Linux in an emulator while building GCC would be a real pain.

Ideas?
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Building latest GCC on Windows

Post by bluemoon »

rdos wrote:running Linux in an emulator while building GCC would be a real pain.
Not quite if you have an average, recent computer, I'm running VMWare Player in office with core i5, 8GB RAM machine, I gave the linux VM 4GB RAM and it run everything pretty fine - sure you should't encode video or run Photoshop inside the VM, but building gcc is within acceptable speed(less than ten minutes).

Note that some linux distribution demand more resource than other, for instant, I wouldn't run CentOS in a VM.

By the way, if you absolutely want to run on windows, have you tried MinG?
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: Building latest GCC on Windows

Post by xenos »

Just out of curiosity: Which tools are you using that require Windows? Is there no alternative for these tools on Linux?
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Re: Building latest GCC on Windows

Post by jnc100 »

Could you not just install the libmpc-devel package from cygwin? AFAIK gcc requires the mpc, mpfr and gmp libraries to be compiled for the host (which I assume in this case is cygwin) rather than the target?

Regards,
John.
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Building latest GCC on Windows

Post by iansjack »

I'm guessing that you haven't actually tried Linux in a VM. I do almost all my development work that way; compiling GCC is a breeze. VMs are only really slow when it comes to graphics; as far as processing goes they are not that much slower than the native machine.
rdos
Member
Member
Posts: 3306
Joined: Wed Oct 01, 2008 1:55 pm

Re: Building latest GCC on Windows

Post by rdos »

I did try to build OpenWatcom from source in virtual XP within Windows 7, and it took almost forever, which is why I think that building GCC that way would take too long. But you are right, I've not tried it.

Another possibility (at least at home), is to use one of my portable PCs that has a dual-boot between Linux and RDOS (but no Windows installed). The problem is that the executables built on Linux then must be moved to some Windows machine, and I have not managed to configure Linux samba-server so I can exchange files between Windows and Linux. OTOH, I could also move the RDOS executables generated to the FAT-partition, and test them directly on RDOS (or download them through RDOS FTP-server). At work, I have no Linux installation, but maybe I could install that on my portable there as well as a tripple-boot.
rdos
Member
Member
Posts: 3306
Joined: Wed Oct 01, 2008 1:55 pm

Re: Building latest GCC on Windows

Post by rdos »

XenOS wrote:Just out of curiosity: Which tools are you using that require Windows? Is there no alternative for these tools on Linux?
I use OpenWatcom IDE, but I know that at least the command-line tools should be available on Linux, but I have not tested them. In addition to that, I also need my binary builder tool, which I only have for target Win32 and RDOS, but I suppose I could build it on Linux if I provide enough of the needed classes it relies on (primarily a file-class).
rdos
Member
Member
Posts: 3306
Joined: Wed Oct 01, 2008 1:55 pm

Re: Building latest GCC on Windows

Post by rdos »

jnc100 wrote:Could you not just install the libmpc-devel package from cygwin? AFAIK gcc requires the mpc, mpfr and gmp libraries to be compiled for the host (which I assume in this case is cygwin) rather than the target?
I tried to download the source for all three libraries. GMP built easily. MPFR failed on an old Cygwin, but built on the newest release. MPC doesn't build on Cygwin. I downloaded several versions, but none of them built. I think the problem is related to Cygwin using DLLs for some of these, and that something is misconfigured in MPC.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: Building latest GCC on Windows

Post by Brynet-Inc »

You don't need to build mpc/mpfr/gmp yourself, just install the binaries using whatever package management system Cygwin provides, they've likely patched it to work in that environment.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
rdos
Member
Member
Posts: 3306
Joined: Wed Oct 01, 2008 1:55 pm

Re: Building latest GCC on Windows

Post by rdos »

Brynet-Inc wrote:You don't need to build mpc/mpfr/gmp yourself, just install the binaries using whatever package management system Cygwin provides, they've likely patched it to work in that environment.
Not so. Cygwin doesn't provide them, and uses an old GCC version that doesn't require them.
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: Building latest GCC on Windows

Post by Kazinsal »

Run some flavour of Linux in VirtualBox, and make sure hardware virtualization is on. Compiling GCC through that method on my quad-core i7 takes about twenty minutes. And MPC/MPFR/GMP are available as packages that work right out of the box.

Even if the packages you need are available for Cygwin, I guarantee you that Linux in VBox will be about ten times faster. Not hyperbole.
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Re: Building latest GCC on Windows

Post by jnc100 »

rdos wrote:
Brynet-Inc wrote:You don't need to build mpc/mpfr/gmp yourself, just install the binaries using whatever package management system Cygwin provides, they've likely patched it to work in that environment.
Not so. Cygwin doesn't provide them, and uses an old GCC version that doesn't require them.
If you run the cygwin setup.exe, you should be able to install 3 packages: libmpc-devel (ver 0.8 ), libmpfr-devel (ver 3.0.1) and libgmp-devel (ver 4.3.2) - version numbers correct as of today. You do not have to build these from source. You should then be able to configure and build gcc without issue.

Regards,
John.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Building latest GCC on Windows

Post by AJ »

Yup - the wiki articles on building those libraries were added rather hurriedly by me when they were added as GCC dependencies. As jnc100 says, they are now all available from the Cygwin installer under the lib[x]-devel packages.

Cheers,
Adam
rdos
Member
Member
Posts: 3306
Joined: Wed Oct 01, 2008 1:55 pm

Re: Building latest GCC on Windows

Post by rdos »

OK, now I found the required libraries, and I was able to successfully build the GCC cross-compiler with the 4.7.2 source tree for RDOS. Great!
=D>
Post Reply