-gen GCC

Forum for discussion about the documentation project.
Post Reply
DOS386
Posts: 798
Joined: Jul 02, 2005 20:55

-gen GCC

Post by DOS386 »

http://www.freebasic.net/wiki/wikka.php ... ilerOptgen
Note: the C emitter is a work in progress, incomplete, and certainly not bug free
http://www.freebasic.net/forum/viewtopi ... 50#p188550
Yea, -gen gcc can be used to rebuild fbc itself. In fact I consider -gen gcc more stable than the x86 ASM backend now, because of the unsolved bugs in the ASM backend...
Did you use GCC for the 0.90 release ?

2 Problems with the Wiki page:

1. It's outdated

2. It doesn't document how to use it. Downloaded GCC addon package http://sourceforge.net/projects/fbc/fil ... p/download (6 MiB ZIP) but it doesn't work ... "variable DGJPP is not set" :-( Do I need a DGJPP installation to get the "-gen GCC" working ?
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Re: -gen GCC

Post by dkl »

Yea, that page needs updating. -gen gcc is much better now, I didn't use it for building the 0.90 release though.

From FB's point of view all that's needed to use -gen gcc is to specify -gen gcc on the fbc command line. That assumes a working gcc though.

How to get a working gcc heavily depends on the system. On Linux all you need to do is to install the "gcc" package via the distro package management tools. For FB-dos I packaged up the gcc.exe/cc1.exe from my DJGPP setup, though apparently I forgot about it wanting certain environment variables. Normally gcc doesn't need this, it's specific to DJGPP (perhaps even this DJGPP build).

Perhaps setting DJGPP to C:\DJGPP will be enough to make it work. Of course if it's going to look for other DJGPP files, then it won't work... and the FB-dos-gcc package is useless then. In that case, however, I'm not sure what other ways to get a working gcc for DOS exist, besides a minimal DJGPP install.
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Re: -gen GCC

Post by dkl »

Maybe it will work to have fbc set the DJGPP environment variable in that case.
rugxulo
Posts: 219
Joined: Jun 30, 2006 5:31
Location: Usono (aka, USA)
Contact:

Re: -gen GCC

Post by rugxulo »

dkl wrote:Maybe it will work to have fbc set the DJGPP environment variable in that case.
You normally also need DJGPP.ENV from DJDEV*.ZIP. That's what the %DJGPP% env. var. points to, anyways. Without that, it doesn't know where to find the various GCC pieces that aren't in the %PATH%.

(from memory, here's an ultra minimal setup):

md \djgpp
cd \djgpp
for %%a in (djdev204.zip gcc481b.zip bnu2232b.zip) do unzip -q %%a
path \djgpp\bin;%PATH%
set DJGPP=\djgpp\djgpp.env
gcc -v
Post Reply