• HomeBoards
  • RulesRules
  • HelpHelp
  • WikiWiki
  • Donate

Author Topic: GCW-Zero toolchain on Windows using WSL  (Read 10387 times)

phlogios (OP)

  • Posts: 12
GCW-Zero toolchain on Windows using WSL
« on: September 27, 2016, 10:06:27 am »
I thought I'd document my progress trying to build a program for GCW Zero using the new built-in Ubuntu subsystem in Windows 10, as a replacement for dmitry_smagin's cygwin toolchain, which can be found here: http://boards.dingoonity.org/gcw-development/gcw-zero-toolchain-for-windows-(cygwin)-2013-10-04/

Why?
So you can develop your game or app using an IDE of your choice, under Windows, like Visual Studio, Visual Studio Code or CLion. When it's time to compile to GCW0, open the new Bash, cd to your project folder ( /mnt/c/projects or wherever you put your code ) and compile it from there.

It is doable, but:
The regular toolchain will not work
https://github.com/Microsoft/BashOnWindows/issues/390
WSL currently does not support running x86 executables, so the GCC compiler will fail. This can probably be solved by compiling the toolchain to amd64 - I had limited success yesterday trying to compile with a toolchain that was sent to me by com64 on the IRC. It succeeded with the compilation of a simple hello world program, but failed to link SDL due to absolute paths in the toolchain I used. I suspect that if I compile my own toolchain, this issue will disappear.

EDIT:
It works with a 64-bit toolchain. Forum user pcercuei compiled one and posted a link further down in this thread.
Just download the tar.bz2 file, untar it in Bash, and place the resulting folder inside /opt/ and you should be good to go!
« Last Edit: September 30, 2016, 10:21:12 am by phlogios »

pcercuei

  • Posts: 1708
    • My devblog
Re: GCW-Zero toolchain on Windows using WSL
« Reply #1 on: September 27, 2016, 04:55:02 pm »
So the C: drive appears as /mnt/c ?
I can compile a 64-bit toolchain that defaults to c:\gcw0-toolchain (/mnt/c/gcw0-toolchain) if you want.

phlogios (OP)

  • Posts: 12
Re: GCW-Zero toolchain on Windows using WSL
« Reply #2 on: September 27, 2016, 05:50:52 pm »
For me it would be fine if it points to /opt/gcw0-toolchain
The issue I had earlier was that --print-sysroot gave me an absolute path to some other dude's home folder instead of /opt/gcw0-toolchain/...

If you would like to compile a 64-bit toolchain for me that works exactly like the one hosted on the gcw-zero website, that would be great :) If not, I will attempt to compile it when I have time :)

And yes, the C: drive appears automatically as /mnt/c, I wrote that because I assume that a Windows user will want to have his/her project somewhere in the Windows drive rather than "hidden" in the Ubuntu subsystem.

dmitry_smagin

  • Posts: 423
Re: GCW-Zero toolchain on Windows using WSL
« Reply #3 on: September 28, 2016, 09:05:23 am »
@phlogios
Have you heard of FLINUX?
https://c9.io/yunyuaner1/flinux

It allows to run linux binaries on Win7/8/10/whatever and doesn't depend on Win10 new subsystem. GCW-Zero's toolchain is confirmed to work.
GCW-Zero prototype, Dingoo a320, Ritmix rzx-50, Dingoo a380, Xperia Play

pcercuei

  • Posts: 1708
    • My devblog
Re: GCW-Zero toolchain on Windows using WSL
« Reply #4 on: September 29, 2016, 12:52:15 pm »
I made an updated toolchain:
https://app.box.com/s/sussp6gozd5gx2ea20amtrzqse8sui45

It has GCC 6 (vs. GCC 4.9) and is 64-bit.
It should be placed inside /opt.

phlogios (OP)

  • Posts: 12
Re: GCW-Zero toolchain on Windows using WSL
« Reply #5 on: September 29, 2016, 02:43:20 pm »
Cool! I will try it as soon as I get home!

If this toolchain works, should it be hosted somewhere permanently as an official 64-bit release?

pcercuei

  • Posts: 1708
    • My devblog
Re: GCW-Zero toolchain on Windows using WSL
« Reply #6 on: September 29, 2016, 04:15:03 pm »
If this toolchain works, should it be hosted somewhere permanently as an official 64-bit release?
I don't think so, it's not been tested at all.

phlogios (OP)

  • Posts: 12
Re: GCW-Zero toolchain on Windows using WSL
« Reply #7 on: September 30, 2016, 10:19:05 am »
Thanks pcercuei! It worked for me!

Borland

  • Posts: 1
Re: GCW-Zero toolchain on Windows using WSL
« Reply #8 on: April 06, 2020, 05:04:09 pm »
Thanks for the toolchain pcercuei  :)
I was wondering if you or anyone else could tell me how to add sdl2_gfx to the toolchain as it's not included? Have searched a lot since yesterday but can't get it to work.

bangity

  • Posts: 4
Re: GCW-Zero toolchain on Windows using WSL
« Reply #9 on: June 21, 2020, 06:24:10 pm »
Hello, I am getting this error compilation of PCSX4ALL

Code: [Select]
Compiling src/recompiler/mips/recompiler.cpp...
In file included from src/recompiler/mips/opcodes.h:4:0,
                 from src/recompiler/mips/recompiler.cpp:375:
src/recompiler/mips/rec_mdu.cpp.h: In function ‘void recDIV()’:
src/recompiler/mips/rec_mdu.cpp.h:354:58: error: invalid operands of types ‘__gnu_cxx::__enable_if<true, double>::__type {aka double}’ and ‘__gnu_cxx::__enable_if<true, double>::__type {aka double}’ to binary ‘operator&’
    bool rt_pot = (rt_val != 0x80000000) && ((abs(rt_val) & (abs(rt_val) - 1)) == 0);
                                              ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
Makefile.gcw0:234: recipe for target 'obj/recompiler/mips/recompiler.o' failed
make: *** [obj/recompiler/mips/recompiler.o] Error 1

slaanesh

  • Posts: 569
    • Slaanesh Dev
Re: GCW-Zero toolchain on Windows using WSL
« Reply #10 on: August 05, 2020, 12:56:06 am »
I'm in the process of converting all my toolchains to Linux where possible.
I used to use the Cygwin toolchain but have started using this instead and can report that everything seems fine so far.

geniot

  • Posts: 2
Re: GCW-Zero toolchain on Windows using WSL
« Reply #11 on: March 17, 2021, 12:14:29 am »
I made an updated toolchain:
https://app.box.com/s/sussp6gozd5gx2ea20amtrzqse8sui45

It has GCC 6 (vs. GCC 4.9) and is 64-bit.
It should be placed inside /opt.
I can confirm I was able to modify and compile Unreal Speccy Emulator on LXLE Linux 18.04.3 64bit using your toolchain build. Thanks a lot. I'm planning to add dynamic key mapping to some PC emulators.
https://github.com/DavidKnight247/Unreal-Speccy-Emulator-GCW0-Edition

Update: actually I had to download https://github.com/Ninoh-FOX/toolchain . The toolchain at the link https://app.box.com/s/sussp6gozd5gx2ea20amtrzqse8sui45 - I could compile on 64 but at runtime received ref not found.
« Last Edit: March 19, 2021, 10:51:22 am by geniot »

 

Post a new topic