Hi, developers!
I have successfully downloaded and compiled GPC-980511 for Linux. There still are two problems with the makefile:
1. Subdirectory /p in the gcc source directory may not be a symlink (make finds out the real directory and complains about missing `../configure') - I remember I've seen this problem reported together with a patch on the list.
2. Compiling the RTL for the first time fails because `gpc' is not found (it is still called `xgpc' at the moment)
However I was unable to install RHIDE for Linux (rpm2tgz from Slackware 3.4 distribution fails with the rpm package) so I used DJGPP version to examine the following bugs:
1. GPC preprocessor outputs too many empty lines when removing text between {$IFDEF} ... {$ENDIF}. A sample program:
{1} program LineNumberBug; {2} {3} {$IFDEF NotDefined} {4} This line is not compiled {5} {$ENDIF} {6} {7} begin {8} ! { Generate syntax error on line 8 } {9} end.
...>gpc main.pas main.pas: In function `program_Linenumberbug': main.pas:11: parse error before `!' ^^ should be 8
2. Procedural variables are always passed by value.
program ProcBug;
type TProc = procedure;
procedure NoBug(X: TProc); begin { X is passed by value as it should be } end;
procedure Bug(var X: TProc); begin { X is passed by value here too! } { If I tried to modify X, I would corrupt code of some procedure } end;
var Tmp: TProc;
begin NoBug(Tmp); { These two calls in .S file are identical } Bug(Tmp); end.
3. (I think this one is not new) `--automake' does pass all required .o files to the linker if it didn't need to recompile the sources.
(Windows 95 crashed as usual and I had to retype everything from scratch. I should once again try to install RHIDE for Linux...)
Yours, -- Marius Gedminas "A Hacker is any person who derives E-mail: mgedmin@pub.osf.lt joy from discovering ways to WWW: http://www-public.osf.lt/~mgedmin/ circumvent limitations." rab'86
Hi, Marius! Hi, all!
- Subdirectory /p in the gcc source directory may not be a symlink (make finds out the real directory and complains about missing `../configure') - I remember I've seen this problem reported together with a patch on the list.
This will be fixed in the next release where `make' looks for `$(srcdir)/configure'.
- Compiling the RTL for the first time fails because `gpc' is not found (it is still called `xgpc' at the moment)
This also will be fixed in the next release.
However I was unable to install RHIDE for Linux (rpm2tgz from Slackware 3.4 distribution fails with the rpm package) [...]
What about `rpm --install ...'? It worked for me.
- GPC preprocessor outputs too many empty lines when removing text between {$IFDEF} ... {$ENDIF}. A sample program: [...]
While we were aware of the problem, your test program allows for the best analysis so far. We are working on fixing this. Thanks for your help!
- Procedural variables are always passed by value.
This will be harder to fix. I included your test program into our testsuite (marius1.pas).
- (I think this one is not new) `--automake' does pass all required .o files to the linker if it didn't need to recompile the sources.
That's not new, but again a better analysis of the problem. In order to hunt the bug, an example program which will output "OK" when the bug will be fixed would be helpful. (Or do we already have one? I have lost overview a little ... #-)
(Windows 95 crashed as usual and I had to retype everything from scratch.
:-(
I should once again try to install RHIDE for Linux...)
;-) Good luck!
Peter
Hi!
22-Jun-98 15:51 Peter Gerwinski wrote:
However I was unable to install RHIDE for Linux (rpm2tgz from Slackware 3.4 distribution fails with the rpm package) [...]
What about `rpm --install ...'? It worked for me.
I do not have rpm in my Slackware distribution. If nothing else helps, I'll try to find it on the Net.
- (I think this one is not new) `--automake' does pass all required .o files to the linker if it didn't need to recompile the sources.
That's not new, but again a better analysis of the problem. In order to hunt the bug, an example program which will output "OK" when the bug will be fixed would be helpful. (Or do we already have one? I have lost overview a little ... #-)
I never had it (overview, that is), but I do not think it is easy to write such a program. Well, maybe...
--- automakebug.pas ---
program AutoMakeBug;
uses First;
begin CallFirst; end.
--- first.pas ---
unit First;
interface
procedure CallFirst;
implementation
uses Second;
procedure CallFirst; begin CallSecond; end;
end.
--- second.pas ---
unit Second;
interface
procedure CallSecond;
implementation
procedure CallSecond; begin WriteLn('Hi!'); end;
end.
---
First time it compiles nicely, second time ld complains about `Callsecond' being undefined. It might be possible to write a wrapper to execute `gpc --automake automakebug.pas' twice and output 'Ok' if the second compilation succeeds.
Yours, -- Marius Gedminas "A Hacker is any person who derives E-mail: mgedmin@pub.osf.lt joy from discovering ways to WWW: http://www-public.osf.lt/~mgedmin/ circumvent limitations." rab'86
According to Marius Gedminas:
First time it compiles nicely, second time ld complains about `Callsecond' being undefined. It might be possible to write a wrapper to execute `gpc --automake automakebug.pas' twice and output 'Ok' if the second compilation succeeds.
That works in my testsuite (-: i.e. it reproduces the bug ;-).
Thanks,
Peter