Branch: refs/heads/upgrade_libpng
Home: https://github.com/OpenSmalltalk/opensmalltalk-vm
Commit: 61faabba1f68c1b5ba6b161f8571020b0ce755ec
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/61faabba1f68c1b5ba…
Author: Nicolas Cellier <nicolas.cellier.aka.nice(a)gmail.com>
Date: 2021-01-03 (Sun, 03 Jan 2021)
Changed paths:
M build.macos32x86/pharo.cog.spur.lowcode/Makefile
M build.macos32x86/pharo.cog.spur.minheadless/Makefile
M build.macos32x86/pharo.cog.spur/Makefile
M build.macos32x86/pharo.cog.v3/Makefile
M build.macos32x86/pharo.sista.spur/Makefile
M build.macos32x86/pharo.stack.spur.lowcode/Makefile
M build.macos32x86/pharo.stack.spur/Makefile
M build.macos32x86/third-party/Makefile.libpng
A build.macos32x86/third-party/Makefile.zlib
M build.macos64x64/pharo.cog.spur.lowcode/Makefile
M build.macos64x64/pharo.cog.spur/Makefile
M build.macos64x64/pharo.sista.spur/Makefile
M build.macos64x64/pharo.stack.spur.lowcode/Makefile
M build.macos64x64/pharo.stack.spur/Makefile
M build.macos64x64/squeak.stack.spur/Makefile
M build.macos64x64/third-party/Makefile.cairo
M build.macos64x64/third-party/Makefile.freetype2
M build.macos64x64/third-party/Makefile.libpng
A build.macos64x64/third-party/Makefile.zlib
M platforms/iOS/plugins/FT2Plugin/Makefile
M third-party/libpng.spec
M third-party/zlib.spec
Log Message:
-----------
Try and rescue macos libpng builds for Pharo
On macosx, zlib is a pre-requisite of libpng, so it has to be compiled
While at it, upgrade libpng to 1.16.37 due to CVE-2019-7317 - see http://www.libpng.org/pub/png/libpng.html
Commit: afe4f5abdc7cc2e6a8a7ab2d74237f0b6e3a8326
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/afe4f5abdc7cc2e6a8…
Author: Nicolas Cellier <nicolas.cellier.aka.nice(a)gmail.com>
Date: 2021-01-03 (Sun, 03 Jan 2021)
Changed paths:
M third-party/pixman.spec
Log Message:
-----------
also upgrade pixman to 0.40.0
This is required on macos because newer version of clang do not anymore provide a `__builtin_shuffle`
Commit: 8c26fc240e4e50f3a84fb1d3e1ebb734802e0b48
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/8c26fc240e4e50f3a8…
Author: Nicolas Cellier <nicolas.cellier.aka.nice(a)gmail.com>
Date: 2021-01-03 (Sun, 03 Jan 2021)
Changed paths:
M build.macos32x86/common/Makefile.lib.extra
Log Message:
-----------
And let 32 bits builds pollute their own cache (x86 rather than x86_64)
Commit: 6c33c2bb3f54acf1f0d302349dcee2e82bb4122c
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/6c33c2bb3f54acf1f0…
Author: Nicolas Cellier <nicolas.cellier.aka.nice(a)gmail.com>
Date: 2021-01-03 (Sun, 03 Jan 2021)
Changed paths:
M third-party/cairo.spec
Log Message:
-----------
And also upgrade cairo to 1.15.14
Commit: 8eb93486803c5fcef43fa088c433a053eaa8515b
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/8eb93486803c5fcef4…
Author: Nicolas Cellier <nicolas.cellier.aka.nice(a)gmail.com>
Date: 2021-01-03 (Sun, 03 Jan 2021)
Changed paths:
M build.win32x86/third-party/Makefile.libpng
M build.win64x64/third-party/Makefile.libpng
R third-party/libpng.spec.win
Log Message:
-----------
Nuke win specific libpng.spec
Commit: 3abac662759b8cd7bc54ea94b016da83b280b9bc
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/3abac662759b8cd7bc…
Author: Nicolas Cellier <nicolas.cellier.aka.nice(a)gmail.com>
Date: 2021-01-03 (Sun, 03 Jan 2021)
Changed paths:
R third-party/pixman.clang.patch
Log Message:
-----------
Nuke pixman patch, the upgrade solved the thing
Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/61faabba1f68%5E..…
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2920.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.2920
Author: eem
Time: 3 January 2021, 9:19:28.019823 am
UUID: 30a49581-87d4-4b92-b7bc-a109c8a430a2
Ancestors: VMMaker.oscog-eem.2919
Cogit: nuke a couple of unused inst vars.
=============== Diff against VMMaker.oscog-eem.2919 ===============
Item was changed:
----- Method: CogVMSimulator>>initializeThreadSupport (in category 'initialize-release') -----
initializeThreadSupport
"Do this post new if you want to simulate with thread support."
+ cogThreadManager := CogThreadManager new setInterpreter: self cogit: cogit!
- cogThreadManager := CogThreadManager new setInterpreter: self cogit: cogit.
- cogit setThreadManager: cogThreadManager!
Item was changed:
CogClass subclass: #Cogit
(excessive size, no diff calculated)
Item was changed:
----- Method: Cogit>>setInterpreter: (in category 'initialization') -----
setInterpreter: aCoInterpreter
"Initialization of the code generator in the simulator.
These objects already exist in the generated C VM
or are used only in the simulation."
<doNotGenerate>
coInterpreter := aCoInterpreter.
objectMemory := aCoInterpreter objectMemory.
- threadManager := aCoInterpreter threadManager. "N.B. may be nil"
methodZone := self class methodZoneClass new.
objectRepresentation := objectMemory objectRepresentationClass
forCogit: self methodZone: methodZone.
methodZone setInterpreter: aCoInterpreter
objectRepresentation: objectRepresentation
cogit: self.
generatorTable := self class generatorTable.
processor := ProcessorClass new.
simulatedAddresses := Dictionary new.
coInterpreter class clusteredVariableNames do:
[:cvn| self simulatedAddressFor: (cvn first = $C ifTrue: ['get', cvn] ifFalse: [cvn]) asSymbol].
simulatedTrampolines := Dictionary new.
simulatedVariableGetters := Dictionary new.
simulatedVariableSetters := Dictionary new.
traceStores := 0.
traceFlags := (self class initializationOptions at: #recordPrimTrace ifAbsent: [true])
ifTrue: [8] "record prim trace on by default (see Cogit class>>decareCVarsIn:)"
ifFalse: [0].
singleStep := printRegisters := printInstructions := clickConfirm := false.
backEnd := CogCompilerClass for: self.
methodLabel := CogCompilerClass for: self.
(literalsManager := backEnd class literalsManagerClass new) cogit: self.
ordinarySendTrampolines := CArrayAccessor on: (Array new: NumSendTrampolines).
superSendTrampolines := CArrayAccessor on: (Array new: NumSendTrampolines).
BytecodeSetHasDirectedSuperSend ifTrue:
[directedSuperSendTrampolines := CArrayAccessor on: (Array new: NumSendTrampolines).
directedSuperBindingSendTrampolines := CArrayAccessor on: (Array new: NumSendTrampolines).
directedSendUsesBinding := false].
NewspeakVM ifTrue:
[selfSendTrampolines := CArrayAccessor on: (Array new: NumSendTrampolines).
dynamicSuperSendTrampolines := CArrayAccessor on: (Array new: NumSendTrampolines).
implicitReceiverSendTrampolines := CArrayAccessor on: (Array new: NumSendTrampolines).
outerSendTrampolines := CArrayAccessor on: (Array new: NumSendTrampolines)].
"debug metadata"
objectReferencesInRuntime := CArrayAccessor on: (Array new: NumObjRefsInRuntime).
runtimeObjectRefIndex := 0.
"debug metadata"
trampolineAddresses := CArrayAccessor on: (Array new: NumTrampolines * 2).
trampolineTableIndex := 0.
extA := numExtB := extB := 0.
compilationTrace ifNil: [compilationTrace := self class initializationOptions at: #compilationTrace ifAbsent: [0]].
debugOpcodeIndices := self class initializationOptions at: #debugOpcodeIndices ifAbsent: [Set new].
debugBytecodePointers := self class initializationOptions at: #debugBytecodePointers ifAbsent: [Set new].
self class initializationOptions at: #breakPC ifPresent: [:pc| breakPC := pc]!
Item was removed:
- ----- Method: Cogit>>setThreadManager: (in category 'initialization') -----
- setThreadManager: aCogThreadManager
- "Initialization of the code generator in the simulator.
- Used in the separate VM since this VM does not do a second initialization of the interpreter,
- only a second initialization of the objectMemory."
- <doNotGenerate>
- threadManager := aCogThreadManager "N.B. may be nil"!
Branch: refs/heads/Cog
Home: https://github.com/OpenSmalltalk/opensmalltalk-vm
Commit: d24a669e5964b9a47540a09ba1113ae3fa31d263
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/d24a669e5964b9a475…
Author: Eliot Miranda <eliot.miranda(a)gmail.com>
Date: 2021-01-02 (Sat, 02 Jan 2021)
Changed paths:
M platforms/Mac OS/vm/sqMacUnixCommandLineInterface.c
M platforms/iOS/vm/OSX/sqSqueakOSXApplication.m
M platforms/unix/vm/sqUnixMain.c
M platforms/win32/vm/sqWin32Main.c
Log Message:
-----------
Fix the type declaration of the sendTrace option variable for 64-bit
StackVM compiles. Add the missing command-line parser for it on Mac.
For reasons I've been trying to compile a vm to run on an ubuntu container running on a samsung galaxy 7phone. I know, right? Who'd want an Android phone? Nasty tacky OS.
Anyway, the cog vm compiles and happily starts with '-h' ... but any attempt to open on an image crashes with a very unhelpful
Illegal Instruction
and no crash file or any other help. I'll get around to trying a debug version some day.
In the meantime the stack VM was a bit interesting to compile. It hits a fatal link error because sqUnixMain wants to refer to sendTrace from the interp.c file. It lists a very strange error
opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:1561:(.text+0x2744): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol `sendTrace' defined in COMMON section in vm/vm.a(gcc3x-interp.o)
/root/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:1561: warning: One possible cause of this error is that the symbol is being referenced in the indicated code as if it had a larger alignment than was declared where it was defined.
collect2: error: ld returned 1 exit status
The google results for 'relocation truncated to fit' are ... interesting. If, that is, you want to know inner arcane details of C compilation. Which I don't, anymore.
A successful work-around is to comment out the lines
#if (STACKVM || NewspeakVM) && !COGVM
else if (!strcmp(argv[0], VMOPTION("sendtrace"))) { extern sqInt sendTrace; sendTrace = 1; return 1; }
#endif
in sqUnix.c
Oh - the phone runs that VM and manages about 85 MBC/s & 5MSend/s which suggest roughly Pi 3 performance, so it should be ok once Cog runs.
Happy new year all - let's hope 20/20 vision is an improvement.
tim
--
tim Rowledge; tim(a)rowledge.org; http://www.rowledge.org/tim
The gains I make don't make me a hero; all the work I do is just to get back to Zero
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2919.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.2919
Author: eem
Time: 2 January 2021, 10:12:29.080225 pm
UUID: 3c606a29-4e7f-4ce7-9d1b-5ba006cff614
Ancestors: VMMaker.oscog-eem.2918
SImulation:
Add the halt check to click step when enetering interpret.
Fix CoInterpreterMT>>#enterSmalltalkExecutive as per VMMaker.oscog-eem.2918.
Refactor getReturnAddress so it can be extracted from ThisContext (the Debugger's version of thisContext).
=============== Diff against VMMaker.oscog-eem.2918 ===============
Item was added:
+ ----- Method: CoInterpreterMT>>enterSmalltalkExecutive (in category 'initialization') -----
+ enterSmalltalkExecutive
+ "Main entry-point into the interpreter at each execution level, where an
+ execution level is either the start of execution or reentry for a callback.
+
+ N.B. It also provides the simulator's implementation of ceReturnToInterpreter/ceInvokeInterpreter, which
+ via a simulation trap raise the ReenterInterpreter signal in handleCallOrJumpSimulationTrap:/reenterInterpreter.
+ So when ReenterInterpreter is caught this method invokes interpret directly."
+ <cmacro: '() enterSmalltalkExecutiveImplementation()'>
+ "Simulation of the setjmp in enterSmalltalkExecutiveImplementation for reentry into interpreter."
+ | caught |
+ caught := false.
+ [[caught
+ ifFalse: [self enterSmalltalkExecutiveImplementation]
+ ifTrue: [self interpret]]
+ on: ReenterInterpreter
+ do: [:ex|
+ caught := true.
+ self assert: ex returnValue = ReturnToInterpreter.
+ ex return: true]] whileTrue!
Item was changed:
----- Method: CogVMSimulator>>getReturnAddress (in category 'simulation only') -----
getReturnAddress
"In the real VM this answers the return address for its caller, i.e. for interpret.
In the simulator we're playing fast and loose with initialEnterSmalltalkExecutive
and enterSmalltalkExecutiveImplementation and need them to look and act the same."
| selector |
+ selector := thisContext getReturnAddress.
+ ^(selector == #initialEnterSmalltalkExecutive
+ or: [selector == #enterSmalltalkExecutive])
- selector := (thisContext findContextSuchThat: [:ctxt| ctxt selector == #interpret]) sender method selector.
- ^selector == #initialEnterSmalltalkExecutive
ifTrue: [#enterSmalltalkExecutiveImplementation]
ifFalse: [selector]!
Item was changed:
----- Method: Cogit>>handleCallOrJumpSimulationTrap: (in category 'simulation only') -----
handleCallOrJumpSimulationTrap: aProcessorSimulationTrap
<doNotGenerate>
| evaluable function memory result savedFramePointer savedStackPointer savedArgumentCount retpc |
"This is a hack fix before we revise the simulators. When a jump call is made, the next
pc is effectively the return address on the stack, not the instruction following the jump."
aProcessorSimulationTrap type == #jump ifTrue:
[processor hackFixNextPCOfJumpFor: aProcessorSimulationTrap using: objectMemory].
evaluable := simulatedTrampolines
at: aProcessorSimulationTrap address
ifAbsent: [self errorProcessingSimulationTrap: aProcessorSimulationTrap
in: simulatedTrampolines].
function := evaluable isBlock
ifTrue: ['aBlock; probably some plugin primitive']
ifFalse:
[evaluable receiver == backEnd ifTrue: "this is for invoking ARMv5 floating-point intrinsics"
[^self handleABICallOrJumpSimulationTrap: aProcessorSimulationTrap evaluable: evaluable].
evaluable selector].
memory := coInterpreter memory.
function == #interpret ifTrue: "i.e. we're here via ceInvokeInterpret/ceReturnToInterpreterTrampoline and should discard all state back to enterSmalltalkExecutiveImplementation"
[self recordInstruction: {'(simulated jump call of '. aProcessorSimulationTrap address. '/'. function. ')'}.
+ "self halt: evaluable selector."
+ clickConfirm ifTrue:
+ [(self confirm: 'skip jump to interpret?') ifFalse:
+ [clickConfirm := false. self halt]].
processor simulateJumpCallOf: aProcessorSimulationTrap address memory: memory.
coInterpreter reenterInterpreter.
"NOTREACHED"
self halt].
function ~~ #ceBaseFrameReturn: ifTrue:
[coInterpreter assertValidExternalStackPointers].
(backEnd wantsNearAddressFor: function) ifTrue:
[^self perform: function with: aProcessorSimulationTrap].
processor
simulateCallOf: aProcessorSimulationTrap address
nextpc: aProcessorSimulationTrap nextpc
memory: memory.
retpc := processor retpcIn: memory.
self recordInstruction: {'(simulated call of '. aProcessorSimulationTrap address. '/'. function. ')'}.
savedFramePointer := coInterpreter framePointer.
savedStackPointer := coInterpreter stackPointer.
savedArgumentCount := coInterpreter argumentCount.
result := ["self halt: evaluable selector."
clickConfirm ifTrue:
[(self confirm: 'skip run-time call?') ifFalse:
[clickConfirm := false. self halt]].
evaluable valueWithArguments: (processor
postCallArgumentsNumArgs: evaluable numArgs
in: memory)]
on: ReenterMachineCode
do: [:ex| ex return: #continueNoReturn].
coInterpreter assertValidExternalStackPointers.
"Verify the stack layout assumption compileInterpreterPrimitive: makes, provided we've
not called something that has built a frame, such as closure value or evaluate method, or
switched frames, such as primitiveSignal, primitiveWait, primitiveResume, primitiveSuspend et al."
(function beginsWith: 'primitive') ifTrue:
[coInterpreter primFailCode = 0
ifTrue: [(CogVMSimulator stackAlteringPrimitives includes: function) ifFalse:
["This is a rare case (e.g. in Scorch where a married context's sender is set to nil on trapTrpped and hence the stack layout is altered."
(function == #primitiveSlotAtPut and: [objectMemory isContext: (coInterpreter frameReceiver: coInterpreter framePointer)]) ifFalse:
[self assert: savedFramePointer = coInterpreter framePointer.
self assert: savedStackPointer + (savedArgumentCount * objectMemory wordSize)
= coInterpreter stackPointer]]]
ifFalse:
[self assert: savedFramePointer = coInterpreter framePointer.
self assert: savedStackPointer = coInterpreter stackPointer]].
result ~~ #continueNoReturn ifTrue:
[self recordInstruction: {'(simulated return to '. processor retpcIn: memory. ')'}.
processor simulateReturnIn: memory.
self assert: processor pc = retpc.
processor smashCallerSavedRegistersWithValuesFrom: 16r80000000 by: objectMemory wordSize].
self assert: (result isInteger "an oop result"
or: [result == coInterpreter
or: [result == objectMemory
or: [result == nil
or: [result == #continueNoReturn]]]]).
processor cResultRegister: (result
ifNil: [0]
ifNotNil: [result isInteger
ifTrue: [result]
ifFalse: [16rF00BA222]])!
Item was changed:
----- Method: Cogit>>tryLockVMOwnerTo: (in category 'multi-threading') -----
tryLockVMOwnerTo: value
<api>
"ceTryLockVMOwner does an atomic compare-and-swap of the vmOwner
variable with zero and the argument, setting vmOwner to value if it was
+ zero. It answers if the lock was zero and hence was acquired.
+
+ See CogThreadManager>>#tryLockVMOwnerTo: for the simulation of
+ processor thread switching which surrounds this method."
- zero. It answers if the lock was zero and hence was acquired."
<cmacro: '(value) ceTryLockVMOwner(value)'>
processor abiMarshalArg0: value in: objectMemory memory.
^[ | result |
result := self simulateLeafCallOf: ceTryLockVMOwner.
self assert: (result ~= 0) = (coInterpreter threadManager getVMOwner = value).
result ~= 0] ensure:
[processor abiUnmarshal: 1]!
Item was added:
+ ----- Method: Context>>getReturnAddress (in category '*VMMaker-simulation') -----
+ getReturnAddress
+ "Simulate access to the return address, used in the CoInterpreter in fast interpreter activation.
+ For simulaiton map return addresses to sender selectors."
+ ^(self findContextSuchThat: [:ctxt| ctxt selector == #interpret]) sender method selector!