[fpc-pascal] Re: Could use some help with DOS cross compile

Nikolay Nikolov nickysn at users.sourceforge.net
Mon Oct 21 16:09:51 CEST 2013


On 10/21/2013 12:15 PM, Reinier Olislagers wrote:
> On 20/10/2013 20:14, Nikolay Nikolov wrote:
>> On 10/20/2013 08:12 PM, Nikolay Nikolov wrote:
>>> On 10/20/2013 06:31 PM, Reinier Olislagers wrote:
>> Ok, now I see you've put it in the fpc.cfg, but it could be that your
>> compiler doesn't find the fpc.cfg or something similar. Try specifying
>> -WmMedium on the command line when compiling and if you still get the
>> same error, then probably you didn't recompile the RTL for medium model.
> Thanks.
> Decided to try with a batch file with some more cleanup etc [1].
>
> With this I hit this problem compiling the test program:
> Assembling test
> test.pas(12,24) Warning: Object system.o not found, Linking may fail !
> ....(and so on for more .o files)
> Error! E2008: cannot open system.o : No such file or directory
> ...(and so on)
>
> I do notice a lot of .a files (system.a) etc in
> C:\Development\fpctrunk\rtl\units\msdos but no DOS .o files there or
> anywhere else....
Ah, that's because you should always compile i8086-msdos programs with 
smartlinking, i.e. use the -XX option. Smartlinking uses the .a files, 
nonsmartlinking uses the .o files. The reason the .o files aren't 
generated is because the system unit exceeds the 64kb code limit for the 
small and tiny memory models and is therefore impossible to compile even 
'hello world' without smartlinking, so creating the .o files is a waste 
of time. It might work for the medium model, but then you have to build 
the snapshot without -CX. However, with the tight memory constraints of 
real mode DOS, I see little reason not to use smartlinking in every 
memory model. Also, the medium model still has a limit of 64k code per 
unit, so even there it might not work without smartlinking (I haven't 
tested it).

Nikolay



More information about the fpc-pascal mailing list