LCC for the Gigatron. Take two.
Forum rules
Be nice. No drama.
Be nice. No drama.
Re: LCC for the Gigatron. Take two.
So far it only runs on Linux. For the time being, the best way to run it on Windows is to use Microsoft's Windows Subsystem for Linux, https://docs.microsoft.com/en-us/windows/wsl/about . WSL1 should be good enough. Long term we have to do better, but that's another story...
Re: LCC for the Gigatron. Take two.
I successfully built the Gigatron-LCC 1.0 compiler under Windows 10 using Cygwin64 !
(Packages: bison, byacc, gcc-core, python 3.8, GNU make 4.3)
However, i had to add the line
cygwin: ${B}rcc
at the end of the makefiles in the following directories
gigatron/libc/
gigatron/mapsim/
gigatron/mapconx/
Otherwise the build process stopped returning a "No rule to make target" error.
After extracting the patch https://github.com/axelb68/gigatron-lcc/tree/patch-1 to i.e. d:\glcc just start the cygwin64 terminal
and use cd ../../cygdrive/d/glcc. If you now type make install the build process will install the compiler to the folder
C:\cygwin64\usr\local\lib\gigatron-lcc. It can now be used from any location inside the cygwin terminal.
The compiler works great - thanks Leon !
(Packages: bison, byacc, gcc-core, python 3.8, GNU make 4.3)
However, i had to add the line
cygwin: ${B}rcc
at the end of the makefiles in the following directories
gigatron/libc/
gigatron/mapsim/
gigatron/mapconx/
Otherwise the build process stopped returning a "No rule to make target" error.
After extracting the patch https://github.com/axelb68/gigatron-lcc/tree/patch-1 to i.e. d:\glcc just start the cygwin64 terminal
and use cd ../../cygdrive/d/glcc. If you now type make install the build process will install the compiler to the folder
C:\cygwin64\usr\local\lib\gigatron-lcc. It can now be used from any location inside the cygwin terminal.
The compiler works great - thanks Leon !
Re: LCC for the Gigatron. Take two.
Amazing. I thought that it would have required more work. I am surprised by this cygwin: rule to add to the make files. Is it a known cygwin thing?
- Leon
Ps1: please send me a pull request..
Ps2: At67 suggests to switch the build system to cmake, which would certainly open possibilities…
- Leon
Ps1: please send me a pull request..
Ps2: At67 suggests to switch the build system to cmake, which would certainly open possibilities…
Re: LCC for the Gigatron. Take two.
@axelb Great stuff!
@lb3361 CMake would solve a lot of your non Linux build issues.
@lb3361 CMake would solve a lot of your non Linux build issues.
Re: LCC for the Gigatron. Take two.
This is my pull request for the Cygwin build: https://github.com/lb3361/gigatron-lcc/pulls .
It is also sufficient to change the ${B}rcc entries in these makefiles to ${B}rcc.exe without an additional rule !
Maybe the rule just changes the way how a missing extension is treated under Cygwin...
It is also sufficient to change the ${B}rcc entries in these makefiles to ${B}rcc.exe without an additional rule !
Maybe the rule just changes the way how a missing extension is treated under Cygwin...
Re: LCC for the Gigatron. Take two.
I found in the cygwin doc that some of the libc calls such as stat() basically try adding a .exe extension. Other calls such as readdir() do not show an extension-less file whenever a .exe is present. I guess the patch changes which api calls are used by make to assert the existence of ${B}rcc. This seems very fragile and could break under mingw for instance.
The correct solution would be to replace ${B}rcc by ${B}rcc${E} everywhere, do the same for all other executables, and make sure that E is .exe on Windows and empty on other platforms.
It seems that one can do that by testing the existence of the COMSPEC environment variable. Do you see such a variable when you type 'env' under cygwin?
The correct solution would be to replace ${B}rcc by ${B}rcc${E} everywhere, do the same for all other executables, and make sure that E is .exe on Windows and empty on other platforms.
It seems that one can do that by testing the existence of the COMSPEC environment variable. Do you see such a variable when you type 'env' under cygwin?
Re: LCC for the Gigatron. Take two.
I have tentatively changed all the Makefiles to be aware of .exe suffixes.
See https://github.com/lb3361/gigatron-lcc/ ... 49cb5d6c7a
See https://github.com/lb3361/gigatron-lcc/ ... 49cb5d6c7a
Re: LCC for the Gigatron. Take two.
Under cygwin>env i found COMSPEC=C:\windows\system32\cmd.exe.
Using your latest approach I again got the "No rule to make target"-error.
However, everything works fine when changing the main makefile to
ifdef COMSPEC
EX=.exe
else
EX=
endif
replacing E= to EX= and ${E} to ${EX} in this and the other makefiles.
I assume ifdef $(COMSPEC) was just a typo and the variable E might be used elsewhere...
Using your latest approach I again got the "No rule to make target"-error.
However, everything works fine when changing the main makefile to
ifdef COMSPEC
EX=.exe
else
EX=
endif
replacing E= to EX= and ${E} to ${EX} in this and the other makefiles.
I assume ifdef $(COMSPEC) was just a typo and the variable E might be used elsewhere...
Re: LCC for the Gigatron. Take two.
I understand the comspec part but not the ex part and I really would like to know why things work. This probably means I need to setup a cygwin environment and test..
Update 1: I just installed a fresh cygwin distribution and was able to compile all with just the ifdef COMSPEC change. I had no need to rename variable E as EX. I am using gnu-make-4.3 and gcc-11.2. The test suite ran fine. Now I would like to know whether I can do the same with mingw.
Update 2: I also managed to compile with mingw and produce executables that only require the python launcher "py" to be installed. The attached zip contains binaries intended to be installed in c:\gigatron-lcc. If you install elsewhere, you need to patch the paths in the two bat files glcc.bat and glink.bat located in the bin directory. Seems to work. No guarantees.
Update 1: I just installed a fresh cygwin distribution and was able to compile all with just the ifdef COMSPEC change. I had no need to rename variable E as EX. I am using gnu-make-4.3 and gcc-11.2. The test suite ran fine. Now I would like to know whether I can do the same with mingw.
Update 2: I also managed to compile with mingw and produce executables that only require the python launcher "py" to be installed. The attached zip contains binaries intended to be installed in c:\gigatron-lcc. If you install elsewhere, you need to patch the paths in the two bat files glcc.bat and glink.bat located in the bin directory. Seems to work. No guarantees.
- Attachments
-
- gigatron-lcc-1.0.9-win32.zip
- (1.22 MiB) Downloaded 220 times
Re: LCC for the Gigatron. Take two.
Changing back to E as a variable name now also works fine on my side . Thank you for the clarification!