Hi all,
I've already filled up an issue
http://bugs.freepascal.org/view.php?id=15586 which shows the problem. It cannot link application with > 255 lfms (mac only - win32 & linux are ok). fpc-2.4.1 r14802
Anyone ?
zeljko

Mailing lists / fpc-devel / 2010-01
6 messages · 2 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi all,
I've already filled up an issue
http://bugs.freepascal.org/view.php?id=15586 which shows the problem. It cannot link application with > 255 lfms (mac only - win32 & linux are ok). fpc-2.4.1 r14802
Anyone ?
zeljko
Sorry about double posting (I wasn't subscribed to list when posting 1st mail).
zeljko
I've already filled up an issue http://bugs.freepascal.org/view.php?id=15586 which shows…
Il 25/01/2010 15.40, zeljko ha scritto:
Could you please make a test with the code below?
Put the attached program in a new folder (since it creates a lot of files), then compile the program from the Terminal with fpc genres.pas
It will create 260 small .lfm files and a test.pas file. try to compile test.pas with
fpc test.pas
And report the error message you receive.
I want to understand if it is fpc, fpcres or the linker who complains.
Giulio
cut and paste the text below in a genres.pas file
---------------------------------------------------------------------- program genres;
{$mode objfpc}{$h+}
uses
classes, sysutils;
procedure genfile(i : integer; prog : TStringList);
var
str : TStringList;
nstr : string;
begin
nstr:=IntToStr(i);
str:=TStringList.Create;
str.add('object AboutForm'+nstr+': TAboutForm'+nstr);
str.add('end');
str.SaveToFile('res'+nstr+'.lfm');
str.Free;
prog.Add('{$R res'+nstr+'.lfm}');
end;
function progstart : TStringList;
var
str : TStringList;
begin
str:=TStringList.Create;
str.Add('program test;');
str.Add('');
Result:=str;
end;
procedure progend(str : TStringList);
begin
str.Add('');
str.Add('begin');
str.Add('end.');
str.SaveToFile('test.pas');
str.Free;
end;
var
i : integer;
str : TStringList;
begin
str:=progstart;
for i:=1 to 260 do
genfile(i,str);
progend(str);
end.Here is output (ppc386 test.pas)
lindas-computer:~/genres Linda$ ppc386 test.pas
Free Pascal Compiler version 2.4.1 [2010/01/24] for i386 Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Darwin for i386
Compiling test.pas
Assembling test
Compiling resource test.or
Error: Can't open file 'res7.lfm'
Error: Error while compiling resources
Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
I've also attached test.reslist which is used by fpcres, so you can see there that res7.lfm is at 254th line (254th resource of linked app)
thanks
zeljko
Il 25/01/2010 18.40, zeljko ha scritto:
Ahhh! We are out of file handles. I think you have an ulimit of 256 (253 files +stdin,stdout,stderr=256).
Okay, fpcres shouldn't try to keep all its input files open...
Giulio
ulimit says "unlimited" :), but ulimit -n says exact 256 :)))) didn't even think about that , now it works correct (ulimit -n 1024), of course patch need to be maded for fpcres ...
thanks
zeljko