<div dir="ltr"><div>It looks like my old post had an error when I tried to copy and paste the text.</div><div>The last line that is repeated 3 times should be three separate lines with an</div><div>have an offset for each variable.</div>
<div><br></div><div>For what it's worth, here is the actual patch I used. (I haven't re-tested it</div><div>today. If it doesn't work, I would have originally used the latest version of</div><div>the svn trunk on the day I posted, so you might try that...)</div>
<div><br></div><div>######### BEGIN PATCH ############################<br><div><br></div><div><div>diff --git a/rtl/freebsd/x86_64/<a href="http://dllprt0.as">dllprt0.as</a> b/rtl/freebsd/x86_64/<a href="http://dllprt0.as">dllprt0.as</a></div>
<div>index 7213eae..2a68c6f 100644</div><div>--- a/rtl/freebsd/x86_64/<a href="http://dllprt0.as">dllprt0.as</a></div><div>+++ b/rtl/freebsd/x86_64/<a href="http://dllprt0.as">dllprt0.as</a></div><div>@@ -68,8 +68,20 @@ _haltproc:</div>
<div>         movzwl  (%rbx),%edi</div><div>         syscall</div><div>         jmp     _haltproc@PLT</div><div>-       /* Do not fail linkage if argc, argv and envp are not found. */</div><div>-       .weak   operatingsystem_parameter_argc</div>
<div>-       .weak   operatingsystem_parameter_argv</div><div>-       .weak   operatingsystem_parameter_envp</div><div>+//     /* Do not fail linkage if argc, argv and envp are not found. */</div><div>+//     .weak   operatingsystem_parameter_argc</div>
<div>+//     .weak   operatingsystem_parameter_argv</div><div>+//     .weak   operatingsystem_parameter_envp</div><div><br></div><div>+/* Although these variables are useless, they actually do need to be declared</div><div>
+ * to create shared libraries usable from other environments. (eg, python).</div><div>+ */</div><div>+operatingsystem_parameters:</div><div>+        .skip 3*8</div><div>+</div><div>+        .global operatingsystem_parameter_envp</div>
<div>+        .global operatingsystem_parameter_argc</div><div>+        .global operatingsystem_parameter_argv</div><div>+        .set operatingsystem_parameter_envp,operatingsystem_parameters+0</div><div>+        .set operatingsystem_parameter_argc,operatingsystem_parameters+8</div>
<div>+        .set operatingsystem_parameter_argv,operatingsystem_parameters+16</div></div><div><br></div><div>########### END PATCH #############################</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Aug 6, 2014 at 1:28 PM, Fred van Stappen <span dir="ltr"><<a href="mailto:fiens@hotmail.com" target="_blank">fiens@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div><div dir="ltr"><div class="">> I know virtually nothing about FreeBSD, but if this comment (about linker<br></div><div><div class="">> behaving in special way to 'magical name _init') still applies for the<br>
> linker used under FreeBSD, this could be the potential solution for<br>> initialization of these values for FPC RTL in shared libraries (rather<br>> then for shared libc).<br><br></div>Yep, this is a excellent opportunity for fpc to become the unique compiler who can produce True Universal Libraries.<br>
<br>freeBSD is growing, freeBSD is used by OSX too..., if fpc can create libraries for freeBSD, accessible for lot of languages (like fpc libraries do for Linux and Windows), fpc becomes the Libraries's King... ;-)<br>
<br>Thanks Tomas.<span class="HOEnZb"><font color="#888888"><br><br>Fred.<br></font></span></div>                                       </div></div>
<br>_______________________________________________<br>
fpc-devel maillist  -  <a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a><br>
<br></blockquote></div><br></div>