[fpc-devel] fpc libraries do not work in freeBSD...
Fred van Stappen
fiens at hotmail.com
Tue Aug 5 23:03:09 CEST 2014
> Because they essentially have a shared RTL in libc, yes.
> But note that with a hypothetical shared FPC lib, the problem would be the
> same if one of the parts was not written in pascal.
> IOW the libc case only works for C programs, and programs that build on
In a old topic, of Michael Walace :=>
Michael said :
I had a problem and I fixed it in the compiler, but I'm not sure
what the ramifications of my fix are for other people.
My goal was to expose some pascal code to python, as per:
This works fine for me on windows but failed on freebsd/amd64.
When I would try to load my shared library as a python module, it would
fail, saying: "Undefined Symbol: operatingsystem_parameter_envp"
This issue was reported by someone else but it was (mistakenly?) marked as
a duplicate issue and closed:
Anyway, the problem appears to be in this file:
It has the comment:
# FreeBSD RunTime dynamic loader only
# calls the functions specified by -init
# as functions without parameters
# Thus, it is not possible to retrieve argc, argv and envp
# On x86_64 CPU, using weak for the operatingsystem_parameter_XXX
# allows to bind to main program parameters,
# but this does not seem to work for i386 loader.
Then at the bottom:
/* Do not fail linkage if argc, argv and envp are not found. */
My change was to comment these lines out and copy the lines from prt0.as :
Then after recompiling fpc, I was able to compile a *.so file usable from
But... It seems like the original .weak version was done quite
deliberately, so I suspect that if I submit a patch, it would break
things for other people. OTOH, I'd like to get a fix for my issue
Could it be feasible to compile a "custom" fpc, so i could compile libraries for freeBSD 10 ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-devel