[fpc-devel] NONE smart link broken on windows?
Graeme Geldenhuys
mailinglist at geldenhuys.co.uk
Sat Apr 25 11:33:40 CEST 2026
On Friday, 24 April 2026 23:57:16 BST Martin Frb via fpc-devel wrote:
> Btw, any idea where the compiler stores the target pointer size?
I believe what you are looking for is voidpointertype.size - it is the correct
target-aware pointer size in the FPC compiler.
- sizeof(pint) — reflects the host compiler's pointer size (wrong for cross-
compilation)
- voidpointertype.size — reflects the target pointer size (set during
psystem.pas initialisation based on the target CPU)
Interestingly, that means dbgdwarf.pas:3317 has a bug with
tai_const.create_8bit(sizeof(pint)) for the DWARF address_size field.
The code should read:
inc(G_ByteCounter, voidpointertype.size)
voidpointertype is declared in symdef.pas and is always available once the
system unit types are initialised. You can see psystem.pas:206 uses case
voidpointertype.size of to decide which integer types map to pointer-sized
integers — it's the established idiom for this.
I'll test a bit later and open a MR in my initial investigation is correct.
Regards
Graeme
More information about the fpc-devel
mailing list