[fpc-pascal] Statically link library

Marco van de Voort marcov at stack.nl
Sun Apr 21 16:57:24 CEST 2013


In our previous episode, Vittorio Giovara said:
> > Fpc can't call gcc.
> >
> > Well you could manually edit ppas.sh/link.res and substitute 'gcc' to
> 'ld', and of course adjust all the flags.

Possible, but not really sane. The  platforms with a lot of static linking
are mostly the non-unix ones, with multiple gcc's (mingw vs cygwin etc), and
gcc is not terribly standard on such platforms.

> > FPC can pass extra flags to the linker. Just harvest the flags by compiling
> > a simple program with gcc
> >
> > Indeed, too bad sometimes you have to link gcc, sometimes gcc_s.1,
> sometimes stdc++ and so on, depending on target, architecture, operating
> system and so on...

> Like I said other time, not really portable,

True, a portable solution would have such information in a more accessable
location.

> but with little use-case too, so not a big deal, right?

Yes. See above.



More information about the fpc-pascal mailing list