How do I cross compile gcc on Linux for Windows? I didn't find much help online

How do I cross compile gcc on Linux for Windows? I didn't find much help online...
I can cross compile programs for Windows on Linux, but I want to have gcc available in Windows without Cygwin shit.
Pic unrelated.

Shameless bump

>I want to have gcc available in Windows without Cygwin shit.
Tough fucking tits.

you can use msys, but it's pretty much like cygwin.

How can it be that difficult? It can be compiled for a completely unknown and unsupported platform, such as your own toy OS, how the fuck is it that difficult to build it under an UNIX environment?

>how the fuck is it that difficult to build it under an UNIX environment?
Windows isn't a UNIX environment....

windows is NOT a *nix flavor

Compile under a UNIX environment, not for one

also explain this image OP, the fuck is it even trying to say?

It's very straightforward. The number 10 can be interpreted as any number but 0, depending on the base.

It’s a pun on numerical representation of integers.

wow, I think I'm retarded, i had to think too hard about that, probably just gonna go burn myself with my degree as kindling

I don't even understand what you're trying to say anymore. But no, you can't compile GCC on Windows unless you run something like Cygwin.

You can, however, use MinGW, which is a "minimalist GNU compiler for windows"

You wouldnt call 2 a 10 in base 2. I dont get it

I think MinGW (and MinGW-W64) is more or less that, look into how they did it. Regular hello world style C/C++ programs are difficult enough to compile for multiple platforms, good luck porting something the size of gcc.

Are you serious, bud?

I know that. It doesn't matter where you're compiling gcc as long as you're cross compiling it to target Windows. You should be able to cross compile gcc for Windows under Linux or MingW or Cygwin.

Windows 10 doesn't have this problem.

if you use base 10 i use base 22 to you

Let's count in base 2.
0
1
10
Yeah, 2 (decimal) is 10 in base 2

the value 2 is most certainly dicated "10" in binary

You would, though. Also, it's a comic: they might not be saying it the way you're saying it in your head. (i.e. "one zero" instead of "ten")

I'm pretty sure means firing up a Linux machine, downloading the source of gcc, and compiling it in a way that a Windows .EXE (which runs without any other dependencies like cygwin.dll) is the output.

Touché

Just use Bash for windows?

this. what are you trying to accomplish by compiling gcc on windows? if this is just some weird exercise, you should probably just spend your time learning about ABIs and how a binary is actually executed on a machine. If this is for some dev purposes, god bless your sould, I'd want nothing to do with whatever you're attempting to do.

That still produces Linux binaries, not Windows

>Windows 10
Just use a headless VM with SSH.

It's more of an exercise than anything else. I'd like to be able to seamlessly compile C programs in Windows. Is really using MinGW and emulating a UNIX environment the only sane way to do it?

I'm not 100% sure on this, but I think the point of MinGW is that it creates native binaries with Windows API calls instead of using Cygwin/MSYS to emulate everything. If you just want to have a compiler (gcc) on Windows that spits out .exe-s that can run on a brand new Windows machine without anything else, MinGW should be good for that.

Using it to compile existing projects written with Linux and only Linux in mind, that's a different story.

Yeah, which is what he was asking for...

to answer your question OP you take your code that you've written and put it in visual studio or some window's compiler.
this is where portability is key. if you didn't write portable code then you'll be twiddling with dumb shit getting both versions to compile.

>I think the point of MinGW is that it creates native binaries with Windows API calls instead
Bingo

> If you just want to have a compiler (gcc) on Windows that spits out .exe-s that can run on a brand new Windows machine without anything else, MinGW should be good for that.
Even the Linux version of MinGW can create binaries for Windows.

You can use MinGW on Linux to compile software for Windows (on Linux).

Oh yeah, I forgot you can use it on Linux too.

mingw32-gcc

If you manage to actually do so, come back and tell me because I refuse to use fucking msvc for compiling qt projects.

yes.
like stated, go learn about what a binary interface is, how it relates to compilers and the architecture it executes on. read up on ELF to start and go from there. Do you know what a kernel is, or the difference between user/kernel space? there are a lot of bigger questions that if you knew more about, you'd realize why this exercise is pretty pointless. there really isn't much of value for you to learn here judging by most of this thread, go read a systems book OP

I still remember posting cancerous jokes and memes like that back when I first got into programming.