[Vm-dev] VM Maker: VMMaker.oscog-eem.1694.mcz

Esteban Lorenzano estebanlm at gmail.com
Wed Feb 24 11:31:57 UTC 2016


Hi, 

Sorry but this will not work :(

There are two reasons…  this is the output of IA32FFIPlugin: 

void* IA32FFIPlugin_exports[][3] = {
	{"IA32FFIPlugin", "ffiLogCallsTo", (void*)ffiLogCallsTo},
	{"IA32FFIPlugin", "getModuleName", (void*)getModuleName},
	{"IA32FFIPlugin", "initialiseModule", (void*)initialiseModule},
	{"IA32FFIPlugin", "primitiveCallout\000\002", (void*)primitiveCallout},
	{"IA32FFIPlugin", "primitiveCalloutWithArgs\000\004", (void*)primitiveCalloutWithArgs},
	{"IA32FFIPlugin", "primitiveCreateManualSurface\000\000", (void*)primitiveCreateManualSurface},
	{"IA32FFIPlugin", "primitiveDestroyManualSurface\000\000", (void*)primitiveDestroyManualSurface},
	{"IA32FFIPlugin", "primitiveFFIAllocate\000\001", (void*)primitiveFFIAllocate},
	{"IA32FFIPlugin", "primitiveFFIDoubleAt\000\001", (void*)primitiveFFIDoubleAt},
	{"IA32FFIPlugin", "primitiveFFIDoubleAtPut\000\001", (void*)primitiveFFIDoubleAtPut},
	{"IA32FFIPlugin", "primitiveFFIFloatAt\000\001", (void*)primitiveFFIFloatAt},
	{"IA32FFIPlugin", "primitiveFFIFloatAtPut\000\001", (void*)primitiveFFIFloatAtPut},
	{"IA32FFIPlugin", "primitiveFFIFree\000\001", (void*)primitiveFFIFree},
	{"IA32FFIPlugin", "primitiveFFIGetLastError\000\377", (void*)primitiveFFIGetLastError},
	{"IA32FFIPlugin", "primitiveFFIIntegerAt\000\001", (void*)primitiveFFIIntegerAt},
	{"IA32FFIPlugin", "primitiveFFIIntegerAtPut\000\001", (void*)primitiveFFIIntegerAtPut},
	{"IA32FFIPlugin", "primitiveForceLoad\000\002", (void*)primitiveForceLoad},
	{"IA32FFIPlugin", "primitiveLoadSymbolFromModule\000\002", (void*)primitiveLoadSymbolFromModule},
	{"IA32FFIPlugin", "primitiveLogCallsTo\000\000", (void*)primitiveLogCallsTo},
	{"IA32FFIPlugin", "primitiveSetManualSurfacePointer\000\000", (void*)primitiveSetManualSurfacePointer},
	{"IA32FFIPlugin", "setInterpreter", (void*)setInterpreter},
	{NULL, NULL, NULL}
};

So, this: 

# define IA32FFIPlugin_exports SqueakFFIPrims_exports

will just change the exports variable, but not the “IA32FFIPlugin” string… and defining: 

# define IA32FFIPlugin SqueakFFIPrims

will not work either because preprocessor does not works inside strings :(

how can we fix this?

Esteban

> On 23 Feb 2016, at 17:31, commits at source.squeak.org wrote:
> 
> 
> Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
> http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1694.mcz
> 
> ==================== Summary ====================
> 
> Name: VMMaker.oscog-eem.1694
> Author: eem
> Time: 23 February 2016, 9:30:35.750871 am
> UUID: e1381bbc-a5af-4a35-ac60-a739611c7e0e
> Ancestors: VMMaker.oscog-eem.1693
> 
> Fix compilation of ThreadedFFIPlugin subclasses as internal plugins.
> 
> =============== Diff against VMMaker.oscog-eem.1693 ===============
> 
> Item was changed:
>  ----- Method: ThreadedFFIPlugin class>>generateCodeStringForPrimitives (in category 'translation') -----
>  generateCodeStringForPrimitives
>  	"Output a skeletal SqueakFFIPrims.c that includes the relevant FooFFIPlugin.c for
>  	 each subclass based on the identifyingPredefinedMacros the subclass defines."
>  	 
>  	^String streamContents:
>  		[:s|
>  		 s nextPutAll: '/* Automatically generated by\	' withCRs.
>  		 s nextPutAll: (CCodeGenerator monticelloDescriptionFor: self).
>  		 s cr; nextPutAll: ' */'.
>  		 s cr; cr; nextPut: $#.
>  		 (self allSubclasses sort: [:a :b| a name < b name]) do:
>  			[:class |
>  			class identifyingPredefinedMacros ifNotNil:
>  				[:predefinedMacros|
>  				 s nextPutAll: 'if '.
>  				class includingPredefinedMacros ifNotNil:
>  					[:includingMacros|
>  					 includingMacros do:
>  						[:predefinedMacro| s nextPutAll: 'defined('; nextPutAll: predefinedMacro; nextPutAll: ') && '].
>  					 s nextPut: $(].
>  				class excludingPredefinedMacros ifNotNil:
>  					[:excludingMacros|
>  					 excludingMacros do:
>  						[:predefinedMacro| s nextPutAll: '!!defined('; nextPutAll: predefinedMacro; nextPutAll: ') && '].
>  					 s nextPut: $(].
>  				 predefinedMacros
>  					do: [:predefinedMacro| s nextPutAll: 'defined('; nextPutAll: predefinedMacro; nextPut: $)]
>  					separatedBy: [s nextPutAll: ' || '].
>  				class excludingPredefinedMacros ifNotNil:
>  					[s nextPut: $)].
>  				class includingPredefinedMacros ifNotNil:
>  					[s nextPut: $)].
> + 				 s cr; cr; nextPutAll: '# define '; nextPutAll: class moduleName; nextPutAll: '_exports ';
> + 												nextPutAll: self moduleName; nextPutAll: '_exports'.
> + 				 s cr; nextPutAll: '# include "'; nextPutAll: class moduleName; nextPutAll: '.c"'.
> - 				 s cr; cr; nextPutAll: '#	include "'; nextPutAll: class moduleName; nextPutAll: '.c"'.
>  				 s cr; cr; nextPutAll: '#el']].
>  		 s nextPutAll: 'se'.
>  		 #(	'As yet no FFI implementation appears to exist for your platform.'
>  			'Consider implementing it, starting by adding a subclass of ThreadedFFIPlugin.') do:
> + 			[:msg| s cr; nextPutAll: '# error '; nextPutAll: msg].
> - 			[:msg| s cr; nextPutAll: '#	error '; nextPutAll: msg].
>  		 s cr; nextPutAll: '#endif'; cr]!
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160224/b9bccd66/attachment-0001.htm


More information about the Vm-dev mailing list