about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/misc/linuxkit/support-apple-11-sdk.patch
blob: 70393977715bb27bb62c22d7fcf352e1d36ed3f8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
diff --git a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_12.m b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_12.m
index 567172ba2..e2c1ac047 100644
--- a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_12.m
+++ b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_12.m
@@ -8,6 +8,7 @@
 
 bool vmCanStop(void *machine, void *queue)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         __block BOOL result;
         dispatch_sync((dispatch_queue_t)queue, ^{
@@ -15,12 +16,13 @@ bool vmCanStop(void *machine, void *queue)
         });
         return (bool)result;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
 void stopWithCompletionHandler(void *machine, void *queue, void *completionHandler)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         vm_completion_handler_t handler = makeVMCompletionHandler(completionHandler);
         dispatch_sync((dispatch_queue_t)queue, ^{
@@ -29,7 +31,7 @@ void stopWithCompletionHandler(void *machine, void *queue, void *completionHandl
         Block_release(handler);
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -38,10 +40,11 @@ void stopWithCompletionHandler(void *machine, void *queue, void *completionHandl
 */
 void *newVZGenericPlatformConfiguration()
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         return [[VZGenericPlatformConfiguration alloc] init];
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -51,11 +54,12 @@ void *newVZGenericPlatformConfiguration()
  */
 void setDirectorySharingDevicesVZVirtualMachineConfiguration(void *config, void *directorySharingDevices)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         [(VZVirtualMachineConfiguration *)config setDirectorySharingDevices:[(NSMutableArray *)directorySharingDevices copy]];
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -66,11 +70,12 @@ void setDirectorySharingDevicesVZVirtualMachineConfiguration(void *config, void
  */
 void setPlatformVZVirtualMachineConfiguration(void *config, void *platform)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         [(VZVirtualMachineConfiguration *)config setPlatform:(VZPlatformConfiguration *)platform];
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -80,11 +85,12 @@ void setPlatformVZVirtualMachineConfiguration(void *config, void *platform)
  */
 void setGraphicsDevicesVZVirtualMachineConfiguration(void *config, void *graphicsDevices)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         [(VZVirtualMachineConfiguration *)config setGraphicsDevices:[(NSMutableArray *)graphicsDevices copy]];
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -94,11 +100,12 @@ void setGraphicsDevicesVZVirtualMachineConfiguration(void *config, void *graphic
  */
 void setPointingDevicesVZVirtualMachineConfiguration(void *config, void *pointingDevices)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         [(VZVirtualMachineConfiguration *)config setPointingDevices:[(NSMutableArray *)pointingDevices copy]];
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -108,11 +115,12 @@ void setPointingDevicesVZVirtualMachineConfiguration(void *config, void *pointin
  */
 void setKeyboardsVZVirtualMachineConfiguration(void *config, void *keyboards)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         [(VZVirtualMachineConfiguration *)config setKeyboards:[(NSMutableArray *)keyboards copy]];
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -122,11 +130,12 @@ void setKeyboardsVZVirtualMachineConfiguration(void *config, void *keyboards)
  */
 void setAudioDevicesVZVirtualMachineConfiguration(void *config, void *audioDevices)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         [(VZVirtualMachineConfiguration *)config setAudioDevices:[(NSMutableArray *)audioDevices copy]];
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -136,10 +145,11 @@ void setAudioDevicesVZVirtualMachineConfiguration(void *config, void *audioDevic
  */
 void *newVZVirtioSoundDeviceConfiguration()
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         return [[VZVirtioSoundDeviceConfiguration alloc] init];
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -148,11 +158,12 @@ void *newVZVirtioSoundDeviceConfiguration()
 */
 void setStreamsVZVirtioSoundDeviceConfiguration(void *audioDeviceConfiguration, void *streams)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         [(VZVirtioSoundDeviceConfiguration *)audioDeviceConfiguration setStreams:[(NSMutableArray *)streams copy]];
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -162,10 +173,11 @@ void setStreamsVZVirtioSoundDeviceConfiguration(void *audioDeviceConfiguration,
  */
 void *newVZVirtioSoundDeviceInputStreamConfiguration()
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         return [[VZVirtioSoundDeviceInputStreamConfiguration alloc] init];
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -174,12 +186,13 @@ void *newVZVirtioSoundDeviceInputStreamConfiguration()
  */
 void *newVZVirtioSoundDeviceHostInputStreamConfiguration()
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         VZVirtioSoundDeviceInputStreamConfiguration *inputStream = (VZVirtioSoundDeviceInputStreamConfiguration *)newVZVirtioSoundDeviceInputStreamConfiguration();
         [inputStream setSource:[[VZHostAudioInputStreamSource alloc] init]];
         return inputStream;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -189,10 +202,11 @@ void *newVZVirtioSoundDeviceHostInputStreamConfiguration()
  */
 void *newVZVirtioSoundDeviceOutputStreamConfiguration()
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         return [[VZVirtioSoundDeviceOutputStreamConfiguration alloc] init];
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -201,12 +215,13 @@ void *newVZVirtioSoundDeviceOutputStreamConfiguration()
  */
 void *newVZVirtioSoundDeviceHostOutputStreamConfiguration()
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         VZVirtioSoundDeviceOutputStreamConfiguration *outputStream = (VZVirtioSoundDeviceOutputStreamConfiguration *)newVZVirtioSoundDeviceOutputStreamConfiguration();
         [outputStream setSink:[[VZHostAudioOutputStreamSink alloc] init]];
         return outputStream;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -220,12 +235,13 @@ void *newVZVirtioSoundDeviceHostOutputStreamConfiguration()
  */
 void *newVZSharedDirectory(const char *dirPath, bool readOnly)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         NSString *dirPathNSString = [NSString stringWithUTF8String:dirPath];
         NSURL *dirURL = [NSURL fileURLWithPath:dirPathNSString];
         return [[VZSharedDirectory alloc] initWithURL:dirURL readOnly:(BOOL)readOnly];
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -237,10 +253,11 @@ void *newVZSharedDirectory(const char *dirPath, bool readOnly)
  */
 void *newVZSingleDirectoryShare(void *sharedDirectory)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         return [[VZSingleDirectoryShare alloc] initWithDirectory:(VZSharedDirectory *)sharedDirectory];
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -252,10 +269,11 @@ void *newVZSingleDirectoryShare(void *sharedDirectory)
  */
 void *newVZMultipleDirectoryShare(void *sharedDirectories)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         return [[VZMultipleDirectoryShare alloc] initWithDirectories:(NSDictionary<NSString *, VZSharedDirectory *> *)sharedDirectories];
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -267,6 +285,7 @@ void *newVZMultipleDirectoryShare(void *sharedDirectories)
  */
 void *newVZVirtioFileSystemDeviceConfiguration(const char *tag, void **error)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         NSString *tagNSString = [NSString stringWithUTF8String:tag];
         BOOL valid = [VZVirtioFileSystemDeviceConfiguration validateTag:tagNSString error:(NSError *_Nullable *_Nullable)error];
@@ -275,7 +294,7 @@ void *newVZVirtioFileSystemDeviceConfiguration(const char *tag, void **error)
         }
         return [[VZVirtioFileSystemDeviceConfiguration alloc] initWithTag:tagNSString];
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -284,11 +303,12 @@ void *newVZVirtioFileSystemDeviceConfiguration(const char *tag, void **error)
  */
 void setVZVirtioFileSystemDeviceConfigurationShare(void *config, void *share)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         [(VZVirtioFileSystemDeviceConfiguration *)config setShare:(VZDirectoryShare *)share];
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -298,10 +318,11 @@ void setVZVirtioFileSystemDeviceConfigurationShare(void *config, void *share)
  */
 void *newVZUSBScreenCoordinatePointingDeviceConfiguration()
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         return [[VZUSBScreenCoordinatePointingDeviceConfiguration alloc] init];
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -311,10 +332,11 @@ void *newVZUSBScreenCoordinatePointingDeviceConfiguration()
  */
 void *newVZUSBKeyboardConfiguration()
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         return [[VZUSBKeyboardConfiguration alloc] init];
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -328,6 +350,7 @@ void sharedApplication()
 
 void startVirtualMachineWindow(void *machine, double width, double height)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         @autoreleasepool {
             AppDelegate *appDelegate = [[[AppDelegate alloc]
@@ -340,5 +363,6 @@ void startVirtualMachineWindow(void *machine, double width, double height)
             return;
         }
     }
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
diff --git a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_12_arm64.m b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_12_arm64.m
index 4fbaf6cb7..452adb747 100644
--- a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_12_arm64.m
+++ b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_12_arm64.m
@@ -30,6 +30,7 @@
  */
 void *newVZMacAuxiliaryStorageWithCreating(const char *storagePath, void *hardwareModel, void **error)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         NSString *storagePathNSString = [NSString stringWithUTF8String:storagePath];
         NSURL *storageURL = [NSURL fileURLWithPath:storagePathNSString];
@@ -38,7 +39,7 @@ void *newVZMacAuxiliaryStorageWithCreating(const char *storagePath, void *hardwa
                                                                options:VZMacAuxiliaryStorageInitializationOptionAllowOverwrite
                                                                  error:(NSError *_Nullable *_Nullable)error];
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -49,6 +50,7 @@ void *newVZMacAuxiliaryStorageWithCreating(const char *storagePath, void *hardwa
  */
 void *newVZMacAuxiliaryStorage(const char *storagePath)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         NSString *storagePathNSString = [NSString stringWithUTF8String:storagePath];
         NSURL *storageURL = [NSURL fileURLWithPath:storagePathNSString];
@@ -56,7 +58,7 @@ void *newVZMacAuxiliaryStorage(const char *storagePath)
         // https://developer.apple.com/documentation/virtualization/vzmacauxiliarystorage?language=objc
         return [[VZMacAuxiliaryStorage alloc] initWithContentsOfURL:storageURL];
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -80,10 +82,11 @@ void *newVZMacAuxiliaryStorage(const char *storagePath)
 */
 void *newVZMacPlatformConfiguration()
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         return [[VZMacPlatformConfiguration alloc] init];
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -92,17 +95,19 @@ void *newVZMacPlatformConfiguration()
  */
 void setHardwareModelVZMacPlatformConfiguration(void *config, void *hardwareModel)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         [(VZMacPlatformConfiguration *)config setHardwareModel:(VZMacHardwareModel *)hardwareModel];
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
 // Store the hardware model to disk so that we can retrieve them for subsequent boots.
 void storeHardwareModelDataVZMacPlatformConfiguration(void *config, const char *filePath)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         VZMacPlatformConfiguration *macPlatformConfiguration = (VZMacPlatformConfiguration *)config;
         NSString *filePathNSString = [NSString stringWithUTF8String:filePath];
@@ -110,7 +115,7 @@ void storeHardwareModelDataVZMacPlatformConfiguration(void *config, const char *
         [macPlatformConfiguration.hardwareModel.dataRepresentation writeToURL:fileURL atomically:YES];
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -121,17 +126,19 @@ void storeHardwareModelDataVZMacPlatformConfiguration(void *config, const char *
  */
 void setMachineIdentifierVZMacPlatformConfiguration(void *config, void *machineIdentifier)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         [(VZMacPlatformConfiguration *)config setMachineIdentifier:(VZMacMachineIdentifier *)machineIdentifier];
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
 // Store the machine identifier to disk so that we can retrieve them for subsequent boots.
 void storeMachineIdentifierDataVZMacPlatformConfiguration(void *config, const char *filePath)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         VZMacPlatformConfiguration *macPlatformConfiguration = (VZMacPlatformConfiguration *)config;
         NSString *filePathNSString = [NSString stringWithUTF8String:filePath];
@@ -139,7 +146,7 @@ void storeMachineIdentifierDataVZMacPlatformConfiguration(void *config, const ch
         [macPlatformConfiguration.machineIdentifier.dataRepresentation writeToURL:fileURL atomically:YES];
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -151,11 +158,12 @@ void storeMachineIdentifierDataVZMacPlatformConfiguration(void *config, const ch
  */
 void setAuxiliaryStorageVZMacPlatformConfiguration(void *config, void *auxiliaryStorage)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         [(VZMacPlatformConfiguration *)config setAuxiliaryStorage:(VZMacAuxiliaryStorage *)auxiliaryStorage];
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -169,10 +177,11 @@ void setAuxiliaryStorageVZMacPlatformConfiguration(void *config, void *auxiliary
 */
 void *newVZMacOSBootLoader()
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         return [[VZMacOSBootLoader alloc] init];
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -182,10 +191,11 @@ void *newVZMacOSBootLoader()
 */
 void *newVZMacGraphicsDeviceConfiguration()
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         return [[VZMacGraphicsDeviceConfiguration alloc] init];
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -194,11 +204,12 @@ void *newVZMacGraphicsDeviceConfiguration()
 */
 void setDisplaysVZMacGraphicsDeviceConfiguration(void *graphicsConfiguration, void *displays)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         [(VZMacGraphicsDeviceConfiguration *)graphicsConfiguration setDisplays:[(NSMutableArray *)displays copy]];
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -210,13 +221,14 @@ void setDisplaysVZMacGraphicsDeviceConfiguration(void *graphicsConfiguration, vo
 */
 void *newVZMacGraphicsDisplayConfiguration(NSInteger widthInPixels, NSInteger heightInPixels, NSInteger pixelsPerInch)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         return [[VZMacGraphicsDisplayConfiguration alloc]
             initWithWidthInPixels:widthInPixels
                    heightInPixels:heightInPixels
                     pixelsPerInch:pixelsPerInch];
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -226,6 +238,7 @@ void *newVZMacGraphicsDisplayConfiguration(NSInteger widthInPixels, NSInteger he
  */
 void *newVZMacHardwareModelWithPath(const char *hardwareModelPath)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         VZMacHardwareModel *hardwareModel;
         NSString *hardwareModelPathNSString = [NSString stringWithUTF8String:hardwareModelPath];
@@ -236,12 +249,13 @@ void *newVZMacHardwareModelWithPath(const char *hardwareModelPath)
         }
         return hardwareModel;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
 void *newVZMacHardwareModelWithBytes(void *hardwareModelBytes, int len)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         VZMacHardwareModel *hardwareModel;
         @autoreleasepool {
@@ -250,7 +264,7 @@ void *newVZMacHardwareModelWithBytes(void *hardwareModelBytes, int len)
         }
         return hardwareModel;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -259,10 +273,11 @@ void *newVZMacHardwareModelWithBytes(void *hardwareModelBytes, int len)
  */
 void *newVZMacMachineIdentifier()
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         return [[VZMacMachineIdentifier alloc] init];
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -274,6 +289,7 @@ void *newVZMacMachineIdentifier()
  */
 void *newVZMacMachineIdentifierWithPath(const char *machineIdentifierPath)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         VZMacMachineIdentifier *machineIdentifier;
         NSString *machineIdentifierPathNSString = [NSString stringWithUTF8String:machineIdentifierPath];
@@ -284,12 +300,13 @@ void *newVZMacMachineIdentifierWithPath(const char *machineIdentifierPath)
         }
         return machineIdentifier;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
 void *newVZMacMachineIdentifierWithBytes(void *machineIdentifierBytes, int len)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         VZMacMachineIdentifier *machineIdentifier;
         @autoreleasepool {
@@ -298,12 +315,13 @@ void *newVZMacMachineIdentifierWithBytes(void *machineIdentifierBytes, int len)
         }
         return machineIdentifier;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
 nbyteslice getVZMacMachineIdentifierDataRepresentation(void *machineIdentifierPtr)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         VZMacMachineIdentifier *machineIdentifier = (VZMacMachineIdentifier *)machineIdentifierPtr;
         NSData *data = [machineIdentifier dataRepresentation];
@@ -313,12 +331,13 @@ nbyteslice getVZMacMachineIdentifierDataRepresentation(void *machineIdentifierPt
         };
         return ret;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
 VZMacOSRestoreImageStruct convertVZMacOSRestoreImage2Struct(void *restoreImagePtr)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         VZMacOSRestoreImage *restoreImage = (VZMacOSRestoreImage *)restoreImagePtr;
         VZMacOSRestoreImageStruct ret;
@@ -329,12 +348,13 @@ VZMacOSRestoreImageStruct convertVZMacOSRestoreImage2Struct(void *restoreImagePt
         ret.mostFeaturefulSupportedConfiguration = (void *)CFBridgingRetain([restoreImage mostFeaturefulSupportedConfiguration]);
         return ret;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
 void fetchLatestSupportedMacOSRestoreImageWithCompletionHandler(void *cgoHandler)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         [VZMacOSRestoreImage fetchLatestSupportedWithCompletionHandler:^(VZMacOSRestoreImage *restoreImage, NSError *error) {
             VZMacOSRestoreImageStruct restoreImageStruct = convertVZMacOSRestoreImage2Struct(restoreImage);
@@ -342,12 +362,13 @@ void fetchLatestSupportedMacOSRestoreImageWithCompletionHandler(void *cgoHandler
         }];
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
 void loadMacOSRestoreImageFile(const char *ipswPath, void *cgoHandler)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         NSString *ipswPathNSString = [NSString stringWithUTF8String:ipswPath];
         NSURL *ipswURL = [NSURL fileURLWithPath:ipswPathNSString];
@@ -358,12 +379,13 @@ void loadMacOSRestoreImageFile(const char *ipswPath, void *cgoHandler)
                        }];
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
 VZMacOSConfigurationRequirementsStruct convertVZMacOSConfigurationRequirements2Struct(void *requirementsPtr)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         VZMacOSConfigurationRequirements *requirements = (VZMacOSConfigurationRequirements *)requirementsPtr;
         VZMacOSConfigurationRequirementsStruct ret;
@@ -373,12 +395,13 @@ VZMacOSConfigurationRequirementsStruct convertVZMacOSConfigurationRequirements2S
         ret.hardwareModel = (void *)CFBridgingRetain([requirements hardwareModel]);
         return ret;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
 VZMacHardwareModelStruct convertVZMacHardwareModel2Struct(void *hardwareModelPtr)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         VZMacHardwareModel *hardwareModel = (VZMacHardwareModel *)hardwareModelPtr;
         VZMacHardwareModelStruct ret;
@@ -391,7 +414,7 @@ VZMacHardwareModelStruct convertVZMacHardwareModel2Struct(void *hardwareModelPtr
         ret.dataRepresentation = retByteSlice;
         return ret;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -405,6 +428,7 @@ VZMacHardwareModelStruct convertVZMacHardwareModel2Struct(void *hardwareModelPtr
  */
 void *newVZMacOSInstaller(void *virtualMachine, void *vmQueue, const char *restoreImageFilePath)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         __block VZMacOSInstaller *ret;
         NSString *restoreImageFilePathNSString = [NSString stringWithUTF8String:restoreImageFilePath];
@@ -414,7 +438,7 @@ void *newVZMacOSInstaller(void *virtualMachine, void *vmQueue, const char *resto
         });
         return ret;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -425,6 +449,7 @@ void *newProgressObserverVZMacOSInstaller()
 
 void installByVZMacOSInstaller(void *installerPtr, void *vmQueue, void *progressObserverPtr, void *completionHandler, void *fractionCompletedHandler)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         VZMacOSInstaller *installer = (VZMacOSInstaller *)installerPtr;
         dispatch_sync((dispatch_queue_t)vmQueue, ^{
@@ -439,12 +464,13 @@ void installByVZMacOSInstaller(void *installerPtr, void *vmQueue, void *progress
         });
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
 void cancelInstallVZMacOSInstaller(void *installerPtr)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         VZMacOSInstaller *installer = (VZMacOSInstaller *)installerPtr;
         if (installer.progress.cancellable) {
@@ -452,7 +478,7 @@ void cancelInstallVZMacOSInstaller(void *installerPtr)
         }
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
diff --git a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_debug.m b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_debug.m
index 67fe356ae..af81a46b0 100644
--- a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_debug.m
+++ b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_debug.m
@@ -12,10 +12,11 @@
 */
 void *newVZGDBDebugStubConfiguration(uint32_t port)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         return [[_VZGDBDebugStubConfiguration alloc] initWithPort:(NSInteger)port];
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
 
@@ -24,10 +25,11 @@ void *newVZGDBDebugStubConfiguration(uint32_t port)
 */
 void setDebugStubVZVirtualMachineConfiguration(void *config, void *debugStub)
 {
+#ifdef INCLUDE_TARGET_OSX_12
     if (@available(macOS 12, *)) {
         [(VZVirtualMachineConfiguration *)config _setDebugStub:(_VZDebugStubConfiguration *)debugStub];
         return;
     }
-
+#endif
     RAISE_UNSUPPORTED_MACOS_EXCEPTION();
 }
\ No newline at end of file
diff --git a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_helper.h b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_helper.h
index 995b40882..9da0700b9 100644
--- a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_helper.h
+++ b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_helper.h
@@ -18,6 +18,13 @@ NSDictionary *dumpProcessinfo();
         __builtin_unreachable();                              \
     } while (0)
 
+// for macOS 12 API
+#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 120000
+#define INCLUDE_TARGET_OSX_12 1
+#else
+#pragma message("macOS 12 API has been disabled")
+#endif
+
 // for macOS 12.3 API
 #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 120300
 #define INCLUDE_TARGET_OSX_12_3 1
diff --git a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_view.h b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_view.h
index ab00b9225..15d306f66 100644
--- a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_view.h
+++ b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_view.h
@@ -23,9 +23,11 @@
 - (instancetype)init;
 @end
 
+#ifdef INCLUDE_TARGET_OSX_12
 API_AVAILABLE(macos(12.0))
 @interface AppDelegate : NSObject <NSApplicationDelegate, NSWindowDelegate, VZVirtualMachineDelegate>
 - (instancetype)initWithVirtualMachine:(VZVirtualMachine *)virtualMachine
                            windowWidth:(CGFloat)windowWidth
                           windowHeight:(CGFloat)windowHeight;
-@end
\ No newline at end of file
+@end
+#endif
\ No newline at end of file
diff --git a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_view.m b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_view.m
index 9031c44f1..33b20d91b 100644
--- a/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_view.m
+++ b/src/cmd/linuxkit/vendor/github.com/Code-Hex/vz/v3/virtualization_view.m
@@ -165,6 +165,7 @@
 
 @end
 
+#ifdef INCLUDE_TARGET_OSX_12
 @implementation AppDelegate {
     VZVirtualMachine *_virtualMachine;
     VZVirtualMachineView *_virtualMachineView;
@@ -372,3 +373,4 @@
     [aboutPanel makeKeyAndOrderFront:nil];
 }
 @end
+#endif