Source/Packages

Runtime.NativePhysicalNativeELF

packages/execution/src/Runtime/NativePhysicalNativeELF.alpha

622 lines68 declarations26.2 KiBSHA-256 10815f9a5c49

def · lines 214–356

nativePhysicalGenerateNativeELF

Full file
214def nativePhysicalGenerateNativeELF =
215  (lambda unrestricted program : (family NativePhysicalProgram) .
216    (eliminate
217      NativePhysicalImageResult
218      (lambda unrestricted current : (family NativePhysicalImageResult) .
219        (family NativePhysicalNativeELFResult))
220      (nativePhysicalGenerateImage program)
221      (branch
222        NativePhysicalImageGenerated
223        image
224        imageTelemetry
225        .
226        (eliminate
227          NativePhysicalImage
228          (lambda unrestricted current : (family NativePhysicalImage) .
229            (family NativePhysicalNativeELFResult))
230          image
231          (branch
232            NativePhysicalImageValue
233            imageBytes
234            bodyDigest
235            identity
236            commandCount
237            stateExtent
238            resultSlots
239            telemetry
240            .
241            (eliminate
242              X86NativeAssemblyResult
243              (lambda unrestricted current : (family X86NativeAssemblyResult) .
244                (family NativePhysicalNativeELFResult))
245              (x86NativeAssemble nativePhysicalNativeAssembly)
246              (branch
247                X86NativeAssemblyEncoded
248                codeBytes
249                .
250                (app
251                  (lambda unrestricted machineBytes : Bytes .
252                    (app
253                      (lambda unrestricted elfBytes : Bytes .
254                        (app
255                          (lambda unrestricted codeSHA256 : Bytes .
256                            (app
257                              (lambda unrestricted imageSHA256 : Bytes .
258                                (app
259                                  (lambda unrestricted machineSHA256 : Bytes .
260                                    (app
261                                      (lambda unrestricted elfSHA256 : Bytes .
262                                        (app
263                                        (lambda unrestricted artifactTelemetry : (family NativePhysicalNativeELFTelemetry) .
264                                        (constructor
265                                        NativePhysicalNativeELFResult
266                                        NativePhysicalNativeELFGenerated
267                                        (constructor
268                                        NativePhysicalNativeELFArtifact
269                                        NativePhysicalNativeELFArtifactValue
270                                        elfBytes
271                                        codeBytes
272                                        imageBytes
273                                        machineBytes
274                                        identity
275                                        codeSHA256
276                                        imageSHA256
277                                        machineSHA256
278                                        elfSHA256
279                                        commandCount
280                                        artifactTelemetry)
281                                        artifactTelemetry))
282                                        (nativePhysicalNativeELFTelemetryFor
283                                        codeBytes
284                                        imageBytes
285                                        machineBytes
286                                        elfBytes
287                                        identity
288                                        codeSHA256
289                                        imageSHA256
290                                        machineSHA256
291                                        elfSHA256)))
292                                      (sha256HexBytesOrEmpty (sha256Hex elfBytes))))
293                                  (sha256HexBytesOrEmpty (sha256Hex machineBytes))))
294                              (sha256HexBytesOrEmpty (sha256Hex imageBytes))))
295                          (sha256HexBytesOrEmpty (sha256Hex codeBytes))))
296                      (wrapMachineCodeSparseLarge machineBytes)))
297                  (bytes-append codeBytes imageBytes)))
298              (branch
299                X86NativeAssemblyEncodeDuplicateLabel
300                duplicateName
301                .
302                (nativePhysicalNativeELFFail
303                  nativePhysicalNativeELFAssemblyFailurePhase
304                  (constructor
305                    NativePhysicalNativeELFErrorCode
306                    NativePhysicalNativeELFDuplicateLabel
307                    duplicateName)
308                  b""
309                  duplicateName))
310              (branch
311                X86NativeAssemblyEncodeOffsetOverflow
312                .
313                (nativePhysicalNativeELFFail
314                  nativePhysicalNativeELFAssemblyFailurePhase
315                  (constructor
316                    NativePhysicalNativeELFErrorCode
317                    NativePhysicalNativeELFAssemblyOffsetOverflow)
318                  b""
319                  b""))
320              (branch
321                X86NativeAssemblyMissingLabel
322                missingName
323                .
324                (nativePhysicalNativeELFFail
325                  nativePhysicalNativeELFAssemblyFailurePhase
326                  (constructor
327                    NativePhysicalNativeELFErrorCode
328                    NativePhysicalNativeELFMissingLabel
329                    missingName)
330                  b""
331                  missingName))
332              (branch
333                X86NativeAssemblyDisplacementOutOfRange
334                distantName
335                .
336                (nativePhysicalNativeELFFail
337                  nativePhysicalNativeELFAssemblyFailurePhase
338                  (constructor
339                    NativePhysicalNativeELFErrorCode
340                    NativePhysicalNativeELFDisplacementOutOfRange
341                    distantName)
342                  b""
343                  distantName))))))
344      (branch
345        NativePhysicalImageGenerationFailed
346        imageError
347        failureTelemetry
348        .
349        (nativePhysicalNativeELFFail
350          nativePhysicalNativeELFImageFailurePhase
351          (constructor
352            NativePhysicalNativeELFErrorCode
353            NativePhysicalNativeELFImageGenerationFailed
354            imageError)
355          (nativePhysicalNativeELFEncodeImageFailureTelemetry failureTelemetry)
356          b""))))

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.