[fpc-pascal] I am offering a $100 reward for linking static libraries

Henry Vermaak henry.vermaak at gmail.com
Tue Aug 23 11:56:05 CEST 2022


On Mon, 22 Aug 2022 at 22:42, Pierre Muller via fpc-pascal
<fpc-pascal at lists.freepascal.org> wrote:
> Le 22/08/2022 à 18:18, Henry Vermaak via fpc-pascal a écrit :
> > On Sun, 21 Aug 2022 at 18:34, Anthony Walter via fpc-pascal
> > <fpc-pascal at lists.freepascal.org> wrote:
> >> I am also able to use mingw32 gcc to compile this same C source into a static library for Windows using these two commands while inside the folder containing the Chipmunk2D sources:
> >>
> >> x86_64-w64-mingw32-gcc-win32 -static -static-libgcc -std=gnu99 -ffast-math src/*.c -Iinclude -c
> >
> > -static and -static-libgcc are linking options, so they won't do
> > anything here.  You'll have to link libgcc in manually in your pascal
> > source.
>
>    You can always pass option to the external linker using '-k' option:
> Use -k-static (without space)
> or -k-lc
> or -k-L -k/DIR/

Without -static-libgcc you'll still have to figure out which archives
make up libgcc.  ld won't do that for you.

Either way I think that unless fpc can be built with the same
toolchain as the C libs you're linking with there may be too many
things that can go wrong.  E.g. I'm getting 0-bit reloc in dll errors
with the external linker.

Henry


More information about the fpc-pascal mailing list