qemu 0.1.10

QEMU binary and utility installer
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
//! Qemu library!
//!
//! This library provides a way to access QEMU binaries for all supported architectures
//! from rust code by wrapping the QEMU build system and then giving you binaries as
//! big constant byte arrays. Stay with me, this is a good way to do this! For example,
//! if you want to distributed a QEMU plugin written in rust, you can use this library
//! to build a plugin-supported QEMU binary and distribute it directly along with your
//! plugin as a rust crate.
//!
//! For very simple examples, see the crates named `qemu-<arch>` in this workspace, such as:
//! * `qemu-x86_64`: https://crates.io/crates/qemu-x86_64
//!
//! In addition, if you want to do wild stuff that "doesn't circumvent the GPL", you can build
//! a debug binary, use something like [goblin](https://github.com/m4b/goblin) to figure out
//! where to hook, bytepatch the binary, then run it with your hooks. Is that insane? Maybe,
//! but you can do it, and it's a lot more efficient to just have the binary as bytes to
//! do so.
//!
//! Why not just build executables? Well, good question. There are executables, but they are
//! distributed as separate binary crates depending on this one. See the `qemu-<arch>` crates
//! in this workspace for more information.
//!
//! To use, just configure your feature flags appropriately (see the README) and then use
//! one of the `qemu_<arch>` functions here to obtain your binary. Then, you can either
//! write it to disk and run it, or you can be very efficient and use something like
//! [memfd-exec](https://crates.io/crates/memfd-exec) to run it from memory directly, or on
//! a separate thread, whatever!

#[cfg(feature = "qemu-system-aarch64")]
/// Returns the qemu-system-aarch64 binary
pub fn qemu_system_aarch64() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-aarch64"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-alpha")]
/// Returns the qemu-system-alpha binary
pub fn qemu_system_alpha() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-alpha"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-arm")]
/// Returns the qemu-system-arm binary
pub fn qemu_system_arm() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-arm"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-avr")]
/// Returns the qemu-system-avr binary
pub fn qemu_system_avr() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-avr"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-cris")]
/// Returns the qemu-system-cris binary
pub fn qemu_system_cris() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-cris"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-hppa")]
/// Returns the qemu-system-hppa binary
pub fn qemu_system_hppa() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-hppa"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-i386")]
/// Returns the qemu-system-i386 binary
pub fn qemu_system_i386() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-i386"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-loongarch64")]
/// Returns the qemu-system-loongarch64 binary
pub fn qemu_system_loongarch64() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-loongarch64"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-m68k")]
/// Returns the qemu-system-m68k binary
pub fn qemu_system_m68k() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-m68k"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-microblazeel")]
/// Returns the qemu-system-microblazeel binary
pub fn qemu_system_microblazeel() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-microblazeel"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-microblaze")]
/// Returns the qemu-system-microblaze binary
pub fn qemu_system_microblaze() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-microblaze"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-mips64el")]
/// Returns the qemu-system-mips64el binary
pub fn qemu_system_mips64el() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-mips64el"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-mips64")]
/// Returns the qemu-system-mips64 binary
pub fn qemu_system_mips64() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-mips64"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-mipsel")]
/// Returns the qemu-system-mipsel binary
pub fn qemu_system_mipsel() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-mipsel"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-mips")]
/// Returns the qemu-system-mips binary
pub fn qemu_system_mips() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-mips"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-nios2")]
/// Returns the qemu-system-nios2 binary
pub fn qemu_system_nios2() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-nios2"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-or1k")]
/// Returns the qemu-system-or1k binary
pub fn qemu_system_or1k() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-or1k"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-ppc64")]
/// Returns the qemu-system-ppc64 binary
pub fn qemu_system_ppc64() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-ppc64"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-ppc")]
/// Returns the qemu-system-ppc binary
pub fn qemu_system_ppc() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-ppc"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-riscv32")]
/// Returns the qemu-system-riscv32 binary
pub fn qemu_system_riscv32() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-riscv32"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-riscv64")]
/// Returns the qemu-system-riscv64 binary
pub fn qemu_system_riscv64() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-riscv64"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-rx")]
/// Returns the qemu-system-rx binary
pub fn qemu_system_rx() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-rx"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-s390x")]
/// Returns the qemu-system-s390x binary
pub fn qemu_system_s390x() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-s390x"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-sh4eb")]
/// Returns the qemu-system-sh4eb binary
pub fn qemu_system_sh4eb() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-sh4eb"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-sh4")]
/// Returns the qemu-system-sh4 binary
pub fn qemu_system_sh4() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-sh4"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-sparc64")]
/// Returns the qemu-system-sparc64 binary
pub fn qemu_system_sparc64() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-sparc64"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-sparc")]
/// Returns the qemu-system-sparc binary
pub fn qemu_system_sparc() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-sparc"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-tricore")]
/// Returns the qemu-system-tricore binary
pub fn qemu_system_tricore() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-tricore"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-x86_64")]
/// Returns the qemu-system-x86_64 binary
pub fn qemu_system_x86_64() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-x86_64"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-xtensaeb")]
/// Returns the qemu-system-xtensaeb binary
pub fn qemu_system_xtensaeb() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-xtensaeb"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-system-xtensa")]
/// Returns the qemu-system-xtensa binary
pub fn qemu_system_xtensa() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-system-xtensa"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-aarch64_be")]
/// Returns the qemu-aarch64_be binary
pub fn qemu_aarch64_be() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-aarch64_be"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-aarch64")]
/// Returns the qemu-aarch64 binary
pub fn qemu_aarch64() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-aarch64"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-alpha")]
/// Returns the qemu-alpha binary
pub fn qemu_alpha() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-alpha"));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-armeb")]
/// Returns the qemu-armeb binary
pub fn qemu_armeb() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-armeb"));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-arm")]
/// Returns the qemu-arm binary
pub fn qemu_arm() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-arm"));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-cris")]
/// Returns the qemu-cris binary
pub fn qemu_cris() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-cris"));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-hexagon")]
/// Returns the qemu-hexagon binary
pub fn qemu_hexagon() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-hexagon"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-hppa")]
/// Returns the qemu-hppa binary
pub fn qemu_hppa() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-hppa"));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-i386")]
/// Returns the qemu-i386 binary
pub fn qemu_i386() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-i386"));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-loongarch64")]
/// Returns the qemu-loongarch64 binary
pub fn qemu_loongarch64() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-loongarch64"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-m68k")]
/// Returns the qemu-m68k binary
pub fn qemu_m68k() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-m68k"));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-microblazeel")]
/// Returns the qemu-microblazeel binary
pub fn qemu_microblazeel() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-microblazeel"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-microblaze")]
/// Returns the qemu-microblaze binary
pub fn qemu_microblaze() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-microblaze"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-mips64el")]
/// Returns the qemu-mips64el binary
pub fn qemu_mips64el() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-mips64el"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-mips64")]
/// Returns the qemu-mips64 binary
pub fn qemu_mips64() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-mips64"));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-mipsel")]
/// Returns the qemu-mipsel binary
pub fn qemu_mipsel() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-mipsel"));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-mips")]
/// Returns the qemu-mips binary
pub fn qemu_mips() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-mips"));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-mipsn32el")]
/// Returns the qemu-mipsn32el binary
pub fn qemu_mipsn32el() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-mipsn32el"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-mipsn32")]
/// Returns the qemu-mipsn32 binary
pub fn qemu_mipsn32() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-mipsn32"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-nios2")]
/// Returns the qemu-nios2 binary
pub fn qemu_nios2() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-nios2"));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-or1k")]
/// Returns the qemu-or1k binary
pub fn qemu_or1k() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-or1k"));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-ppc64le")]
/// Returns the qemu-ppc64le binary
pub fn qemu_ppc64le() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-ppc64le"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-ppc64")]
/// Returns the qemu-ppc64 binary
pub fn qemu_ppc64() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-ppc64"));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-ppc")]
/// Returns the qemu-ppc binary
pub fn qemu_ppc() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-ppc"));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-riscv32")]
/// Returns the qemu-riscv32 binary
pub fn qemu_riscv32() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-riscv32"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-riscv64")]
/// Returns the qemu-riscv64 binary
pub fn qemu_riscv64() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-riscv64"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-s390x")]
/// Returns the qemu-s390x binary
pub fn qemu_s390x() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-s390x"));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-sh4eb")]
/// Returns the qemu-sh4eb binary
pub fn qemu_sh4eb() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-sh4eb"));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-sh4")]
/// Returns the qemu-sh4 binary
pub fn qemu_sh4() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-sh4"));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-sparc32plus")]
/// Returns the qemu-sparc32plus binary
pub fn qemu_sparc32plus() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-sparc32plus"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-sparc64")]
/// Returns the qemu-sparc64 binary
pub fn qemu_sparc64() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-sparc64"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-sparc")]
/// Returns the qemu-sparc binary
pub fn qemu_sparc() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-sparc"));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-x86_64")]
/// Returns the qemu-x86_64 binary
pub fn qemu_x86_64() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-x86_64"));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-xtensaeb")]
/// Returns the qemu-xtensaeb binary
pub fn qemu_xtensaeb() -> Vec<u8> {
    pub const PROGRAM: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/bin",
        "/qemu-xtensaeb"
    ));
    PROGRAM.to_vec()
}

#[cfg(feature = "qemu-xtensa")]
/// Returns the qemu-xtensa binary
pub fn qemu_xtensa() -> Vec<u8> {
    pub const PROGRAM: &[u8] =
        include_bytes!(concat!(env!("OUT_DIR"), "/install", "/bin", "/qemu-xtensa"));
    PROGRAM.to_vec()
}

pub fn include_qemu_plugin_h() -> Vec<u8> {
    pub const INCLUDE: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/install",
        "/include",
        "/qemu-plugin.h"
    ));
    INCLUDE.to_vec()
}

/// This function is exported only to use to include the qemu-plugin.h header without
/// having to build and install qemu. For all real usages you should use `include_qemu_plugin_h`
pub fn __unbuilt_qemu_plugin_h() -> Vec<u8> {
    pub const INCLUDE: &[u8] = include_bytes!(concat!(
        env!("OUT_DIR"),
        "/qemu",
        "/include",
        "/qemu",
        "/qemu-plugin.h"
    ));
    INCLUDE.to_vec()
}