[fpc-devel] Building trunk on Win32

Sergei Gorelkin sergei_gorelkin at mail.ru
Sun Nov 27 16:45:19 CET 2011


27.11.2011 16:45, Leonardo M. Ramé пишет:
>
> Well, I found I had an e:\pp directory containing an fpc 2.5.1, and my PATH was pointing to it, so my previous tests could have been influenced by some files from that directory.
>
> After deleting it, I compiled from top level directory using:
>
> e:\fpc-bin\bin\i386-win32\make clean OPT="-dDISABLE_TLS_DIRECTORY"  all PP=e:\fpc-bin\bin\i386-win32\ppc386.exe
>
> and it worked without issues.
>
Good. Even better is that we didn't enable these TLS callbacks for 2.6 :-/

> Then, I did e:\fpc-bin\bin\i386-win32\make clean all PP=e:\fpc-bin\bin\i386-win32\ppc386.exe and got this:
>
> ...
> win32/libimpvarutils.a E:/fpc/rtl/units/i386-win32/libimpsharemem.a E:/fpc/rtl/units/i386-win32/libimpfpintres.a
> e:/FPC-bin/bin/i386-Win32/rm.exe -f E:/fpc/rtl/units/i386-win32/math.rst E:/fpc/rtl/units/i386-win32/varutils.rst E:/fpc/rtl/units/i386-win32/typinfo.rst E:/fpc/rtl/units/i386-win32/variants.rst E:/fpc/rtl/units/i386-win32/classes.rst E:/fpc/rtl/units/i386-win32/dateutils.rst E:/fpc/rtl/units/i386-win32/sysconst.rst
> e:/FPC-bin/bin/i386-Win32/rm.exe -f fpcmade.i386-win32 Package.fpc ppas.bat script.res link.res
> e:/FPC-bin/bin/i386-Win32/rm.exe -f *.s *_ppas.bat
> make[7]: Leaving directory `E:/fpc/rtl/win32'
> make[6]: Leaving directory `E:/fpc/rtl'
> e:/fpc-bin/bin/i386-win32/make -C E:/fpc/rtl 'OPT=' all
> make[6]: Entering directory `E:/fpc/rtl'
> e:/fpc-bin/bin/i386-win32/make -C win32 all
> make[7]: Entering directory `E:/fpc/rtl/win32'
> E:/fpc/compiler/ppc2.exe -Ur -Xs -O2 -n -Fi../inc -Fi../i386 -Fi../win -FE. -FUE:/fpc/rtl/units/i386-win32 -di386 -dRELEASE -Us -Sg system.pp -Fi../win
> make[7]: *** [system.ppu] Error 255
> make[7]: Leaving directory `E:/fpc/rtl/win32'
> make[6]: *** [win32_all] Error 2
> make[6]: Leaving directory `E:/fpc/rtl'
> make[5]: *** [rtl] Error 2
> make[5]: Leaving directory `E:/fpc/compiler'
> make[4]: *** [next] Error 2
> make[4]: Leaving directory `E:/fpc/compiler'
> make[3]: *** [ppc3.exe] Error 2
> make[3]: Leaving directory `E:/fpc/compiler'
> make[2]: *** [cycle] Error 2
> make[2]: Leaving directory `E:/fpc/compiler'
> make[1]: *** [compiler_cycle] Error 2
> make[1]: Leaving directory `E:/fpc'
> e:\fpc-bin\bin\i386-win32\make: *** [build-stamp.i386-win32] Error 2
>
> Conclussion, the DISABLE_TLS_DIRECTORY worked as expected.
>

The fact it works with DISABLE_TLS_DIRECTORY and fails otherwise suggests that the foreign thread 
raises exceptions and FPC tries to handle them. Error 255 is most likely caused by Halt(255) in 
rtl/inc/except.inc line 200 or 303, these are the only places where RTL can exit with code 255.
This is explainable: FPC won't have ExceptObjectStack or ExceptAddressStack set up for the foreign 
thread, they will contain nil values.

But I don't imagine how it manages to work *without* TLS callbacks. The difference is that RTL will 
remain in single-threaded mode, but SetUnhandledExceptionFilter that is used to intercept exceptions 
is AFAIK global and will still break in.

Sergei



More information about the fpc-devel mailing list