authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-01-08 18:48:10-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-01-08 18:48:10-07:00
log8c9efc95a1892276fee910546a019bee37b3726d
tree0f7eab9dcd8339d72a77ba630d810ebf9e3e52ed
parent0e856da224d05816385550e292d97bc50985c2ff

langref: update target section

* remove outdated information * add new information closes #17032 closes #17044

1 files changed, 26 insertions(+), 254 deletions(-)

doc/langref.html.in+26-254
......@@ -11460,260 +11460,32 @@ pub fn main() !void {
1146011460 {#header_close#}
1146111461 {#header_open|Targets#}
1146211462 <p>
11463 Zig supports generating code for all targets that LLVM supports. Here is
11464 what it looks like to execute <code>zig targets</code> on a Linux x86_64
11465 computer:
11466 </p>
11467 {#shell_samp#}$ zig targets
11468Architectures:
11469 arm
11470 v8_4a
11471 v8_3a
11472 v8_2a
11473 v8_1a
11474 v8
11475 v8r
11476 v8m_baseline
11477 v8m_mainline
11478 v7
11479 v7em
11480 v7m
11481 v7s
11482 v7k
11483 v7ve
11484 v6
11485 v6m
11486 v6k
11487 v6t2
11488 v5
11489 v5te
11490 v4t
11491 armeb
11492 v8_4a
11493 v8_3a
11494 v8_2a
11495 v8_1a
11496 v8
11497 v8r
11498 v8m_baseline
11499 v8m_mainline
11500 v7
11501 v7em
11502 v7m
11503 v7s
11504 v7k
11505 v7ve
11506 v6
11507 v6m
11508 v6k
11509 v6t2
11510 v5
11511 v5te
11512 v4t
11513 aarch64
11514 v8_4a
11515 v8_3a
11516 v8_2a
11517 v8_1a
11518 v8
11519 v8r
11520 v8m_baseline
11521 v8m_mainline
11522 aarch64_be
11523 v8_4a
11524 v8_3a
11525 v8_2a
11526 v8_1a
11527 v8
11528 v8r
11529 v8m_baseline
11530 v8m_mainline
11531 avr
11532 bpfel
11533 bpfeb
11534 hexagon
11535 mips
11536 mipsel
11537 mips64
11538 mips64el
11539 msp430
11540 powerpc
11541 powerpc64
11542 powerpc64le
11543 r600
11544 amdgcn
11545 riscv32
11546 riscv64
11547 sparc
11548 sparc64
11549 sparcel
11550 s390x
11551 thumb
11552 v8_4a
11553 v8_3a
11554 v8_2a
11555 v8_1a
11556 v8
11557 v8r
11558 v8m_baseline
11559 v8m_mainline
11560 v7
11561 v7em
11562 v7m
11563 v7s
11564 v7k
11565 v7ve
11566 v6
11567 v6m
11568 v6k
11569 v6t2
11570 v5
11571 v5te
11572 v4t
11573 thumbeb
11574 v8_4a
11575 v8_3a
11576 v8_2a
11577 v8_1a
11578 v8
11579 v8r
11580 v8m_baseline
11581 v8m_mainline
11582 v7
11583 v7em
11584 v7m
11585 v7s
11586 v7k
11587 v7ve
11588 v6
11589 v6m
11590 v6k
11591 v6t2
11592 v5
11593 v5te
11594 v4t
11595 x86
11596 x86_64 (native)
11597 xcore
11598 nvptx
11599 nvptx64
11600 lanai
11601 wasm32
11602 wasm64
11603
11604Operating Systems:
11605 freestanding
11606 ananas
11607 cloudabi
11608 dragonfly
11609 freebsd
11610 fuchsia
11611 ios
11612 kfreebsd
11613 linux (native)
11614 lv2
11615 macos
11616 netbsd
11617 openbsd
11618 solaris
11619 windows
11620 haiku
11621 minix
11622 rtems
11623 nacl
11624 cnk
11625 aix
11626 cuda
11627 nvcl
11628 amdhsa
11629 ps4
11630 elfiamcu
11631 tvos
11632 wasi
11633 watchos
11634 mesa3d
11635 contiki
11636 amdpal
11637 zen
11638 uefi
11639
11640C ABIs:
11641 none
11642 gnu (native)
11643 gnuabin32
11644 gnuabi64
11645 gnueabi
11646 gnueabihf
11647 gnux32
11648 code16
11649 eabi
11650 eabihf
11651 android
11652 musl
11653 musleabi
11654 musleabihf
11655 msvc
11656 itanium
11657 cygnus
11658 coreclr
11659 simulator
11660
11661Available libcs:
11662 aarch64_be-linux-gnu
11663 aarch64_be-linux-musl
11664 aarch64-linux-gnu
11665 aarch64-linux-musleabi
11666 armeb-linux-gnueabi
11667 armeb-linux-gnueabihf
11668 armeb-linux-musleabi
11669 armeb-linux-musleabihf
11670 arm-linux-gnueabi
11671 arm-linux-gnueabihf
11672 arm-linux-musleabi
11673 arm-linux-musleabihf
11674 x86-linux-gnu
11675 x86-linux-musl
11676 mips64el-linux-gnuabi64
11677 mips64el-linux-gnuabin32
11678 mips64el-linux-musl
11679 mips64-linux-gnuabi64
11680 mips64-linux-gnuabin32
11681 mips64-linux-musl
11682 mipsel-linux-gnu
11683 mipsel-linux-musl
11684 mips-linux-gnu
11685 mips-linux-musl
11686 nios2-linux-gnu
11687 powerpc64le-linux-gnu
11688 powerpc64le-linux-musl
11689 powerpc64-linux-gnu
11690 powerpc64-linux-musl
11691 powerpc-linux-gnu
11692 powerpc-linux-musl
11693 riscv32-linux-musl
11694 riscv64-linux-gnu
11695 riscv64-linux-musl
11696 s390x-linux-gnu
11697 s390x-linux-musl
11698 sparc-linux-gnu
11699 sparc64-linux-gnu
11700 wasm32-freestanding-musl
11701 wasm32-wasi-musl
11702 x86_64-linux-gnu
11703 x86_64-linux-gnux32
11704 x86_64-linux-musl{#end_shell_samp#}
11705 <p>
11706 The Zig Standard Library ({#syntax#}@import("std"){#endsyntax#}) has architecture, environment, and operating system
11707 abstractions, and thus takes additional work to support more platforms.
11708 Not all standard library code requires operating system abstractions, however,
11709 so things such as generic data structures work on all above platforms.
11710 </p>
11711 <p>The current list of targets supported by the Zig Standard Library is:</p>
11712 <ul>
11713 <li>Linux x86_64</li>
11714 <li>Windows x86_64</li>
11715 <li>macOS x86_64</li>
11716 </ul>
11463 <strong>Target</strong> refers to the computer that will be used to run an executable.
11464 It is composed of the CPU architecture, the set of enabled CPU features, operating system,
11465 minimum and maximum operating system version, ABI, and ABI version.
11466 </p>
11467 <p>
11468 Zig is a general-purpose programming language which means that it is designed to
11469 generate optimal code for a large set of targets. The command <code>zig targets</code>
11470 provides information about all of the targets the compiler is aware of.</p>
11471 <p>When no target option is provided to the compiler, the default choice
11472 is to target the <strong>host computer</strong>, meaning that the
11473 resulting executable will be <em>unsuitable for copying to a different
11474 computer</em>. In order to copy an executable to another computer, the compiler
11475 needs to know about the target requirements via the <code>-target</code> option.
11476 </p>
11477 <p>
11478 The Zig Standard Library ({#syntax#}@import("std"){#endsyntax#}) has
11479 cross-platform abstractions, making the same source code viable on many targets.
11480 Some code is more portable than other code. In general, Zig code is extremely
11481 portable compared to other programming languages.
11482 </p>
11483 <p>
11484 Each platform requires its own implementations to make Zig's
11485 cross-platform abstractions work. These implementations are at various
11486 degrees of completion. Each tagged release of the compiler comes with
11487 release notes that provide the full support table for each target.
11488 </p>
1171711489 {#header_close#}
1171811490 {#header_open|Style Guide#}
1171911491 <p>