<p></p>
<p>We use sqVirtualMachine.c/h as a poor-mans cross-platform reverse export facility, allowing shared objects o access facilities exported by the VM.  None of this is strictly necessary; all platforms providing shared objects (that I'm aware of) allow for an executable to export symbols and have these linked into a shared object built to be loaded by that executable.  That said, there's no need to reengineer plugins.  We can keep the existing structure.</p>
<p>However, the VM still exports API not covered in sqVirtualMachine.  In particular the pre-alien callback machinery, error and warning(at) are exported not thrugh sqVirtualMachine (although in desperation a few months ago I put error in there; it can be taken back out).</p>
<p>On Windows the mechanism is to link a dll with the import lib of the main executable, e.g. Squeak.lib.  SO to be able to build external plugins against the VM without having to build one's own VM, one needs that import lib.  Therefore Squeak.lib should be distributed with the VM release.</p>
<p>Again, however, Squeak.lib has many symbols that don't need to be exported.  Here are the primitives that (AFAICT) have no business being exported:</p>
<p>0000000000000000 T primitiveAddLargeIntegers<br>
0000000000000000 T primitiveAllInstances<br>
0000000000000000 T primitiveAllObjects<br>
0000000000000000 T primitiveBitAndLargeIntegers<br>
0000000000000000 T primitiveBitOrLargeIntegers<br>
0000000000000000 T primitiveBitShiftLargeIntegers<br>
0000000000000000 T primitiveBitXorLargeIntegers<br>
0000000000000000 T primitiveClockLogAddresses<br>
0000000000000000 T primitiveCompareBytes<br>
0000000000000000 T primitiveCompareWith<br>
0000000000000000 T primitiveCrashVM<br>
0000000000000000 T primitiveDisablePowerManager<br>
0000000000000000 T primitiveDivLargeIntegers<br>
0000000000000000 T primitiveDivideLargeIntegers<br>
0000000000000000 T primitiveDnsInfo<br>
0000000000000000 T primitiveEqualLargeIntegers<br>
0000000000000000 T primitiveEventProcessingControl<br>
0000000000000000 T primitiveGetLogDirectory<br>
0000000000000000 T primitiveGetWindowLabel<br>
0000000000000000 T primitiveGetWindowSize<br>
0000000000000000 T primitiveGetenv<br>
0000000000000000 T primitiveGreaterOrEqualLargeIntegers<br>
0000000000000000 T primitiveGreaterThanLargeIntegers<br>
0000000000000000 T primitiveHeartbeatFrequency<br>
0000000000000000 T primitiveHighResClock<br>
0000000000000000 T primitiveImageFormatVersion<br>
0000000000000000 T primitiveInterruptChecksPerMSec<br>
0000000000000000 T primitiveIsBigEnder<br>
0000000000000000 T primitiveIsWindowObscured<br>
0000000000000000 T primitiveLessOrEqualLargeIntegers<br>
0000000000000000 T primitiveLessThanLargeIntegers<br>
0000000000000000 T primitiveLongRunningPrimitive<br>
0000000000000000 T primitiveLongRunningPrimitiveSemaphore<br>
0000000000000000 T primitiveMethodPCData<br>
0000000000000000 T primitiveMillisecondClockMask<br>
0000000000000000 T primitiveMinimumUnusedHeadroom<br>
0000000000000000 T primitiveModLargeIntegers<br>
0000000000000000 T primitiveMultiplyLargeIntegers<br>
0000000000000000 T primitiveNotEqualLargeIntegers<br>
0000000000000000 T primitivePathToUsing<br>
0000000000000000 T primitivePluginBrowserReady<br>
0000000000000000 T primitivePluginDestroyRequest<br>
0000000000000000 T primitivePluginPostURL<br>
0000000000000000 T primitivePluginRequestFileHandle<br>
0000000000000000 T primitivePluginRequestState<br>
0000000000000000 T primitivePluginRequestURL<br>
0000000000000000 T primitivePluginRequestURLStream<br>
0000000000000000 T primitiveProfilePrimitive<br>
0000000000000000 T primitiveProfileSample<br>
0000000000000000 T primitiveProfileSemaphore<br>
0000000000000000 T primitiveProfileStart<br>
0000000000000000 T primitiveQuoLargeIntegers<br>
0000000000000000 T primitiveRemLargeIntegers<br>
0000000000000000 T primitiveScreenDepth<br>
0000000000000000 T primitiveScreenScaleFactor<br>
0000000000000000 T primitiveSetGCSemaphore<br>
0000000000000000 T primitiveSetLogDirectory<br>
0000000000000000 T primitiveSetWindowLabel<br>
0000000000000000 T primitiveSetWindowSize<br>
0000000000000000 T primitiveSubtractLargeIntegers<br>
0000000000000000 T primitiveUtcWithOffset<br>
0000000000000000 T primitiveVoidReceiver</p>
<p>So this issue is to note both that the VM import lib needs to be included in the distribution (thankfully the import lib for the Windows subsystem VM also works for the Console subsystem VM), and that the interpreter should export fewer symbols.  The final list is something like</p>
<p>0000000000000000 T callbackEnter<br>
0000000000000000 T callbackLeave<br>
0000000000000000 T error<br>
0000000000000000 T moduleUnloaded<br>
0000000000000000 T reestablishContextPriorToCallback<br>
0000000000000000 T returnAsThroughCallbackContext<br>
0000000000000000 T segmentContainingObj<br>
0000000000000000 T sendInvokeCallbackContext<br>
0000000000000000 T sendInvokeCallbackStackRegistersJmpbuf<br>
0000000000000000 T setInterruptCheckChain<br>
0000000000000000 T statNumGCs<br>
0000000000000000 T warning<br>
0000000000000000 T warningat</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/525">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AIJPEW276O2ZJZXQMUQ4VI3SICQEBANCNFSM4R4TWANQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AIJPEWZS7QFC3WVYOTKC7DLSICQEBA5CNFSM4R4TWAN2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4KSXALVA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/525",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/525",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>