| author | |
| committer | |
| log | 23c263776c448a7ffc7e03d1b8528a4b5761f289 |
| tree | ae5e59800427ce54ba36f0ef1ece96d36131eaf9 |
| parent | 53b5aa812bd9c0229054121a1c196c9b18994d64 |
| parent | a8fa1ecd89eebd444736d73da4ebf24af74daea8 |
| signature | Commit is signed but in an unrecognized format. |
29 files changed, 459 insertions(+), 93 deletions(-)
CMakeLists.txt-1| ... | ... | @@ -430,7 +430,6 @@ set(BUILD_LIBSTAGE2_ARGS "build-lib" |
| 430 | 430 | --cache on |
| 431 | 431 | --output-dir "${CMAKE_BINARY_DIR}" |
| 432 | 432 | ${LIBSTAGE2_RELEASE_ARG} |
| 433 | --disable-gen-h | |
| 434 | 433 | --bundle-compiler-rt |
| 435 | 434 | -fPIC |
| 436 | 435 | -lc |
build.zig+2-1| ... | ... | @@ -135,7 +135,8 @@ pub fn build(b: *Builder) !void { |
| 135 | 135 | test_step.dependOn(tests.addRuntimeSafetyTests(b, test_filter, modes)); |
| 136 | 136 | test_step.dependOn(tests.addTranslateCTests(b, test_filter)); |
| 137 | 137 | test_step.dependOn(tests.addRunTranslatedCTests(b, test_filter)); |
| 138 | test_step.dependOn(tests.addGenHTests(b, test_filter)); | |
| 138 | // tests for this feature are disabled until we have the self-hosted compiler available | |
| 139 | //test_step.dependOn(tests.addGenHTests(b, test_filter)); | |
| 139 | 140 | test_step.dependOn(tests.addCompileErrorTests(b, test_filter, modes)); |
| 140 | 141 | test_step.dependOn(docs_step); |
| 141 | 142 | } |
ci/drone/linux_script+2-1| ... | ... | @@ -26,7 +26,8 @@ make -j$(nproc) install |
| 26 | 26 | # TODO test-cli is hitting https://github.com/ziglang/zig/issues/3526 |
| 27 | 27 | ./zig build test-asm-link test-runtime-safety |
| 28 | 28 | # TODO test-translate-c is hitting https://github.com/ziglang/zig/issues/3526 |
| 29 | ./zig build test-gen-h | |
| 29 | # TODO disabled until we are shipping self-hosted | |
| 30 | #./zig build test-gen-h | |
| 30 | 31 | # TODO test-compile-errors is hitting https://github.com/ziglang/zig/issues/3526 |
| 31 | 32 | # TODO building docs is hitting https://github.com/ziglang/zig/issues/3526 |
| 32 | 33 |
ci/srht/freebsd_script+2-1| ... | ... | @@ -42,7 +42,8 @@ release/bin/zig build test-asm-link |
| 42 | 42 | release/bin/zig build test-runtime-safety |
| 43 | 43 | release/bin/zig build test-translate-c |
| 44 | 44 | release/bin/zig build test-run-translated-c |
| 45 | release/bin/zig build test-gen-h | |
| 45 | # TODO disabled until we are shipping self-hosted | |
| 46 | #release/bin/zig build test-gen-h | |
| 46 | 47 | release/bin/zig build test-compile-errors |
| 47 | 48 | release/bin/zig build docs |
| 48 | 49 |
lib/libc/glibc/abi.txt+135| ... | ... | @@ -193,6 +193,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu |
| 193 | 193 | |
| 194 | 194 | |
| 195 | 195 | 29 |
| 196 | ||
| 196 | 197 | 29 |
| 197 | 198 | |
| 198 | 199 | 29 |
| ... | ... | @@ -514,6 +515,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu |
| 514 | 515 | 29 |
| 515 | 516 | 29 |
| 516 | 517 | 29 |
| 518 | 29 | |
| 517 | 519 | |
| 518 | 520 | 29 |
| 519 | 521 | |
| ... | ... | @@ -697,6 +699,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu |
| 697 | 699 | 29 |
| 698 | 700 | 29 |
| 699 | 701 | 29 |
| 702 | ||
| 700 | 703 | 29 |
| 701 | 704 | 29 |
| 702 | 705 | 29 |
| ... | ... | @@ -819,6 +822,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu |
| 819 | 822 | 29 |
| 820 | 823 | 29 |
| 821 | 824 | 29 |
| 825 | 29 | |
| 822 | 826 | |
| 823 | 827 | 29 |
| 824 | 828 | 29 |
| ... | ... | @@ -904,6 +908,9 @@ aarch64-linux-gnu aarch64_be-linux-gnu |
| 904 | 908 | 29 |
| 905 | 909 | 29 |
| 906 | 910 | 29 |
| 911 | 29 | |
| 912 | ||
| 913 | ||
| 907 | 914 | 29 |
| 908 | 915 | 29 |
| 909 | 916 | 29 |
| ... | ... | @@ -1004,6 +1011,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu |
| 1004 | 1011 | 29 |
| 1005 | 1012 | 29 |
| 1006 | 1013 | 29 |
| 1014 | 29 | |
| 1007 | 1015 | |
| 1008 | 1016 | 29 |
| 1009 | 1017 | 29 |
| ... | ... | @@ -1033,6 +1041,7 @@ aarch64-linux-gnu aarch64_be-linux-gnu |
| 1033 | 1041 | 29 |
| 1034 | 1042 | 29 |
| 1035 | 1043 | 29 |
| 1044 | 29 | |
| 1036 | 1045 | |
| 1037 | 1046 | 29 |
| 1038 | 1047 | 29 |
| ... | ... | @@ -3920,6 +3929,7 @@ s390x-linux-gnu |
| 3920 | 3929 | |
| 3921 | 3930 | |
| 3922 | 3931 | 5 |
| 3932 | ||
| 3923 | 3933 | 27 |
| 3924 | 3934 | |
| 3925 | 3935 | 27 |
| ... | ... | @@ -4241,6 +4251,7 @@ s390x-linux-gnu |
| 4241 | 4251 | 5 |
| 4242 | 4252 | 5 |
| 4243 | 4253 | 5 |
| 4254 | 5 | |
| 4244 | 4255 | 11 |
| 4245 | 4256 | 27 |
| 4246 | 4257 | |
| ... | ... | @@ -4424,6 +4435,7 @@ s390x-linux-gnu |
| 4424 | 4435 | 19 |
| 4425 | 4436 | 19 |
| 4426 | 4437 | 5 |
| 4438 | ||
| 4427 | 4439 | 5 |
| 4428 | 4440 | 5 |
| 4429 | 4441 | 28 |
| ... | ... | @@ -4543,6 +4555,7 @@ s390x-linux-gnu |
| 4543 | 4555 | 27 |
| 4544 | 4556 | |
| 4545 | 4557 | 16 |
| 4558 | ||
| 4546 | 4559 | 5 |
| 4547 | 4560 | 5 |
| 4548 | 4561 | 15 |
| ... | ... | @@ -4631,6 +4644,9 @@ s390x-linux-gnu |
| 4631 | 4644 | 16 |
| 4632 | 4645 | 5 |
| 4633 | 4646 | 5 |
| 4647 | ||
| 4648 | ||
| 4649 | 12 | |
| 4634 | 4650 | 5 |
| 4635 | 4651 | 5 |
| 4636 | 4652 | 5 |
| ... | ... | @@ -4731,6 +4747,7 @@ s390x-linux-gnu |
| 4731 | 4747 | 5 |
| 4732 | 4748 | 5 |
| 4733 | 4749 | 5 |
| 4750 | 5 | |
| 4734 | 4751 | |
| 4735 | 4752 | 5 |
| 4736 | 4753 | 5 |
| ... | ... | @@ -4756,6 +4773,7 @@ s390x-linux-gnu |
| 4756 | 4773 | 5 |
| 4757 | 4774 | 5 |
| 4758 | 4775 | 5 |
| 4776 | 5 | |
| 4759 | 4777 | 31 5 |
| 4760 | 4778 | 24 5 12 16 |
| 4761 | 4779 | 24 5 12 16 |
| ... | ... | @@ -7645,6 +7663,7 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf |
| 7645 | 7663 | |
| 7646 | 7664 | |
| 7647 | 7665 | |
| 7666 | ||
| 7648 | 7667 | |
| 7649 | 7668 | |
| 7650 | 7669 | 27 |
| ... | ... | @@ -7968,6 +7987,7 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf |
| 7968 | 7987 | 16 |
| 7969 | 7988 | 16 |
| 7970 | 7989 | 16 |
| 7990 | 16 | |
| 7971 | 7991 | |
| 7972 | 7992 | 27 |
| 7973 | 7993 | |
| ... | ... | @@ -8151,6 +8171,7 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf |
| 8151 | 8171 | 19 |
| 8152 | 8172 | 19 |
| 8153 | 8173 | 16 |
| 8174 | ||
| 8154 | 8175 | 16 |
| 8155 | 8176 | 16 |
| 8156 | 8177 | 28 |
| ... | ... | @@ -8273,6 +8294,7 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf |
| 8273 | 8294 | 16 |
| 8274 | 8295 | 16 |
| 8275 | 8296 | 16 |
| 8297 | 16 | |
| 8276 | 8298 | |
| 8277 | 8299 | 16 |
| 8278 | 8300 | 16 |
| ... | ... | @@ -8358,6 +8380,9 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf |
| 8358 | 8380 | 16 |
| 8359 | 8381 | 16 |
| 8360 | 8382 | 16 |
| 8383 | 16 | |
| 8384 | ||
| 8385 | ||
| 8361 | 8386 | 16 |
| 8362 | 8387 | 16 |
| 8363 | 8388 | 16 |
| ... | ... | @@ -8458,6 +8483,7 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf |
| 8458 | 8483 | 16 |
| 8459 | 8484 | 16 |
| 8460 | 8485 | 16 |
| 8486 | 16 | |
| 8461 | 8487 | |
| 8462 | 8488 | 16 |
| 8463 | 8489 | 16 |
| ... | ... | @@ -8484,6 +8510,7 @@ arm-linux-gnueabi armeb-linux-gnueabi arm-linux-gnueabihf armeb-linux-gnueabihf |
| 8484 | 8510 | 16 |
| 8485 | 8511 | 16 |
| 8486 | 8512 | 16 |
| 8513 | 16 | |
| 8487 | 8514 | 24 16 |
| 8488 | 8515 | 24 16 |
| 8489 | 8516 | 16 |
| ... | ... | @@ -11374,6 +11401,7 @@ sparc-linux-gnu sparcel-linux-gnu |
| 11374 | 11401 | |
| 11375 | 11402 | |
| 11376 | 11403 | 0 |
| 11404 | ||
| 11377 | 11405 | 27 |
| 11378 | 11406 | |
| 11379 | 11407 | 27 |
| ... | ... | @@ -11693,6 +11721,7 @@ sparc-linux-gnu sparcel-linux-gnu |
| 11693 | 11721 | 0 |
| 11694 | 11722 | 0 |
| 11695 | 11723 | 1 |
| 11724 | 1 | |
| 11696 | 11725 | 0 |
| 11697 | 11726 | 0 |
| 11698 | 11727 | 3 11 |
| ... | ... | @@ -11878,6 +11907,7 @@ sparc-linux-gnu sparcel-linux-gnu |
| 11878 | 11907 | 19 |
| 11879 | 11908 | 19 |
| 11880 | 11909 | 0 |
| 11910 | ||
| 11881 | 11911 | 0 |
| 11882 | 11912 | 1 |
| 11883 | 11913 | 28 |
| ... | ... | @@ -11997,6 +12027,7 @@ sparc-linux-gnu sparcel-linux-gnu |
| 11997 | 12027 | 33 |
| 11998 | 12028 | |
| 11999 | 12029 | 16 |
| 12030 | ||
| 12000 | 12031 | 5 |
| 12001 | 12032 | 0 |
| 12002 | 12033 | 15 |
| ... | ... | @@ -12085,6 +12116,9 @@ sparc-linux-gnu sparcel-linux-gnu |
| 12085 | 12116 | 16 |
| 12086 | 12117 | 0 |
| 12087 | 12118 | 0 |
| 12119 | 12 | |
| 12120 | ||
| 12121 | ||
| 12088 | 12122 | 1 |
| 12089 | 12123 | 1 |
| 12090 | 12124 | 1 |
| ... | ... | @@ -12183,6 +12217,7 @@ sparc-linux-gnu sparcel-linux-gnu |
| 12183 | 12217 | 1 |
| 12184 | 12218 | 1 |
| 12185 | 12219 | 1 |
| 12220 | 1 | |
| 12186 | 12221 | 0 |
| 12187 | 12222 | 0 |
| 12188 | 12223 | |
| ... | ... | @@ -12207,6 +12242,7 @@ sparc-linux-gnu sparcel-linux-gnu |
| 12207 | 12242 | 0 |
| 12208 | 12243 | 0 |
| 12209 | 12244 | 0 |
| 12245 | 0 | |
| 12210 | 12246 | 5 |
| 12211 | 12247 | 0 |
| 12212 | 12248 | 0 |
| ... | ... | @@ -15101,6 +15137,7 @@ sparcv9-linux-gnu |
| 15101 | 15137 | 5 |
| 15102 | 15138 | 5 |
| 15103 | 15139 | |
| 15140 | ||
| 15104 | 15141 | 27 |
| 15105 | 15142 | |
| 15106 | 15143 | 27 |
| ... | ... | @@ -15422,6 +15459,7 @@ sparcv9-linux-gnu |
| 15422 | 15459 | 5 |
| 15423 | 15460 | 5 |
| 15424 | 15461 | 5 |
| 15462 | 5 | |
| 15425 | 15463 | 11 |
| 15426 | 15464 | 27 |
| 15427 | 15465 | |
| ... | ... | @@ -15605,6 +15643,7 @@ sparcv9-linux-gnu |
| 15605 | 15643 | 19 |
| 15606 | 15644 | 19 |
| 15607 | 15645 | 5 |
| 15646 | ||
| 15608 | 15647 | 5 |
| 15609 | 15648 | 5 |
| 15610 | 15649 | 28 |
| ... | ... | @@ -15724,6 +15763,7 @@ sparcv9-linux-gnu |
| 15724 | 15763 | 27 |
| 15725 | 15764 | |
| 15726 | 15765 | 16 |
| 15766 | ||
| 15727 | 15767 | 5 |
| 15728 | 15768 | 5 |
| 15729 | 15769 | 15 |
| ... | ... | @@ -15812,6 +15852,9 @@ sparcv9-linux-gnu |
| 15812 | 15852 | 16 |
| 15813 | 15853 | 5 |
| 15814 | 15854 | 5 |
| 15855 | 12 | |
| 15856 | ||
| 15857 | ||
| 15815 | 15858 | 5 |
| 15816 | 15859 | 5 |
| 15817 | 15860 | 5 |
| ... | ... | @@ -15912,6 +15955,7 @@ sparcv9-linux-gnu |
| 15912 | 15955 | 5 |
| 15913 | 15956 | 5 |
| 15914 | 15957 | 5 |
| 15958 | 5 | |
| 15915 | 15959 | |
| 15916 | 15960 | 5 |
| 15917 | 15961 | 5 |
| ... | ... | @@ -15938,6 +15982,7 @@ sparcv9-linux-gnu |
| 15938 | 15982 | 5 |
| 15939 | 15983 | 5 |
| 15940 | 15984 | 5 |
| 15985 | 5 | |
| 15941 | 15986 | 24 28 5 12 16 |
| 15942 | 15987 | 24 28 5 12 16 |
| 15943 | 15988 | 5 14 |
| ... | ... | @@ -18828,6 +18873,7 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 |
| 18828 | 18873 | |
| 18829 | 18874 | |
| 18830 | 18875 | 0 |
| 18876 | ||
| 18831 | 18877 | 27 |
| 18832 | 18878 | |
| 18833 | 18879 | 27 |
| ... | ... | @@ -19147,6 +19193,7 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 |
| 19147 | 19193 | 0 |
| 19148 | 19194 | 0 |
| 19149 | 19195 | 5 |
| 19196 | 5 | |
| 19150 | 19197 | 0 |
| 19151 | 19198 | 0 |
| 19152 | 19199 | 11 |
| ... | ... | @@ -19332,6 +19379,7 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 |
| 19332 | 19379 | 19 |
| 19333 | 19380 | 19 |
| 19334 | 19381 | 0 |
| 19382 | ||
| 19335 | 19383 | 0 |
| 19336 | 19384 | 5 |
| 19337 | 19385 | 28 |
| ... | ... | @@ -19450,6 +19498,7 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 |
| 19450 | 19498 | 27 |
| 19451 | 19499 | 27 |
| 19452 | 19500 | |
| 19501 | 16 | |
| 19453 | 19502 | 16 |
| 19454 | 19503 | 5 |
| 19455 | 19504 | 0 |
| ... | ... | @@ -19539,6 +19588,9 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 |
| 19539 | 19588 | 16 |
| 19540 | 19589 | 0 |
| 19541 | 19590 | 0 |
| 19591 | 12 | |
| 19592 | ||
| 19593 | ||
| 19542 | 19594 | 5 |
| 19543 | 19595 | 5 |
| 19544 | 19596 | 5 |
| ... | ... | @@ -19637,6 +19689,7 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 |
| 19637 | 19689 | 5 |
| 19638 | 19690 | 5 |
| 19639 | 19691 | 5 |
| 19692 | 5 | |
| 19640 | 19693 | 0 |
| 19641 | 19694 | 0 |
| 19642 | 19695 | 0 |
| ... | ... | @@ -19661,6 +19714,7 @@ mips64el-linux-gnuabi64 mips64-linux-gnuabi64 |
| 19661 | 19714 | 0 |
| 19662 | 19715 | 0 |
| 19663 | 19716 | 0 |
| 19717 | 0 | |
| 19664 | 19718 | 5 |
| 19665 | 19719 | 0 |
| 19666 | 19720 | 0 |
| ... | ... | @@ -22555,6 +22609,7 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 |
| 22555 | 22609 | |
| 22556 | 22610 | |
| 22557 | 22611 | 0 |
| 22612 | ||
| 22558 | 22613 | 27 |
| 22559 | 22614 | |
| 22560 | 22615 | 27 |
| ... | ... | @@ -22874,6 +22929,7 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 |
| 22874 | 22929 | 0 |
| 22875 | 22930 | 0 |
| 22876 | 22931 | 5 |
| 22932 | 5 | |
| 22877 | 22933 | 0 |
| 22878 | 22934 | 0 |
| 22879 | 22935 | 11 |
| ... | ... | @@ -23059,6 +23115,7 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 |
| 23059 | 23115 | 19 |
| 23060 | 23116 | 19 |
| 23061 | 23117 | 0 |
| 23118 | ||
| 23062 | 23119 | 0 |
| 23063 | 23120 | 5 |
| 23064 | 23121 | 28 |
| ... | ... | @@ -23177,6 +23234,7 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 |
| 23177 | 23234 | 27 |
| 23178 | 23235 | 27 |
| 23179 | 23236 | |
| 23237 | 16 | |
| 23180 | 23238 | 16 |
| 23181 | 23239 | 5 |
| 23182 | 23240 | 0 |
| ... | ... | @@ -23266,6 +23324,9 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 |
| 23266 | 23324 | 16 |
| 23267 | 23325 | 0 |
| 23268 | 23326 | 0 |
| 23327 | 12 | |
| 23328 | ||
| 23329 | ||
| 23269 | 23330 | 5 |
| 23270 | 23331 | 5 |
| 23271 | 23332 | 5 |
| ... | ... | @@ -23364,6 +23425,7 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 |
| 23364 | 23425 | 5 |
| 23365 | 23426 | 5 |
| 23366 | 23427 | 5 |
| 23428 | 5 | |
| 23367 | 23429 | 0 |
| 23368 | 23430 | 0 |
| 23369 | 23431 | 0 |
| ... | ... | @@ -23388,6 +23450,7 @@ mips64el-linux-gnuabin32 mips64-linux-gnuabin32 |
| 23388 | 23450 | 0 |
| 23389 | 23451 | 0 |
| 23390 | 23452 | 0 |
| 23453 | 0 | |
| 23391 | 23454 | 5 |
| 23392 | 23455 | 0 |
| 23393 | 23456 | 0 |
| ... | ... | @@ -26282,6 +26345,7 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf |
| 26282 | 26345 | |
| 26283 | 26346 | |
| 26284 | 26347 | 0 |
| 26348 | ||
| 26285 | 26349 | 27 |
| 26286 | 26350 | |
| 26287 | 26351 | 27 |
| ... | ... | @@ -26601,6 +26665,7 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf |
| 26601 | 26665 | 0 |
| 26602 | 26666 | 0 |
| 26603 | 26667 | 5 |
| 26668 | 5 | |
| 26604 | 26669 | 0 |
| 26605 | 26670 | 0 |
| 26606 | 26671 | 11 |
| ... | ... | @@ -26786,6 +26851,7 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf |
| 26786 | 26851 | 19 |
| 26787 | 26852 | 19 |
| 26788 | 26853 | 0 |
| 26854 | ||
| 26789 | 26855 | 0 |
| 26790 | 26856 | 5 |
| 26791 | 26857 | 28 |
| ... | ... | @@ -26904,6 +26970,7 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf |
| 26904 | 26970 | 27 |
| 26905 | 26971 | |
| 26906 | 26972 | |
| 26973 | 16 | |
| 26907 | 26974 | 16 |
| 26908 | 26975 | 5 |
| 26909 | 26976 | 0 |
| ... | ... | @@ -26993,6 +27060,9 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf |
| 26993 | 27060 | 16 |
| 26994 | 27061 | 0 |
| 26995 | 27062 | 0 |
| 27063 | 12 | |
| 27064 | ||
| 27065 | ||
| 26996 | 27066 | 5 |
| 26997 | 27067 | 5 |
| 26998 | 27068 | 5 |
| ... | ... | @@ -27091,6 +27161,7 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf |
| 27091 | 27161 | 5 |
| 27092 | 27162 | 5 |
| 27093 | 27163 | 5 |
| 27164 | 5 | |
| 27094 | 27165 | 0 |
| 27095 | 27166 | 0 |
| 27096 | 27167 | 0 |
| ... | ... | @@ -27115,6 +27186,7 @@ mipsel-linux-gnueabihf mips-linux-gnueabihf |
| 27115 | 27186 | 0 |
| 27116 | 27187 | 0 |
| 27117 | 27188 | 0 |
| 27189 | 0 | |
| 27118 | 27190 | 5 |
| 27119 | 27191 | 0 |
| 27120 | 27192 | 0 |
| ... | ... | @@ -30009,6 +30081,7 @@ mipsel-linux-gnueabi mips-linux-gnueabi |
| 30009 | 30081 | |
| 30010 | 30082 | |
| 30011 | 30083 | 0 |
| 30084 | ||
| 30012 | 30085 | 27 |
| 30013 | 30086 | |
| 30014 | 30087 | 27 |
| ... | ... | @@ -30328,6 +30401,7 @@ mipsel-linux-gnueabi mips-linux-gnueabi |
| 30328 | 30401 | 0 |
| 30329 | 30402 | 0 |
| 30330 | 30403 | 5 |
| 30404 | 5 | |
| 30331 | 30405 | 0 |
| 30332 | 30406 | 0 |
| 30333 | 30407 | 11 |
| ... | ... | @@ -30513,6 +30587,7 @@ mipsel-linux-gnueabi mips-linux-gnueabi |
| 30513 | 30587 | 19 |
| 30514 | 30588 | 19 |
| 30515 | 30589 | 0 |
| 30590 | ||
| 30516 | 30591 | 0 |
| 30517 | 30592 | 5 |
| 30518 | 30593 | 28 |
| ... | ... | @@ -30631,6 +30706,7 @@ mipsel-linux-gnueabi mips-linux-gnueabi |
| 30631 | 30706 | 27 |
| 30632 | 30707 | |
| 30633 | 30708 | |
| 30709 | 16 | |
| 30634 | 30710 | 16 |
| 30635 | 30711 | 5 |
| 30636 | 30712 | 0 |
| ... | ... | @@ -30720,6 +30796,9 @@ mipsel-linux-gnueabi mips-linux-gnueabi |
| 30720 | 30796 | 16 |
| 30721 | 30797 | 0 |
| 30722 | 30798 | 0 |
| 30799 | 12 | |
| 30800 | ||
| 30801 | ||
| 30723 | 30802 | 5 |
| 30724 | 30803 | 5 |
| 30725 | 30804 | 5 |
| ... | ... | @@ -30818,6 +30897,7 @@ mipsel-linux-gnueabi mips-linux-gnueabi |
| 30818 | 30897 | 5 |
| 30819 | 30898 | 5 |
| 30820 | 30899 | 5 |
| 30900 | 5 | |
| 30821 | 30901 | 0 |
| 30822 | 30902 | 0 |
| 30823 | 30903 | 0 |
| ... | ... | @@ -30842,6 +30922,7 @@ mipsel-linux-gnueabi mips-linux-gnueabi |
| 30842 | 30922 | 0 |
| 30843 | 30923 | 0 |
| 30844 | 30924 | 0 |
| 30925 | 0 | |
| 30845 | 30926 | 5 |
| 30846 | 30927 | 0 |
| 30847 | 30928 | 0 |
| ... | ... | @@ -33734,6 +33815,7 @@ x86_64-linux-gnu |
| 33734 | 33815 | |
| 33735 | 33816 | |
| 33736 | 33817 | |
| 33818 | ||
| 33737 | 33819 | |
| 33738 | 33820 | |
| 33739 | 33821 | 27 |
| ... | ... | @@ -34057,6 +34139,7 @@ x86_64-linux-gnu |
| 34057 | 34139 | 10 |
| 34058 | 34140 | 10 |
| 34059 | 34141 | 10 |
| 34142 | 10 | |
| 34060 | 34143 | 11 |
| 34061 | 34144 | 27 |
| 34062 | 34145 | 36 |
| ... | ... | @@ -34240,6 +34323,7 @@ x86_64-linux-gnu |
| 34240 | 34323 | 19 |
| 34241 | 34324 | 19 |
| 34242 | 34325 | 10 |
| 34326 | ||
| 34243 | 34327 | 10 |
| 34244 | 34328 | 10 |
| 34245 | 34329 | 28 |
| ... | ... | @@ -34359,6 +34443,7 @@ x86_64-linux-gnu |
| 34359 | 34443 | 27 |
| 34360 | 34444 | |
| 34361 | 34445 | 16 |
| 34446 | ||
| 34362 | 34447 | 10 |
| 34363 | 34448 | 10 |
| 34364 | 34449 | 15 |
| ... | ... | @@ -34447,6 +34532,9 @@ x86_64-linux-gnu |
| 34447 | 34532 | 16 |
| 34448 | 34533 | 10 |
| 34449 | 34534 | 10 |
| 34535 | 12 | |
| 34536 | ||
| 34537 | ||
| 34450 | 34538 | 10 |
| 34451 | 34539 | 10 |
| 34452 | 34540 | 10 |
| ... | ... | @@ -34547,6 +34635,7 @@ x86_64-linux-gnu |
| 34547 | 34635 | 10 |
| 34548 | 34636 | 10 |
| 34549 | 34637 | 10 |
| 34638 | 10 | |
| 34550 | 34639 | |
| 34551 | 34640 | 10 |
| 34552 | 34641 | 10 |
| ... | ... | @@ -34573,6 +34662,7 @@ x86_64-linux-gnu |
| 34573 | 34662 | 10 |
| 34574 | 34663 | 10 |
| 34575 | 34664 | 10 |
| 34665 | 10 | |
| 34576 | 34666 | 24 10 12 16 |
| 34577 | 34667 | 24 10 12 16 |
| 34578 | 34668 | 10 14 |
| ... | ... | @@ -37461,6 +37551,7 @@ x86_64-linux-gnux32 |
| 37461 | 37551 | |
| 37462 | 37552 | |
| 37463 | 37553 | |
| 37554 | ||
| 37464 | 37555 | |
| 37465 | 37556 | |
| 37466 | 37557 | 28 |
| ... | ... | @@ -37784,6 +37875,7 @@ x86_64-linux-gnux32 |
| 37784 | 37875 | 28 |
| 37785 | 37876 | 28 |
| 37786 | 37877 | 28 |
| 37878 | 28 | |
| 37787 | 37879 | |
| 37788 | 37880 | 28 |
| 37789 | 37881 | 36 |
| ... | ... | @@ -37967,6 +38059,7 @@ x86_64-linux-gnux32 |
| 37967 | 38059 | 28 |
| 37968 | 38060 | 28 |
| 37969 | 38061 | 28 |
| 38062 | ||
| 37970 | 38063 | 28 |
| 37971 | 38064 | 28 |
| 37972 | 38065 | 28 |
| ... | ... | @@ -38086,6 +38179,7 @@ x86_64-linux-gnux32 |
| 38086 | 38179 | 28 |
| 38087 | 38180 | |
| 38088 | 38181 | 28 |
| 38182 | ||
| 38089 | 38183 | 28 |
| 38090 | 38184 | 28 |
| 38091 | 38185 | 28 |
| ... | ... | @@ -38174,6 +38268,9 @@ x86_64-linux-gnux32 |
| 38174 | 38268 | 28 |
| 38175 | 38269 | 28 |
| 38176 | 38270 | 28 |
| 38271 | 28 | |
| 38272 | ||
| 38273 | ||
| 38177 | 38274 | 28 |
| 38178 | 38275 | 28 |
| 38179 | 38276 | 28 |
| ... | ... | @@ -38274,6 +38371,7 @@ x86_64-linux-gnux32 |
| 38274 | 38371 | 28 |
| 38275 | 38372 | 28 |
| 38276 | 38373 | 28 |
| 38374 | 28 | |
| 38277 | 38375 | |
| 38278 | 38376 | 28 |
| 38279 | 38377 | 28 |
| ... | ... | @@ -38303,6 +38401,7 @@ x86_64-linux-gnux32 |
| 38303 | 38401 | 28 |
| 38304 | 38402 | 28 |
| 38305 | 38403 | 28 |
| 38404 | 28 | |
| 38306 | 38405 | |
| 38307 | 38406 | 28 |
| 38308 | 38407 | 28 |
| ... | ... | @@ -41190,6 +41289,7 @@ i386-linux-gnu |
| 41190 | 41289 | |
| 41191 | 41290 | |
| 41192 | 41291 | 0 |
| 41292 | 12 | |
| 41193 | 41293 | 27 |
| 41194 | 41294 | 36 |
| 41195 | 41295 | 27 |
| ... | ... | @@ -41509,6 +41609,7 @@ i386-linux-gnu |
| 41509 | 41609 | 0 |
| 41510 | 41610 | 0 |
| 41511 | 41611 | 1 |
| 41612 | 1 | |
| 41512 | 41613 | 0 |
| 41513 | 41614 | 0 |
| 41514 | 41615 | 3 11 |
| ... | ... | @@ -41694,6 +41795,7 @@ i386-linux-gnu |
| 41694 | 41795 | 19 |
| 41695 | 41796 | 19 |
| 41696 | 41797 | 0 |
| 41798 | ||
| 41697 | 41799 | 0 |
| 41698 | 41800 | 1 |
| 41699 | 41801 | 28 |
| ... | ... | @@ -41813,6 +41915,7 @@ i386-linux-gnu |
| 41813 | 41915 | 27 |
| 41814 | 41916 | |
| 41815 | 41917 | 16 |
| 41918 | ||
| 41816 | 41919 | 5 |
| 41817 | 41920 | 0 |
| 41818 | 41921 | 15 |
| ... | ... | @@ -41901,6 +42004,9 @@ i386-linux-gnu |
| 41901 | 42004 | 16 |
| 41902 | 42005 | 0 |
| 41903 | 42006 | 0 |
| 42007 | 12 | |
| 42008 | ||
| 42009 | ||
| 41904 | 42010 | 1 |
| 41905 | 42011 | 1 |
| 41906 | 42012 | 1 |
| ... | ... | @@ -41999,6 +42105,7 @@ i386-linux-gnu |
| 41999 | 42105 | 1 |
| 42000 | 42106 | 1 |
| 42001 | 42107 | 1 |
| 42108 | 1 | |
| 42002 | 42109 | 0 |
| 42003 | 42110 | 0 |
| 42004 | 42111 | |
| ... | ... | @@ -42023,6 +42130,7 @@ i386-linux-gnu |
| 42023 | 42130 | 0 |
| 42024 | 42131 | 0 |
| 42025 | 42132 | 0 |
| 42133 | 0 | |
| 42026 | 42134 | 5 |
| 42027 | 42135 | 0 |
| 42028 | 42136 | 0 |
| ... | ... | @@ -44915,6 +45023,7 @@ powerpc64le-linux-gnu |
| 44915 | 45023 | |
| 44916 | 45024 | |
| 44917 | 45025 | |
| 45026 | ||
| 44918 | 45027 | |
| 44919 | 45028 | |
| 44920 | 45029 | 29 |
| ... | ... | @@ -45238,6 +45347,7 @@ powerpc64le-linux-gnu |
| 45238 | 45347 | 29 |
| 45239 | 45348 | 29 |
| 45240 | 45349 | 29 |
| 45350 | 29 | |
| 45241 | 45351 | |
| 45242 | 45352 | 29 |
| 45243 | 45353 | 36 |
| ... | ... | @@ -45421,6 +45531,7 @@ powerpc64le-linux-gnu |
| 45421 | 45531 | 29 |
| 45422 | 45532 | 29 |
| 45423 | 45533 | 29 |
| 45534 | 33 | |
| 45424 | 45535 | 29 |
| 45425 | 45536 | 29 |
| 45426 | 45537 | 29 |
| ... | ... | @@ -45540,6 +45651,7 @@ powerpc64le-linux-gnu |
| 45540 | 45651 | 29 |
| 45541 | 45652 | |
| 45542 | 45653 | 29 |
| 45654 | ||
| 45543 | 45655 | 29 |
| 45544 | 45656 | 29 |
| 45545 | 45657 | 29 |
| ... | ... | @@ -45628,6 +45740,9 @@ powerpc64le-linux-gnu |
| 45628 | 45740 | 29 |
| 45629 | 45741 | 29 |
| 45630 | 45742 | 29 |
| 45743 | 29 | |
| 45744 | 32 | |
| 45745 | ||
| 45631 | 45746 | 29 |
| 45632 | 45747 | 29 |
| 45633 | 45748 | 29 |
| ... | ... | @@ -45728,6 +45843,7 @@ powerpc64le-linux-gnu |
| 45728 | 45843 | 29 |
| 45729 | 45844 | 29 |
| 45730 | 45845 | 29 |
| 45846 | 29 | |
| 45731 | 45847 | |
| 45732 | 45848 | 29 |
| 45733 | 45849 | 29 |
| ... | ... | @@ -45757,6 +45873,7 @@ powerpc64le-linux-gnu |
| 45757 | 45873 | 29 |
| 45758 | 45874 | 29 |
| 45759 | 45875 | 29 |
| 45876 | 29 | |
| 45760 | 45877 | |
| 45761 | 45878 | 29 |
| 45762 | 45879 | 29 |
| ... | ... | @@ -48642,6 +48759,7 @@ powerpc64-linux-gnu |
| 48642 | 48759 | |
| 48643 | 48760 | |
| 48644 | 48761 | |
| 48762 | ||
| 48645 | 48763 | |
| 48646 | 48764 | |
| 48647 | 48765 | 27 |
| ... | ... | @@ -48965,6 +49083,7 @@ powerpc64-linux-gnu |
| 48965 | 49083 | 12 |
| 48966 | 49084 | 12 |
| 48967 | 49085 | 12 |
| 49086 | 12 | |
| 48968 | 49087 | |
| 48969 | 49088 | 27 |
| 48970 | 49089 | |
| ... | ... | @@ -49148,6 +49267,7 @@ powerpc64-linux-gnu |
| 49148 | 49267 | 19 |
| 49149 | 49268 | 19 |
| 49150 | 49269 | 12 |
| 49270 | 33 | |
| 49151 | 49271 | 12 |
| 49152 | 49272 | 12 |
| 49153 | 49273 | 28 |
| ... | ... | @@ -49267,6 +49387,7 @@ powerpc64-linux-gnu |
| 49267 | 49387 | 27 |
| 49268 | 49388 | |
| 49269 | 49389 | 16 |
| 49390 | ||
| 49270 | 49391 | 12 |
| 49271 | 49392 | 12 |
| 49272 | 49393 | 15 |
| ... | ... | @@ -49355,6 +49476,9 @@ powerpc64-linux-gnu |
| 49355 | 49476 | 16 |
| 49356 | 49477 | 12 |
| 49357 | 49478 | 12 |
| 49479 | 12 | |
| 49480 | 32 | |
| 49481 | ||
| 49358 | 49482 | 12 |
| 49359 | 49483 | 12 |
| 49360 | 49484 | 12 |
| ... | ... | @@ -49455,6 +49579,7 @@ powerpc64-linux-gnu |
| 49455 | 49579 | 12 |
| 49456 | 49580 | 12 |
| 49457 | 49581 | 12 |
| 49582 | 12 | |
| 49458 | 49583 | |
| 49459 | 49584 | 12 |
| 49460 | 49585 | 12 |
| ... | ... | @@ -49480,6 +49605,7 @@ powerpc64-linux-gnu |
| 49480 | 49605 | 12 |
| 49481 | 49606 | 12 |
| 49482 | 49607 | 12 |
| 49608 | 12 | |
| 49483 | 49609 | 12 15 |
| 49484 | 49610 | 24 12 16 |
| 49485 | 49611 | 24 12 16 |
| ... | ... | @@ -52369,6 +52495,7 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf |
| 52369 | 52495 | |
| 52370 | 52496 | |
| 52371 | 52497 | |
| 52498 | ||
| 52372 | 52499 | |
| 52373 | 52500 | |
| 52374 | 52501 | 27 |
| ... | ... | @@ -52690,6 +52817,7 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf |
| 52690 | 52817 | 0 |
| 52691 | 52818 | 0 |
| 52692 | 52819 | 1 |
| 52820 | 1 | |
| 52693 | 52821 | 0 |
| 52694 | 52822 | 0 |
| 52695 | 52823 | 3 11 |
| ... | ... | @@ -52875,6 +53003,7 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf |
| 52875 | 53003 | 19 |
| 52876 | 53004 | 19 |
| 52877 | 53005 | 0 |
| 53006 | 33 | |
| 52878 | 53007 | 0 |
| 52879 | 53008 | 1 |
| 52880 | 53009 | 28 |
| ... | ... | @@ -52994,6 +53123,7 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf |
| 52994 | 53123 | 27 |
| 52995 | 53124 | 13 |
| 52996 | 53125 | 16 |
| 53126 | ||
| 52997 | 53127 | 5 |
| 52998 | 53128 | 0 |
| 52999 | 53129 | 15 |
| ... | ... | @@ -53082,6 +53212,9 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf |
| 53082 | 53212 | 16 |
| 53083 | 53213 | 0 |
| 53084 | 53214 | 0 |
| 53215 | 12 | |
| 53216 | 32 | |
| 53217 | ||
| 53085 | 53218 | 1 |
| 53086 | 53219 | 1 |
| 53087 | 53220 | 1 |
| ... | ... | @@ -53180,6 +53313,7 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf |
| 53180 | 53313 | 1 |
| 53181 | 53314 | 1 |
| 53182 | 53315 | 1 |
| 53316 | 1 | |
| 53183 | 53317 | 0 |
| 53184 | 53318 | 0 |
| 53185 | 53319 | |
| ... | ... | @@ -53204,6 +53338,7 @@ powerpc-linux-gnueabi powerpc-linux-gnueabihf |
| 53204 | 53338 | 0 |
| 53205 | 53339 | 0 |
| 53206 | 53340 | 0 |
| 53341 | 0 | |
| 53207 | 53342 | 5 |
| 53208 | 53343 | 0 |
| 53209 | 53344 | 0 |
lib/libc/glibc/fns.txt+9| ... | ... | @@ -192,6 +192,7 @@ _Qp_uitoq c |
| 192 | 192 | _Qp_uxtoq c |
| 193 | 193 | _Qp_xtoq c |
| 194 | 194 | ___brk_addr c |
| 195 | ___tls_get_addr ld | |
| 195 | 196 | __acos_finite m |
| 196 | 197 | __acosf128_finite m |
| 197 | 198 | __acosf_finite m |
| ... | ... | @@ -511,6 +512,7 @@ __libc_memalign c |
| 511 | 512 | __libc_pvalloc c |
| 512 | 513 | __libc_realloc c |
| 513 | 514 | __libc_sa_len c |
| 515 | __libc_stack_end ld | |
| 514 | 516 | __libc_start_main c |
| 515 | 517 | __libc_valloc c |
| 516 | 518 | __libpthread_version_placeholder pthread |
| ... | ... | @@ -696,6 +698,7 @@ __open_2 c |
| 696 | 698 | __openat64_2 c |
| 697 | 699 | __openat_2 c |
| 698 | 700 | __overflow c |
| 701 | __parse_hwcap_and_convert_at_platform ld | |
| 699 | 702 | __pipe c |
| 700 | 703 | __poll c |
| 701 | 704 | __poll_chk c |
| ... | ... | @@ -815,6 +818,7 @@ __sqrtf_finite m |
| 815 | 818 | __sqrtl_finite m |
| 816 | 819 | __sqrtsf2 c |
| 817 | 820 | __stack_chk_fail c |
| 821 | __stack_chk_guard ld | |
| 818 | 822 | __statfs c |
| 819 | 823 | __stpcpy c |
| 820 | 824 | __stpcpy_chk c |
| ... | ... | @@ -903,6 +907,9 @@ __sysctl c |
| 903 | 907 | __syslog_chk c |
| 904 | 908 | __sysv_signal c |
| 905 | 909 | __timezone c |
| 910 | __tls_get_addr ld | |
| 911 | __tls_get_addr_opt ld | |
| 912 | __tls_get_offset ld | |
| 906 | 913 | __toascii_l c |
| 907 | 914 | __tolower_l c |
| 908 | 915 | __toupper_l c |
| ... | ... | @@ -999,6 +1006,7 @@ __ynf128_finite m |
| 999 | 1006 | __ynf_finite m |
| 1000 | 1007 | __ynl_finite m |
| 1001 | 1008 | _authenticate c |
| 1009 | _dl_mcount ld | |
| 1002 | 1010 | _dl_mcount_wrapper c |
| 1003 | 1011 | _dl_mcount_wrapper_check c |
| 1004 | 1012 | _environ c |
| ... | ... | @@ -1024,6 +1032,7 @@ _pthread_cleanup_pop pthread |
| 1024 | 1032 | _pthread_cleanup_pop_restore pthread |
| 1025 | 1033 | _pthread_cleanup_push pthread |
| 1026 | 1034 | _pthread_cleanup_push_defer pthread |
| 1035 | _r_debug ld | |
| 1027 | 1036 | _res c |
| 1028 | 1037 | _res_hconf c |
| 1029 | 1038 | _rpc_dtablesize c |
lib/std/build.zig+9-11| ... | ... | @@ -1121,7 +1121,7 @@ pub const LibExeObjStep = struct { |
| 1121 | 1121 | emit_llvm_ir: bool = false, |
| 1122 | 1122 | emit_asm: bool = false, |
| 1123 | 1123 | emit_bin: bool = true, |
| 1124 | disable_gen_h: bool, | |
| 1124 | emit_h: bool = false, | |
| 1125 | 1125 | bundle_compiler_rt: bool, |
| 1126 | 1126 | disable_stack_probing: bool, |
| 1127 | 1127 | disable_sanitize_c: bool, |
| ... | ... | @@ -1281,7 +1281,6 @@ pub const LibExeObjStep = struct { |
| 1281 | 1281 | .exec_cmd_args = null, |
| 1282 | 1282 | .name_prefix = "", |
| 1283 | 1283 | .filter = null, |
| 1284 | .disable_gen_h = false, | |
| 1285 | 1284 | .bundle_compiler_rt = false, |
| 1286 | 1285 | .disable_stack_probing = false, |
| 1287 | 1286 | .disable_sanitize_c = false, |
| ... | ... | @@ -1600,8 +1599,9 @@ pub const LibExeObjStep = struct { |
| 1600 | 1599 | self.main_pkg_path = dir_path; |
| 1601 | 1600 | } |
| 1602 | 1601 | |
| 1603 | pub fn setDisableGenH(self: *LibExeObjStep, value: bool) void { | |
| 1604 | self.disable_gen_h = value; | |
| 1602 | /// Deprecated; just set the field directly. | |
| 1603 | pub fn setDisableGenH(self: *LibExeObjStep, is_disabled: bool) void { | |
| 1604 | self.emit_h = !is_disabled; | |
| 1605 | 1605 | } |
| 1606 | 1606 | |
| 1607 | 1607 | pub fn setLibCFile(self: *LibExeObjStep, libc_file: ?[]const u8) void { |
| ... | ... | @@ -1632,7 +1632,7 @@ pub const LibExeObjStep = struct { |
| 1632 | 1632 | /// the make step, from a step that has declared a dependency on this one. |
| 1633 | 1633 | pub fn getOutputHPath(self: *LibExeObjStep) []const u8 { |
| 1634 | 1634 | assert(self.kind != Kind.Exe); |
| 1635 | assert(!self.disable_gen_h); | |
| 1635 | assert(self.emit_h); | |
| 1636 | 1636 | return fs.path.join( |
| 1637 | 1637 | self.builder.allocator, |
| 1638 | 1638 | &[_][]const u8{ self.output_dir.?, self.out_h_filename }, |
| ... | ... | @@ -1679,7 +1679,7 @@ pub const LibExeObjStep = struct { |
| 1679 | 1679 | } |
| 1680 | 1680 | |
| 1681 | 1681 | pub fn addBuildOption(self: *LibExeObjStep, comptime T: type, name: []const u8, value: T) void { |
| 1682 | const out = &std.io.BufferOutStream.init(&self.build_options_contents).stream; | |
| 1682 | const out = self.build_options_contents.outStream(); | |
| 1683 | 1683 | out.print("pub const {} = {};\n", .{ name, value }) catch unreachable; |
| 1684 | 1684 | } |
| 1685 | 1685 | |
| ... | ... | @@ -1884,6 +1884,7 @@ pub const LibExeObjStep = struct { |
| 1884 | 1884 | if (self.emit_llvm_ir) try zig_args.append("-femit-llvm-ir"); |
| 1885 | 1885 | if (self.emit_asm) try zig_args.append("-femit-asm"); |
| 1886 | 1886 | if (!self.emit_bin) try zig_args.append("-fno-emit-bin"); |
| 1887 | if (self.emit_h) try zig_args.append("-femit-h"); | |
| 1887 | 1888 | |
| 1888 | 1889 | if (self.strip) { |
| 1889 | 1890 | try zig_args.append("--strip"); |
| ... | ... | @@ -1929,9 +1930,6 @@ pub const LibExeObjStep = struct { |
| 1929 | 1930 | if (self.is_dynamic) { |
| 1930 | 1931 | try zig_args.append("-dynamic"); |
| 1931 | 1932 | } |
| 1932 | if (self.disable_gen_h) { | |
| 1933 | try zig_args.append("--disable-gen-h"); | |
| 1934 | } | |
| 1935 | 1933 | if (self.bundle_compiler_rt) { |
| 1936 | 1934 | try zig_args.append("--bundle-compiler-rt"); |
| 1937 | 1935 | } |
| ... | ... | @@ -2069,7 +2067,7 @@ pub const LibExeObjStep = struct { |
| 2069 | 2067 | try zig_args.append("-isystem"); |
| 2070 | 2068 | try zig_args.append(self.builder.pathFromRoot(include_path)); |
| 2071 | 2069 | }, |
| 2072 | .OtherStep => |other| if (!other.disable_gen_h) { | |
| 2070 | .OtherStep => |other| if (other.emit_h) { | |
| 2073 | 2071 | const h_path = other.getOutputHPath(); |
| 2074 | 2072 | try zig_args.append("-isystem"); |
| 2075 | 2073 | try zig_args.append(fs.path.dirname(h_path).?); |
| ... | ... | @@ -2209,7 +2207,7 @@ const InstallArtifactStep = struct { |
| 2209 | 2207 | break :blk InstallDir.Lib; |
| 2210 | 2208 | } |
| 2211 | 2209 | } else null, |
| 2212 | .h_dir = if (artifact.kind == .Lib and !artifact.disable_gen_h) .Header else null, | |
| 2210 | .h_dir = if (artifact.kind == .Lib and artifact.emit_h) .Header else null, | |
| 2213 | 2211 | }; |
| 2214 | 2212 | self.step.dependOn(&artifact.step); |
| 2215 | 2213 | artifact.install_step = self; |
lib/std/debug.zig+44-11| ... | ... | @@ -235,9 +235,17 @@ pub fn panic(comptime format: []const u8, args: var) noreturn { |
| 235 | 235 | panicExtra(null, first_trace_addr, format, args); |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | /// TODO multithreaded awareness | |
| 238 | /// Non-zero whenever the program triggered a panic. | |
| 239 | /// The counter is incremented/decremented atomically. | |
| 239 | 240 | var panicking: u8 = 0; |
| 240 | 241 | |
| 242 | // Locked to avoid interleaving panic messages from multiple threads. | |
| 243 | var panic_mutex = std.Mutex.init(); | |
| 244 | ||
| 245 | /// Counts how many times the panic handler is invoked by this thread. | |
| 246 | /// This is used to catch and handle panics triggered by the panic handler. | |
| 247 | threadlocal var panic_stage: usize = 0; | |
| 248 | ||
| 241 | 249 | pub fn panicExtra(trace: ?*const builtin.StackTrace, first_trace_addr: ?usize, comptime format: []const u8, args: var) noreturn { |
| 242 | 250 | @setCold(true); |
| 243 | 251 | |
| ... | ... | @@ -247,25 +255,50 @@ pub fn panicExtra(trace: ?*const builtin.StackTrace, first_trace_addr: ?usize, c |
| 247 | 255 | resetSegfaultHandler(); |
| 248 | 256 | } |
| 249 | 257 | |
| 250 | switch (@atomicRmw(u8, &panicking, .Add, 1, .SeqCst)) { | |
| 258 | switch (panic_stage) { | |
| 251 | 259 | 0 => { |
| 252 | const stderr = getStderrStream(); | |
| 253 | noasync stderr.print(format ++ "\n", args) catch os.abort(); | |
| 254 | if (trace) |t| { | |
| 255 | dumpStackTrace(t.*); | |
| 260 | panic_stage = 1; | |
| 261 | ||
| 262 | _ = @atomicRmw(u8, &panicking, .Add, 1, .SeqCst); | |
| 263 | ||
| 264 | // Make sure to release the mutex when done | |
| 265 | { | |
| 266 | const held = panic_mutex.acquire(); | |
| 267 | defer held.release(); | |
| 268 | ||
| 269 | const stderr = getStderrStream(); | |
| 270 | noasync stderr.print(format ++ "\n", args) catch os.abort(); | |
| 271 | if (trace) |t| { | |
| 272 | dumpStackTrace(t.*); | |
| 273 | } | |
| 274 | dumpCurrentStackTrace(first_trace_addr); | |
| 275 | } | |
| 276 | ||
| 277 | if (@atomicRmw(u8, &panicking, .Sub, 1, .SeqCst) != 1) { | |
| 278 | // Another thread is panicking, wait for the last one to finish | |
| 279 | // and call abort() | |
| 280 | ||
| 281 | // Sleep forever without hammering the CPU | |
| 282 | var event = std.ResetEvent.init(); | |
| 283 | event.wait(); | |
| 284 | ||
| 285 | unreachable; | |
| 256 | 286 | } |
| 257 | dumpCurrentStackTrace(first_trace_addr); | |
| 258 | 287 | }, |
| 259 | 288 | 1 => { |
| 260 | // TODO detect if a different thread caused the panic, because in that case | |
| 261 | // we would want to return here instead of calling abort, so that the thread | |
| 262 | // which first called panic can finish printing a stack trace. | |
| 263 | warn("Panicked during a panic. Aborting.\n", .{}); | |
| 289 | panic_stage = 2; | |
| 290 | ||
| 291 | // A panic happened while trying to print a previous panic message, | |
| 292 | // we're still holding the mutex but that's fine as we're going to | |
| 293 | // call abort() | |
| 294 | const stderr = getStderrStream(); | |
| 295 | noasync stderr.print("Panicked during a panic. Aborting.\n", .{}) catch os.abort(); | |
| 264 | 296 | }, |
| 265 | 297 | else => { |
| 266 | 298 | // Panicked while printing "Panicked during a panic." |
| 267 | 299 | }, |
| 268 | 300 | } |
| 301 | ||
| 269 | 302 | os.abort(); |
| 270 | 303 | } |
| 271 | 304 |
lib/std/net.zig+2-2| ... | ... | @@ -820,7 +820,7 @@ fn linuxLookupNameFromHosts( |
| 820 | 820 | // Skip to the delimiter in the stream, to fix parsing |
| 821 | 821 | try stream.skipUntilDelimiterOrEof('\n'); |
| 822 | 822 | // Use the truncated line. A truncated comment or hostname will be handled correctly. |
| 823 | break :blk @as([]u8, &line_buf); // TODO the cast should not be necessary | |
| 823 | break :blk &line_buf; | |
| 824 | 824 | }, |
| 825 | 825 | else => |e| return e, |
| 826 | 826 | }) |line| { |
| ... | ... | @@ -1017,7 +1017,7 @@ fn getResolvConf(allocator: *mem.Allocator, rc: *ResolvConf) !void { |
| 1017 | 1017 | // Skip to the delimiter in the stream, to fix parsing |
| 1018 | 1018 | try stream.skipUntilDelimiterOrEof('\n'); |
| 1019 | 1019 | // Give an empty line to the while loop, which will be skipped. |
| 1020 | break :blk @as([]u8, line_buf[0..0]); // TODO the cast should not be necessary | |
| 1020 | break :blk line_buf[0..0]; | |
| 1021 | 1021 | }, |
| 1022 | 1022 | else => |e| return e, |
| 1023 | 1023 | }) |line| { |
lib/std/start.zig+4| ... | ... | @@ -41,6 +41,10 @@ fn _DllMainCRTStartup( |
| 41 | 41 | fdwReason: std.os.windows.DWORD, |
| 42 | 42 | lpReserved: std.os.windows.LPVOID, |
| 43 | 43 | ) callconv(.Stdcall) std.os.windows.BOOL { |
| 44 | if (!builtin.single_threaded) { | |
| 45 | _ = @import("start_windows_tls.zig"); | |
| 46 | } | |
| 47 | ||
| 44 | 48 | if (@hasDecl(root, "DllMain")) { |
| 45 | 49 | return root.DllMain(hinstDLL, fdwReason, lpReserved); |
| 46 | 50 | } |
lib/std/zig/ast.zig+3-4| ... | ... | @@ -1035,6 +1035,7 @@ pub const Node = struct { |
| 1035 | 1035 | pub const Defer = struct { |
| 1036 | 1036 | base: Node = Node{ .id = .Defer }, |
| 1037 | 1037 | defer_token: TokenIndex, |
| 1038 | payload: ?*Node, | |
| 1038 | 1039 | expr: *Node, |
| 1039 | 1040 | |
| 1040 | 1041 | pub fn iterate(self: *Defer, index: usize) ?*Node { |
| ... | ... | @@ -1836,8 +1837,7 @@ pub const Node = struct { |
| 1836 | 1837 | var i = index; |
| 1837 | 1838 | |
| 1838 | 1839 | switch (self.kind) { |
| 1839 | .Break, | |
| 1840 | .Continue => |maybe_label| { | |
| 1840 | .Break, .Continue => |maybe_label| { | |
| 1841 | 1841 | if (maybe_label) |label| { |
| 1842 | 1842 | if (i < 1) return label; |
| 1843 | 1843 | i -= 1; |
| ... | ... | @@ -1864,8 +1864,7 @@ pub const Node = struct { |
| 1864 | 1864 | } |
| 1865 | 1865 | |
| 1866 | 1866 | switch (self.kind) { |
| 1867 | .Break, | |
| 1868 | .Continue => |maybe_label| { | |
| 1867 | .Break, .Continue => |maybe_label| { | |
| 1869 | 1868 | if (maybe_label) |label| { |
| 1870 | 1869 | return label.lastToken(); |
| 1871 | 1870 | } |
lib/std/zig/parse.zig+6-1| ... | ... | @@ -465,7 +465,7 @@ fn parseContainerField(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*No |
| 465 | 465 | /// / KEYWORD_noasync BlockExprStatement |
| 466 | 466 | /// / KEYWORD_suspend (SEMICOLON / BlockExprStatement) |
| 467 | 467 | /// / KEYWORD_defer BlockExprStatement |
| 468 | /// / KEYWORD_errdefer BlockExprStatement | |
| 468 | /// / KEYWORD_errdefer Payload? BlockExprStatement | |
| 469 | 469 | /// / IfStatement |
| 470 | 470 | /// / LabeledStatement |
| 471 | 471 | /// / SwitchExpr |
| ... | ... | @@ -526,6 +526,10 @@ fn parseStatement(arena: *Allocator, it: *TokenIterator, tree: *Tree) Error!?*No |
| 526 | 526 | |
| 527 | 527 | const defer_token = eatToken(it, .Keyword_defer) orelse eatToken(it, .Keyword_errdefer); |
| 528 | 528 | if (defer_token) |token| { |
| 529 | const payload = if (tree.tokens.at(token).id == .Keyword_errdefer) | |
| 530 | try parsePayload(arena, it, tree) | |
| 531 | else | |
| 532 | null; | |
| 529 | 533 | const expr_node = try expectNode(arena, it, tree, parseBlockExprStatement, .{ |
| 530 | 534 | .ExpectedBlockOrExpression = .{ .token = it.index }, |
| 531 | 535 | }); |
| ... | ... | @@ -533,6 +537,7 @@ fn parseStatement(arena: *Allocator, it: *TokenIterator, tree: *Tree) Error!?*No |
| 533 | 537 | node.* = .{ |
| 534 | 538 | .defer_token = token, |
| 535 | 539 | .expr = expr_node, |
| 540 | .payload = payload, | |
| 536 | 541 | }; |
| 537 | 542 | return &node.base; |
| 538 | 543 | } |
lib/std/zig/parser_test.zig+13| ... | ... | @@ -1,3 +1,16 @@ |
| 1 | test "zig fmt: errdefer with payload" { | |
| 2 | try testCanonical( | |
| 3 | \\pub fn main() anyerror!void { | |
| 4 | \\ errdefer |a| x += 1; | |
| 5 | \\ errdefer |a| {} | |
| 6 | \\ errdefer |a| { | |
| 7 | \\ x += 1; | |
| 8 | \\ } | |
| 9 | \\} | |
| 10 | \\ | |
| 11 | ); | |
| 12 | } | |
| 13 | ||
| 1 | 14 | test "zig fmt: noasync block" { |
| 2 | 15 | try testCanonical( |
| 3 | 16 | \\pub fn main() anyerror!void { |
lib/std/zig/render.zig+3| ... | ... | @@ -376,6 +376,9 @@ fn renderExpression( |
| 376 | 376 | const defer_node = @fieldParentPtr(ast.Node.Defer, "base", base); |
| 377 | 377 | |
| 378 | 378 | try renderToken(tree, stream, defer_node.defer_token, indent, start_col, Space.Space); |
| 379 | if (defer_node.payload) |payload| { | |
| 380 | try renderExpression(allocator, stream, tree, indent, start_col, payload, Space.Space); | |
| 381 | } | |
| 379 | 382 | return renderExpression(allocator, stream, tree, indent, start_col, defer_node.expr, space); |
| 380 | 383 | }, |
| 381 | 384 | .Comptime => { |
src-self-hosted/stage2.zig+8| ... | ... | @@ -909,6 +909,7 @@ const Stage2Target = extern struct { |
| 909 | 909 | os_builtin_str: ?[*:0]const u8, |
| 910 | 910 | |
| 911 | 911 | dynamic_linker: ?[*:0]const u8, |
| 912 | standard_dynamic_linker_path: ?[*:0]const u8, | |
| 912 | 913 | |
| 913 | 914 | fn fromTarget(self: *Stage2Target, cross_target: CrossTarget) !void { |
| 914 | 915 | const allocator = std.heap.c_allocator; |
| ... | ... | @@ -1119,6 +1120,12 @@ const Stage2Target = extern struct { |
| 1119 | 1120 | } |
| 1120 | 1121 | }; |
| 1121 | 1122 | |
| 1123 | const std_dl = target.standardDynamicLinkerPath(); | |
| 1124 | const std_dl_z = if (std_dl.get()) |dl| | |
| 1125 | (try mem.dupeZ(std.heap.c_allocator, u8, dl)).ptr | |
| 1126 | else | |
| 1127 | null; | |
| 1128 | ||
| 1122 | 1129 | const cache_hash_slice = cache_hash.toOwnedSlice(); |
| 1123 | 1130 | self.* = .{ |
| 1124 | 1131 | .arch = @enumToInt(target.cpu.arch) + 1, // skip over ZigLLVM_UnknownArch |
| ... | ... | @@ -1134,6 +1141,7 @@ const Stage2Target = extern struct { |
| 1134 | 1141 | .is_native = cross_target.isNative(), |
| 1135 | 1142 | .glibc_or_darwin_version = glibc_or_darwin_version, |
| 1136 | 1143 | .dynamic_linker = dynamic_linker, |
| 1144 | .standard_dynamic_linker_path = std_dl_z, | |
| 1137 | 1145 | }; |
| 1138 | 1146 | } |
| 1139 | 1147 | }; |
src/all_types.hpp+2| ... | ... | @@ -744,6 +744,7 @@ struct AstNodeReturnExpr { |
| 744 | 744 | |
| 745 | 745 | struct AstNodeDefer { |
| 746 | 746 | ReturnKind kind; |
| 747 | AstNode *err_payload; | |
| 747 | 748 | AstNode *expr; |
| 748 | 749 | |
| 749 | 750 | // temporary data used in IR generation |
| ... | ... | @@ -2266,6 +2267,7 @@ struct CodeGen { |
| 2266 | 2267 | Buf *zig_lib_dir; |
| 2267 | 2268 | Buf *zig_std_dir; |
| 2268 | 2269 | Buf *version_script_path; |
| 2270 | Buf *override_soname; | |
| 2269 | 2271 | |
| 2270 | 2272 | const char **llvm_argv; |
| 2271 | 2273 | size_t llvm_argv_len; |
src/codegen.cpp+1| ... | ... | @@ -10504,6 +10504,7 @@ static Error check_cache(CodeGen *g, Buf *manifest_dir, Buf *digest) { |
| 10504 | 10504 | cache_str(ch, g->libc->kernel32_lib_dir); |
| 10505 | 10505 | } |
| 10506 | 10506 | cache_buf_opt(ch, g->version_script_path); |
| 10507 | cache_buf_opt(ch, g->override_soname); | |
| 10507 | 10508 | |
| 10508 | 10509 | // gen_c_objects appends objects to g->link_objects which we want to include in the hash |
| 10509 | 10510 | gen_c_objects(g); |
src/glibc.cpp+10| ... | ... | @@ -16,6 +16,7 @@ static const ZigGLibCLib glibc_libs[] = { |
| 16 | 16 | {"pthread", 0}, |
| 17 | 17 | {"dl", 2}, |
| 18 | 18 | {"rt", 1}, |
| 19 | {"ld", 2}, | |
| 19 | 20 | }; |
| 20 | 21 | |
| 21 | 22 | Error glibc_load_metadata(ZigGLibCAbi **out_result, Buf *zig_lib_dir, bool verbose) { |
| ... | ... | @@ -330,6 +331,8 @@ Error glibc_build_dummies_and_maps(CodeGen *g, const ZigGLibCAbi *glibc_abi, con |
| 330 | 331 | return err; |
| 331 | 332 | } |
| 332 | 333 | |
| 334 | bool is_ld = (strcmp(lib->name, "ld") == 0); | |
| 335 | ||
| 333 | 336 | CodeGen *child_gen = create_child_codegen(g, zig_file_path, OutTypeLib, nullptr, lib->name, progress_node); |
| 334 | 337 | codegen_set_lib_version(child_gen, lib->sover, 0, 0); |
| 335 | 338 | child_gen->is_dynamic = true; |
| ... | ... | @@ -337,6 +340,13 @@ Error glibc_build_dummies_and_maps(CodeGen *g, const ZigGLibCAbi *glibc_abi, con |
| 337 | 340 | child_gen->version_script_path = map_file_path; |
| 338 | 341 | child_gen->enable_cache = false; |
| 339 | 342 | child_gen->output_dir = dummy_dir; |
| 343 | if (is_ld) { | |
| 344 | assert(g->zig_target->standard_dynamic_linker_path != nullptr); | |
| 345 | Buf *ld_basename = buf_alloc(); | |
| 346 | os_path_split(buf_create_from_str(g->zig_target->standard_dynamic_linker_path), | |
| 347 | nullptr, ld_basename); | |
| 348 | child_gen->override_soname = ld_basename; | |
| 349 | } | |
| 340 | 350 | codegen_build_and_link(child_gen); |
| 341 | 351 | } |
| 342 | 352 |
src/ir.cpp+101-30| ... | ... | @@ -272,6 +272,10 @@ static ResultLoc *no_result_loc(void); |
| 272 | 272 | static IrInstGen *ir_analyze_test_non_null(IrAnalyze *ira, IrInst *source_inst, IrInstGen *value); |
| 273 | 273 | static IrInstGen *ir_error_dependency_loop(IrAnalyze *ira, IrInst *source_instr); |
| 274 | 274 | static IrInstGen *ir_const_undef(IrAnalyze *ira, IrInst *source_instruction, ZigType *ty); |
| 275 | static ZigVar *ir_create_var(IrBuilderSrc *irb, AstNode *node, Scope *scope, Buf *name, | |
| 276 | bool src_is_const, bool gen_is_const, bool is_shadowable, IrInstSrc *is_comptime); | |
| 277 | static void build_decl_var_and_init(IrBuilderSrc *irb, Scope *scope, AstNode *source_node, ZigVar *var, | |
| 278 | IrInstSrc *init, const char *name_hint, IrInstSrc *is_comptime); | |
| 275 | 279 | |
| 276 | 280 | static void destroy_instruction_src(IrInstSrc *inst) { |
| 277 | 281 | switch (inst->id) { |
| ... | ... | @@ -5011,39 +5015,73 @@ static IrInstSrc *ir_mark_gen(IrInstSrc *instruction) { |
| 5011 | 5015 | return instruction; |
| 5012 | 5016 | } |
| 5013 | 5017 | |
| 5014 | static bool ir_gen_defers_for_block(IrBuilderSrc *irb, Scope *inner_scope, Scope *outer_scope, bool gen_error_defers) { | |
| 5018 | static bool ir_gen_defers_for_block(IrBuilderSrc *irb, Scope *inner_scope, Scope *outer_scope, bool *is_noreturn, IrInstSrc *err_value) { | |
| 5015 | 5019 | Scope *scope = inner_scope; |
| 5016 | bool is_noreturn = false; | |
| 5020 | if (is_noreturn != nullptr) *is_noreturn = false; | |
| 5017 | 5021 | while (scope != outer_scope) { |
| 5018 | 5022 | if (!scope) |
| 5019 | return is_noreturn; | |
| 5023 | return true; | |
| 5020 | 5024 | |
| 5021 | 5025 | switch (scope->id) { |
| 5022 | 5026 | case ScopeIdDefer: { |
| 5023 | 5027 | AstNode *defer_node = scope->source_node; |
| 5024 | 5028 | assert(defer_node->type == NodeTypeDefer); |
| 5025 | 5029 | ReturnKind defer_kind = defer_node->data.defer.kind; |
| 5026 | if (defer_kind == ReturnKindUnconditional || | |
| 5027 | (gen_error_defers && defer_kind == ReturnKindError)) | |
| 5028 | { | |
| 5029 | AstNode *defer_expr_node = defer_node->data.defer.expr; | |
| 5030 | Scope *defer_expr_scope = defer_node->data.defer.expr_scope; | |
| 5031 | IrInstSrc *defer_expr_value = ir_gen_node(irb, defer_expr_node, defer_expr_scope); | |
| 5032 | if (defer_expr_value != irb->codegen->invalid_inst_src) { | |
| 5033 | if (defer_expr_value->is_noreturn) { | |
| 5034 | is_noreturn = true; | |
| 5035 | } else { | |
| 5036 | ir_mark_gen(ir_build_check_statement_is_void(irb, defer_expr_scope, defer_expr_node, | |
| 5037 | defer_expr_value)); | |
| 5038 | } | |
| 5030 | AstNode *defer_expr_node = defer_node->data.defer.expr; | |
| 5031 | AstNode *defer_var_node = defer_node->data.defer.err_payload; | |
| 5032 | ||
| 5033 | if (defer_kind == ReturnKindError && err_value == nullptr) { | |
| 5034 | // This is an `errdefer` but we're generating code for a | |
| 5035 | // `return` that doesn't return an error, skip it | |
| 5036 | scope = scope->parent; | |
| 5037 | continue; | |
| 5038 | } | |
| 5039 | ||
| 5040 | Scope *defer_expr_scope = defer_node->data.defer.expr_scope; | |
| 5041 | if (defer_var_node != nullptr) { | |
| 5042 | assert(defer_kind == ReturnKindError); | |
| 5043 | assert(defer_var_node->type == NodeTypeSymbol); | |
| 5044 | Buf *var_name = defer_var_node->data.symbol_expr.symbol; | |
| 5045 | ||
| 5046 | if (defer_expr_node->type == NodeTypeUnreachable) { | |
| 5047 | add_node_error(irb->codegen, defer_var_node, | |
| 5048 | buf_sprintf("unused variable: '%s'", buf_ptr(var_name))); | |
| 5049 | return false; | |
| 5050 | } | |
| 5051 | ||
| 5052 | IrInstSrc *is_comptime; | |
| 5053 | if (ir_should_inline(irb->exec, defer_expr_scope)) { | |
| 5054 | is_comptime = ir_build_const_bool(irb, defer_expr_scope, | |
| 5055 | defer_expr_node, true); | |
| 5056 | } else { | |
| 5057 | is_comptime = ir_build_test_comptime(irb, defer_expr_scope, | |
| 5058 | defer_expr_node, err_value); | |
| 5039 | 5059 | } |
| 5060 | ||
| 5061 | ZigVar *err_var = ir_create_var(irb, defer_var_node, defer_expr_scope, | |
| 5062 | var_name, true, true, false, is_comptime); | |
| 5063 | build_decl_var_and_init(irb, defer_expr_scope, defer_var_node, err_var, err_value, | |
| 5064 | buf_ptr(var_name), is_comptime); | |
| 5065 | ||
| 5066 | defer_expr_scope = err_var->child_scope; | |
| 5067 | } | |
| 5068 | ||
| 5069 | IrInstSrc *defer_expr_value = ir_gen_node(irb, defer_expr_node, defer_expr_scope); | |
| 5070 | if (defer_expr_value == irb->codegen->invalid_inst_src) | |
| 5071 | return irb->codegen->invalid_inst_src; | |
| 5072 | ||
| 5073 | if (defer_expr_value->is_noreturn) { | |
| 5074 | if (is_noreturn != nullptr) *is_noreturn = true; | |
| 5075 | } else { | |
| 5076 | ir_mark_gen(ir_build_check_statement_is_void(irb, defer_expr_scope, defer_expr_node, | |
| 5077 | defer_expr_value)); | |
| 5040 | 5078 | } |
| 5041 | 5079 | scope = scope->parent; |
| 5042 | 5080 | continue; |
| 5043 | 5081 | } |
| 5044 | 5082 | case ScopeIdDecls: |
| 5045 | 5083 | case ScopeIdFnDef: |
| 5046 | return is_noreturn; | |
| 5084 | return true; | |
| 5047 | 5085 | case ScopeIdBlock: |
| 5048 | 5086 | case ScopeIdVarDecl: |
| 5049 | 5087 | case ScopeIdLoop: |
| ... | ... | @@ -5060,7 +5098,7 @@ static bool ir_gen_defers_for_block(IrBuilderSrc *irb, Scope *inner_scope, Scope |
| 5060 | 5098 | zig_unreachable(); |
| 5061 | 5099 | } |
| 5062 | 5100 | } |
| 5063 | return is_noreturn; | |
| 5101 | return true; | |
| 5064 | 5102 | } |
| 5065 | 5103 | |
| 5066 | 5104 | static void ir_set_cursor_at_end_gen(IrBuilderGen *irb, IrBasicBlockGen *basic_block) { |
| ... | ... | @@ -5146,7 +5184,8 @@ static IrInstSrc *ir_gen_return(IrBuilderSrc *irb, Scope *scope, AstNode *node, |
| 5146 | 5184 | bool have_err_defers = defer_counts[ReturnKindError] > 0; |
| 5147 | 5185 | if (!have_err_defers && !irb->codegen->have_err_ret_tracing) { |
| 5148 | 5186 | // only generate unconditional defers |
| 5149 | ir_gen_defers_for_block(irb, scope, outer_scope, false); | |
| 5187 | if (!ir_gen_defers_for_block(irb, scope, outer_scope, nullptr, nullptr)) | |
| 5188 | return irb->codegen->invalid_inst_src; | |
| 5150 | 5189 | IrInstSrc *result = ir_build_return_src(irb, scope, node, nullptr); |
| 5151 | 5190 | result_loc_ret->base.source_instruction = result; |
| 5152 | 5191 | return result; |
| ... | ... | @@ -5169,14 +5208,16 @@ static IrInstSrc *ir_gen_return(IrBuilderSrc *irb, Scope *scope, AstNode *node, |
| 5169 | 5208 | IrBasicBlockSrc *ret_stmt_block = ir_create_basic_block(irb, scope, "RetStmt"); |
| 5170 | 5209 | |
| 5171 | 5210 | ir_set_cursor_at_end_and_append_block(irb, err_block); |
| 5172 | ir_gen_defers_for_block(irb, scope, outer_scope, true); | |
| 5211 | if (!ir_gen_defers_for_block(irb, scope, outer_scope, nullptr, return_value)) | |
| 5212 | return irb->codegen->invalid_inst_src; | |
| 5173 | 5213 | if (irb->codegen->have_err_ret_tracing && !should_inline) { |
| 5174 | 5214 | ir_build_save_err_ret_addr_src(irb, scope, node); |
| 5175 | 5215 | } |
| 5176 | 5216 | ir_build_br(irb, scope, node, ret_stmt_block, is_comptime); |
| 5177 | 5217 | |
| 5178 | 5218 | ir_set_cursor_at_end_and_append_block(irb, ok_block); |
| 5179 | ir_gen_defers_for_block(irb, scope, outer_scope, false); | |
| 5219 | if (!ir_gen_defers_for_block(irb, scope, outer_scope, nullptr, nullptr)) | |
| 5220 | return irb->codegen->invalid_inst_src; | |
| 5180 | 5221 | ir_build_br(irb, scope, node, ret_stmt_block, is_comptime); |
| 5181 | 5222 | |
| 5182 | 5223 | ir_set_cursor_at_end_and_append_block(irb, ret_stmt_block); |
| ... | ... | @@ -5213,7 +5254,12 @@ static IrInstSrc *ir_gen_return(IrBuilderSrc *irb, Scope *scope, AstNode *node, |
| 5213 | 5254 | result_loc_ret->base.id = ResultLocIdReturn; |
| 5214 | 5255 | ir_build_reset_result(irb, scope, node, &result_loc_ret->base); |
| 5215 | 5256 | ir_build_end_expr(irb, scope, node, err_val, &result_loc_ret->base); |
| 5216 | if (!ir_gen_defers_for_block(irb, scope, outer_scope, true)) { | |
| 5257 | ||
| 5258 | bool is_noreturn = false; | |
| 5259 | if (!ir_gen_defers_for_block(irb, scope, outer_scope, &is_noreturn, err_val)) { | |
| 5260 | return irb->codegen->invalid_inst_src; | |
| 5261 | } | |
| 5262 | if (!is_noreturn) { | |
| 5217 | 5263 | if (irb->codegen->have_err_ret_tracing && !should_inline) { |
| 5218 | 5264 | ir_build_save_err_ret_addr_src(irb, scope, node); |
| 5219 | 5265 | } |
| ... | ... | @@ -5415,7 +5461,8 @@ static IrInstSrc *ir_gen_block(IrBuilderSrc *irb, Scope *parent_scope, AstNode * |
| 5415 | 5461 | |
| 5416 | 5462 | bool is_return_from_fn = block_node == irb->main_block_node; |
| 5417 | 5463 | if (!is_return_from_fn) { |
| 5418 | ir_gen_defers_for_block(irb, child_scope, outer_block_scope, false); | |
| 5464 | if (!ir_gen_defers_for_block(irb, child_scope, outer_block_scope, nullptr, nullptr)) | |
| 5465 | return irb->codegen->invalid_inst_src; | |
| 5419 | 5466 | } |
| 5420 | 5467 | |
| 5421 | 5468 | IrInstSrc *result; |
| ... | ... | @@ -5440,7 +5487,8 @@ static IrInstSrc *ir_gen_block(IrBuilderSrc *irb, Scope *parent_scope, AstNode * |
| 5440 | 5487 | result_loc_ret->base.id = ResultLocIdReturn; |
| 5441 | 5488 | ir_build_reset_result(irb, parent_scope, block_node, &result_loc_ret->base); |
| 5442 | 5489 | ir_mark_gen(ir_build_end_expr(irb, parent_scope, block_node, result, &result_loc_ret->base)); |
| 5443 | ir_gen_defers_for_block(irb, child_scope, outer_block_scope, false); | |
| 5490 | if (!ir_gen_defers_for_block(irb, child_scope, outer_block_scope, nullptr, nullptr)) | |
| 5491 | return irb->codegen->invalid_inst_src; | |
| 5444 | 5492 | return ir_mark_gen(ir_build_return_src(irb, child_scope, result->base.source_node, result)); |
| 5445 | 5493 | } |
| 5446 | 5494 | |
| ... | ... | @@ -9207,7 +9255,8 @@ static IrInstSrc *ir_gen_return_from_block(IrBuilderSrc *irb, Scope *break_scope |
| 9207 | 9255 | } |
| 9208 | 9256 | |
| 9209 | 9257 | IrBasicBlockSrc *dest_block = block_scope->end_block; |
| 9210 | ir_gen_defers_for_block(irb, break_scope, dest_block->scope, false); | |
| 9258 | if (!ir_gen_defers_for_block(irb, break_scope, dest_block->scope, nullptr, nullptr)) | |
| 9259 | return irb->codegen->invalid_inst_src; | |
| 9211 | 9260 | |
| 9212 | 9261 | block_scope->incoming_blocks->append(irb->current_basic_block); |
| 9213 | 9262 | block_scope->incoming_values->append(result_value); |
| ... | ... | @@ -9281,7 +9330,8 @@ static IrInstSrc *ir_gen_break(IrBuilderSrc *irb, Scope *break_scope, AstNode *n |
| 9281 | 9330 | } |
| 9282 | 9331 | |
| 9283 | 9332 | IrBasicBlockSrc *dest_block = loop_scope->break_block; |
| 9284 | ir_gen_defers_for_block(irb, break_scope, dest_block->scope, false); | |
| 9333 | if (!ir_gen_defers_for_block(irb, break_scope, dest_block->scope, nullptr, nullptr)) | |
| 9334 | return irb->codegen->invalid_inst_src; | |
| 9285 | 9335 | |
| 9286 | 9336 | loop_scope->incoming_blocks->append(irb->current_basic_block); |
| 9287 | 9337 | loop_scope->incoming_values->append(result_value); |
| ... | ... | @@ -9340,7 +9390,8 @@ static IrInstSrc *ir_gen_continue(IrBuilderSrc *irb, Scope *continue_scope, AstN |
| 9340 | 9390 | } |
| 9341 | 9391 | |
| 9342 | 9392 | IrBasicBlockSrc *dest_block = loop_scope->continue_block; |
| 9343 | ir_gen_defers_for_block(irb, continue_scope, dest_block->scope, false); | |
| 9393 | if (!ir_gen_defers_for_block(irb, continue_scope, dest_block->scope, nullptr, nullptr)) | |
| 9394 | return irb->codegen->invalid_inst_src; | |
| 9344 | 9395 | return ir_mark_gen(ir_build_br(irb, continue_scope, node, dest_block, is_comptime)); |
| 9345 | 9396 | } |
| 9346 | 9397 | |
| ... | ... | @@ -12317,11 +12368,22 @@ static ZigType *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_node, ZigT |
| 12317 | 12368 | prev_type->data.pointer.child_type->id == ZigTypeIdArray && |
| 12318 | 12369 | prev_type->data.pointer.ptr_len == PtrLenSingle && |
| 12319 | 12370 | ((cur_type->id == ZigTypeIdErrorUnion && is_slice(cur_type->data.error_union.payload_type)) || |
| 12320 | is_slice(cur_type))) | |
| 12371 | (cur_type->id == ZigTypeIdOptional && is_slice(cur_type->data.maybe.child_type)) || | |
| 12372 | is_slice(cur_type))) | |
| 12321 | 12373 | { |
| 12322 | 12374 | ZigType *array_type = prev_type->data.pointer.child_type; |
| 12323 | ZigType *slice_type = (cur_type->id == ZigTypeIdErrorUnion) ? | |
| 12324 | cur_type->data.error_union.payload_type : cur_type; | |
| 12375 | ZigType *slice_type; | |
| 12376 | switch (cur_type->id) { | |
| 12377 | case ZigTypeIdErrorUnion: | |
| 12378 | slice_type = cur_type->data.error_union.payload_type; | |
| 12379 | break; | |
| 12380 | case ZigTypeIdOptional: | |
| 12381 | slice_type = cur_type->data.maybe.child_type; | |
| 12382 | break; | |
| 12383 | default: | |
| 12384 | slice_type = cur_type; | |
| 12385 | break; | |
| 12386 | } | |
| 12325 | 12387 | ZigType *slice_ptr_type = slice_type->data.structure.fields[slice_ptr_index]->type_entry; |
| 12326 | 12388 | if ((slice_ptr_type->data.pointer.is_const || array_type->data.array.len == 0 || |
| 12327 | 12389 | !prev_type->data.pointer.is_const) && |
| ... | ... | @@ -16191,6 +16253,15 @@ static IrInstGen *ir_analyze_bin_op_cmp(IrAnalyze *ira, IrInstSrcBinOp *bin_op_i |
| 16191 | 16253 | IrInstGen *union_val = op1->value->type->id == ZigTypeIdUnion ? op1 : op2; |
| 16192 | 16254 | IrInstGen *enum_val = op1->value->type->id == ZigTypeIdUnion ? op2 : op1; |
| 16193 | 16255 | |
| 16256 | if (!is_tagged_union(union_val->value->type)) { | |
| 16257 | ErrorMsg *msg = ir_add_error_node(ira, source_node, | |
| 16258 | buf_sprintf("comparison of union and enum literal is only valid for tagged union types")); | |
| 16259 | add_error_note(ira->codegen, msg, union_val->value->type->data.unionation.decl_node, | |
| 16260 | buf_sprintf("type %s is not a tagged union", | |
| 16261 | buf_ptr(&union_val->value->type->name))); | |
| 16262 | return ira->codegen->invalid_inst_gen; | |
| 16263 | } | |
| 16264 | ||
| 16194 | 16265 | ZigType *tag_type = union_val->value->type->data.unionation.tag_type; |
| 16195 | 16266 | assert(tag_type != nullptr); |
| 16196 | 16267 |
src/link.cpp+4-4| ... | ... | @@ -1651,7 +1651,6 @@ static void construct_linker_job_elf(LinkJob *lj) { |
| 1651 | 1651 | |
| 1652 | 1652 | bool is_lib = g->out_type == OutTypeLib; |
| 1653 | 1653 | bool is_dyn_lib = g->is_dynamic && is_lib; |
| 1654 | Buf *soname = nullptr; | |
| 1655 | 1654 | if (!g->have_dynamic_link) { |
| 1656 | 1655 | if (g->zig_target->arch == ZigLLVM_arm || g->zig_target->arch == ZigLLVM_armeb || |
| 1657 | 1656 | g->zig_target->arch == ZigLLVM_thumb || g->zig_target->arch == ZigLLVM_thumbeb) |
| ... | ... | @@ -1662,15 +1661,13 @@ static void construct_linker_job_elf(LinkJob *lj) { |
| 1662 | 1661 | } |
| 1663 | 1662 | } else if (is_dyn_lib) { |
| 1664 | 1663 | lj->args.append("-shared"); |
| 1665 | ||
| 1666 | assert(buf_len(&g->bin_file_output_path) != 0); | |
| 1667 | soname = buf_sprintf("lib%s.so.%" ZIG_PRI_usize, buf_ptr(g->root_out_name), g->version_major); | |
| 1668 | 1664 | } |
| 1669 | 1665 | |
| 1670 | 1666 | if (target_requires_pie(g->zig_target) && g->out_type == OutTypeExe) { |
| 1671 | 1667 | lj->args.append("-pie"); |
| 1672 | 1668 | } |
| 1673 | 1669 | |
| 1670 | assert(buf_len(&g->bin_file_output_path) != 0); | |
| 1674 | 1671 | lj->args.append("-o"); |
| 1675 | 1672 | lj->args.append(buf_ptr(&g->bin_file_output_path)); |
| 1676 | 1673 | |
| ... | ... | @@ -1740,6 +1737,9 @@ static void construct_linker_job_elf(LinkJob *lj) { |
| 1740 | 1737 | } |
| 1741 | 1738 | |
| 1742 | 1739 | if (is_dyn_lib) { |
| 1740 | Buf *soname = (g->override_soname == nullptr) ? | |
| 1741 | buf_sprintf("lib%s.so.%" ZIG_PRI_usize, buf_ptr(g->root_out_name), g->version_major) : | |
| 1742 | g->override_soname; | |
| 1743 | 1743 | lj->args.append("-soname"); |
| 1744 | 1744 | lj->args.append(buf_ptr(soname)); |
| 1745 | 1745 |
src/main.cpp+10-6| ... | ... | @@ -54,7 +54,6 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) { |
| 54 | 54 | " --cache-dir [path] override the local cache directory\n" |
| 55 | 55 | " --cache [auto|off|on] build in cache, print output path to stdout\n" |
| 56 | 56 | " --color [auto|off|on] enable or disable colored error messages\n" |
| 57 | " --disable-gen-h do not generate a C header file (.h)\n" | |
| 58 | 57 | " --disable-valgrind omit valgrind client requests in debug builds\n" |
| 59 | 58 | " --eh-frame-hdr enable C++ exception handling by passing --eh-frame-hdr to linker\n" |
| 60 | 59 | " --enable-valgrind include valgrind client requests release builds\n" |
| ... | ... | @@ -77,6 +76,8 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) { |
| 77 | 76 | " -fno-emit-asm (default) do not output .s (assembly code)\n" |
| 78 | 77 | " -femit-llvm-ir produce a .ll file with LLVM IR\n" |
| 79 | 78 | " -fno-emit-llvm-ir (default) do not produce a .ll file with LLVM IR\n" |
| 79 | " -femit-h generate a C header file (.h)\n" | |
| 80 | " -fno-emit-h (default) do not generate a C header file (.h)\n" | |
| 80 | 81 | " --libc [file] Provide a file which specifies libc paths\n" |
| 81 | 82 | " --name [name] override output name\n" |
| 82 | 83 | " --output-dir [dir] override output directory (defaults to cwd)\n" |
| ... | ... | @@ -432,6 +433,7 @@ static int main0(int argc, char **argv) { |
| 432 | 433 | bool emit_bin = true; |
| 433 | 434 | bool emit_asm = false; |
| 434 | 435 | bool emit_llvm_ir = false; |
| 436 | bool emit_h = false; | |
| 435 | 437 | const char *cache_dir = nullptr; |
| 436 | 438 | CliPkg *cur_pkg = heap::c_allocator.create<CliPkg>(); |
| 437 | 439 | BuildMode build_mode = BuildModeDebug; |
| ... | ... | @@ -440,7 +442,6 @@ static int main0(int argc, char **argv) { |
| 440 | 442 | bool system_linker_hack = false; |
| 441 | 443 | TargetSubsystem subsystem = TargetSubsystemAuto; |
| 442 | 444 | bool want_single_threaded = false; |
| 443 | bool disable_gen_h = false; | |
| 444 | 445 | bool bundle_compiler_rt = false; |
| 445 | 446 | Buf *override_lib_dir = nullptr; |
| 446 | 447 | Buf *main_pkg_path = nullptr; |
| ... | ... | @@ -661,9 +662,7 @@ static int main0(int argc, char **argv) { |
| 661 | 662 | } else if (strcmp(arg, "--system-linker-hack") == 0) { |
| 662 | 663 | system_linker_hack = true; |
| 663 | 664 | } else if (strcmp(arg, "--single-threaded") == 0) { |
| 664 | want_single_threaded = true; | |
| 665 | } else if (strcmp(arg, "--disable-gen-h") == 0) { | |
| 666 | disable_gen_h = true; | |
| 665 | want_single_threaded = true;; | |
| 667 | 666 | } else if (strcmp(arg, "--bundle-compiler-rt") == 0) { |
| 668 | 667 | bundle_compiler_rt = true; |
| 669 | 668 | } else if (strcmp(arg, "--test-cmd-bin") == 0) { |
| ... | ... | @@ -720,6 +719,11 @@ static int main0(int argc, char **argv) { |
| 720 | 719 | emit_llvm_ir = true; |
| 721 | 720 | } else if (strcmp(arg, "-fno-emit-llvm-ir") == 0) { |
| 722 | 721 | emit_llvm_ir = false; |
| 722 | } else if (strcmp(arg, "-femit-h") == 0) { | |
| 723 | emit_h = true; | |
| 724 | } else if (strcmp(arg, "-fno-emit-h") == 0 || strcmp(arg, "--disable-gen-h") == 0) { | |
| 725 | // the --disable-gen-h is there to support godbolt. once they upgrade to -fno-emit-h then we can remove this | |
| 726 | emit_h = false; | |
| 723 | 727 | } else if (str_starts_with(arg, "-mcpu=")) { |
| 724 | 728 | mcpu = arg + strlen("-mcpu="); |
| 725 | 729 | } else if (i + 1 >= argc) { |
| ... | ... | @@ -1203,7 +1207,7 @@ static int main0(int argc, char **argv) { |
| 1203 | 1207 | g->verbose_cc = verbose_cc; |
| 1204 | 1208 | g->verbose_llvm_cpu_features = verbose_llvm_cpu_features; |
| 1205 | 1209 | g->output_dir = output_dir; |
| 1206 | g->disable_gen_h = disable_gen_h; | |
| 1210 | g->disable_gen_h = !emit_h; | |
| 1207 | 1211 | g->bundle_compiler_rt = bundle_compiler_rt; |
| 1208 | 1212 | codegen_set_errmsg_color(g, color); |
| 1209 | 1213 | g->system_linker_hack = system_linker_hack; |
src/parser.cpp+9-2| ... | ... | @@ -879,7 +879,7 @@ static AstNode *ast_parse_container_field(ParseContext *pc) { |
| 879 | 879 | // / KEYWORD_noasync BlockExprStatement |
| 880 | 880 | // / KEYWORD_suspend (SEMICOLON / BlockExprStatement) |
| 881 | 881 | // / KEYWORD_defer BlockExprStatement |
| 882 | // / KEYWORD_errdefer BlockExprStatement | |
| 882 | // / KEYWORD_errdefer Payload? BlockExprStatement | |
| 883 | 883 | // / IfStatement |
| 884 | 884 | // / LabeledStatement |
| 885 | 885 | // / SwitchExpr |
| ... | ... | @@ -923,12 +923,18 @@ static AstNode *ast_parse_statement(ParseContext *pc) { |
| 923 | 923 | if (defer == nullptr) |
| 924 | 924 | defer = eat_token_if(pc, TokenIdKeywordErrdefer); |
| 925 | 925 | if (defer != nullptr) { |
| 926 | Token *payload = (defer->id == TokenIdKeywordErrdefer) ? | |
| 927 | ast_parse_payload(pc) : nullptr; | |
| 926 | 928 | AstNode *statement = ast_expect(pc, ast_parse_block_expr_statement); |
| 927 | 929 | AstNode *res = ast_create_node(pc, NodeTypeDefer, defer); |
| 930 | ||
| 928 | 931 | res->data.defer.kind = ReturnKindUnconditional; |
| 929 | 932 | res->data.defer.expr = statement; |
| 930 | if (defer->id == TokenIdKeywordErrdefer) | |
| 933 | if (defer->id == TokenIdKeywordErrdefer) { | |
| 931 | 934 | res->data.defer.kind = ReturnKindError; |
| 935 | if (payload != nullptr) | |
| 936 | res->data.defer.err_payload = token_symbol(pc, payload); | |
| 937 | } | |
| 932 | 938 | return res; |
| 933 | 939 | } |
| 934 | 940 | |
| ... | ... | @@ -3032,6 +3038,7 @@ void ast_visit_node_children(AstNode *node, void (*visit)(AstNode **, void *cont |
| 3032 | 3038 | break; |
| 3033 | 3039 | case NodeTypeDefer: |
| 3034 | 3040 | visit_field(&node->data.defer.expr, visit, context); |
| 3041 | visit_field(&node->data.defer.err_payload, visit, context); | |
| 3035 | 3042 | break; |
| 3036 | 3043 | case NodeTypeVariableDeclaration: |
| 3037 | 3044 | visit_field(&node->data.variable_declaration.type, visit, context); |
src/stage2.h+1| ... | ... | @@ -291,6 +291,7 @@ struct ZigTarget { |
| 291 | 291 | size_t cache_hash_len; |
| 292 | 292 | const char *os_builtin_str; |
| 293 | 293 | const char *dynamic_linker; |
| 294 | const char *standard_dynamic_linker_path; | |
| 294 | 295 | }; |
| 295 | 296 | |
| 296 | 297 | // ABI warning |
test/compile_errors.zig+23| ... | ... | @@ -2,6 +2,29 @@ const tests = @import("tests.zig"); |
| 2 | 2 | const std = @import("std"); |
| 3 | 3 | |
| 4 | 4 | pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5 | cases.addTest("unused variable error on errdefer", | |
| 6 | \\fn foo() !void { | |
| 7 | \\ errdefer |a| unreachable; | |
| 8 | \\ return error.A; | |
| 9 | \\} | |
| 10 | \\export fn entry() void { | |
| 11 | \\ foo() catch unreachable; | |
| 12 | \\} | |
| 13 | , &[_][]const u8{ | |
| 14 | "tmp.zig:2:15: error: unused variable: 'a'", | |
| 15 | }); | |
| 16 | ||
| 17 | cases.addTest("comparison of non-tagged union and enum literal", | |
| 18 | \\export fn entry() void { | |
| 19 | \\ const U = union { A: u32, B: u64 }; | |
| 20 | \\ var u = U{ .A = 42 }; | |
| 21 | \\ var ok = u == .A; | |
| 22 | \\} | |
| 23 | , &[_][]const u8{ | |
| 24 | "tmp.zig:4:16: error: comparison of union and enum literal is only valid for tagged union types", | |
| 25 | "tmp.zig:2:15: note: type U is not a tagged union", | |
| 26 | }); | |
| 27 | ||
| 5 | 28 | cases.addTest("shift on type with non-power-of-two size", |
| 6 | 29 | \\export fn entry() void { |
| 7 | 30 | \\ const S = struct { |
test/stage1/behavior/defer.zig+20-1| ... | ... | @@ -1,4 +1,7 @@ |
| 1 | const expect = @import("std").testing.expect; | |
| 1 | const std = @import("std"); | |
| 2 | const expect = std.testing.expect; | |
| 3 | const expectEqual = std.testing.expectEqual; | |
| 4 | const expectError = std.testing.expectError; | |
| 2 | 5 | |
| 3 | 6 | var result: [3]u8 = undefined; |
| 4 | 7 | var index: usize = undefined; |
| ... | ... | @@ -93,3 +96,19 @@ test "return variable while defer expression in scope to modify it" { |
| 93 | 96 | S.doTheTest(); |
| 94 | 97 | comptime S.doTheTest(); |
| 95 | 98 | } |
| 99 | ||
| 100 | test "errdefer with payload" { | |
| 101 | const S = struct { | |
| 102 | fn foo() !i32 { | |
| 103 | errdefer |a| { | |
| 104 | expectEqual(error.One, a); | |
| 105 | } | |
| 106 | return error.One; | |
| 107 | } | |
| 108 | fn doTheTest() void { | |
| 109 | expectError(error.One, foo()); | |
| 110 | } | |
| 111 | }; | |
| 112 | S.doTheTest(); | |
| 113 | comptime S.doTheTest(); | |
| 114 | } |
test/stage1/behavior/slice.zig+8| ... | ... | @@ -159,6 +159,7 @@ test "slice syntax resulting in pointer-to-array" { |
| 159 | 159 | testSlice(); |
| 160 | 160 | testSliceZ(); |
| 161 | 161 | testSlice0(); |
| 162 | testSliceOpt(); | |
| 162 | 163 | testSliceAlign(); |
| 163 | 164 | } |
| 164 | 165 | |
| ... | ... | @@ -249,6 +250,13 @@ test "slice syntax resulting in pointer-to-array" { |
| 249 | 250 | comptime expect(@TypeOf(slice[1..3 :4]) == *[2:4]u8); |
| 250 | 251 | } |
| 251 | 252 | |
| 253 | fn testSliceOpt() void { | |
| 254 | var array: [2]u8 = [2]u8{ 1, 2 }; | |
| 255 | var slice: ?[]u8 = &array; | |
| 256 | comptime expect(@TypeOf(&array, slice) == ?[]u8); | |
| 257 | comptime expect(@TypeOf(slice.?[0..2]) == *[2]u8); | |
| 258 | } | |
| 259 | ||
| 252 | 260 | fn testSlice0() void { |
| 253 | 261 | { |
| 254 | 262 | var array = [0]u8{}; |
test/standalone/mix_o_files/test.c+5-3| ... | ... | @@ -1,10 +1,12 @@ |
| 1 | // This header is generated by zig from base64.zig | |
| 2 | #include "base64.h" | |
| 3 | ||
| 4 | 1 | #include <assert.h> |
| 5 | 2 | #include <string.h> |
| 6 | 3 | #include <stdint.h> |
| 7 | 4 | |
| 5 | // TODO we would like to #include "base64.h" here but this feature has been disabled in | |
| 6 | // the stage1 compiler. Users will have to wait until self-hosted is available for | |
| 7 | // the "generate .h file" feature. | |
| 8 | size_t decode_base_64(uint8_t *dest_ptr, size_t dest_len, const uint8_t *source_ptr, size_t source_len); | |
| 9 | ||
| 8 | 10 | extern int *x_ptr; |
| 9 | 11 | |
| 10 | 12 | int main(int argc, char **argv) { |
test/standalone/shared_library/test.c+7-1| ... | ... | @@ -1,6 +1,12 @@ |
| 1 | #include "mathtest.h" | |
| 2 | 1 | #include <assert.h> |
| 3 | 2 | |
| 3 | // TODO we would like to #include "mathtest.h" here but this feature has been disabled in | |
| 4 | // the stage1 compiler. Users will have to wait until self-hosted is available for | |
| 5 | // the "generate .h file" feature. | |
| 6 | ||
| 7 | #include <stdint.h> | |
| 8 | int32_t add(int32_t a, int32_t b); | |
| 9 | ||
| 4 | 10 | int main(int argc, char **argv) { |
| 5 | 11 | assert(add(42, 1337) == 1379); |
| 6 | 12 | return 0; |
tools/update_glibc.zig+16-13| ... | ... | @@ -20,6 +20,7 @@ const lib_names = [_][]const u8{ |
| 20 | 20 | "m", |
| 21 | 21 | "pthread", |
| 22 | 22 | "rt", |
| 23 | "ld", | |
| 23 | 24 | }; |
| 24 | 25 | |
| 25 | 26 | // fpu/nofpu are hardcoded elsewhere, based on .gnueabi/.gnueabihf with an exception for .arm |
| ... | ... | @@ -154,22 +155,24 @@ pub fn main() !void { |
| 154 | 155 | const fn_set = &target_funcs_gop.kv.value.list; |
| 155 | 156 | |
| 156 | 157 | for (lib_names) |lib_name, lib_name_index| { |
| 157 | const basename = try fmt.allocPrint(allocator, "lib{}.abilist", .{lib_name}); | |
| 158 | const lib_prefix = if (std.mem.eql(u8, lib_name, "ld")) "" else "lib"; | |
| 159 | const basename = try fmt.allocPrint(allocator, "{}{}.abilist", .{ lib_prefix, lib_name }); | |
| 158 | 160 | const abi_list_filename = blk: { |
| 159 | if (abi_list.targets[0].abi == .gnuabi64 and std.mem.eql(u8, lib_name, "c")) { | |
| 161 | const is_c = std.mem.eql(u8, lib_name, "c"); | |
| 162 | const is_m = std.mem.eql(u8, lib_name, "m"); | |
| 163 | const is_ld = std.mem.eql(u8, lib_name, "ld"); | |
| 164 | if (abi_list.targets[0].abi == .gnuabi64 and (is_c or is_ld)) { | |
| 160 | 165 | break :blk try fs.path.join(allocator, &[_][]const u8{ prefix, abi_list.path, "n64", basename }); |
| 161 | } else if (abi_list.targets[0].abi == .gnuabin32 and std.mem.eql(u8, lib_name, "c")) { | |
| 166 | } else if (abi_list.targets[0].abi == .gnuabin32 and (is_c or is_ld)) { | |
| 162 | 167 | break :blk try fs.path.join(allocator, &[_][]const u8{ prefix, abi_list.path, "n32", basename }); |
| 163 | 168 | } else if (abi_list.targets[0].arch != .arm and |
| 164 | 169 | abi_list.targets[0].abi == .gnueabihf and |
| 165 | (std.mem.eql(u8, lib_name, "c") or | |
| 166 | (std.mem.eql(u8, lib_name, "m") and abi_list.targets[0].arch == .powerpc))) | |
| 170 | (is_c or (is_m and abi_list.targets[0].arch == .powerpc))) | |
| 167 | 171 | { |
| 168 | 172 | break :blk try fs.path.join(allocator, &[_][]const u8{ prefix, abi_list.path, "fpu", basename }); |
| 169 | 173 | } else if (abi_list.targets[0].arch != .arm and |
| 170 | 174 | abi_list.targets[0].abi == .gnueabi and |
| 171 | (std.mem.eql(u8, lib_name, "c") or | |
| 172 | (std.mem.eql(u8, lib_name, "m") and abi_list.targets[0].arch == .powerpc))) | |
| 175 | (is_c or (is_m and abi_list.targets[0].arch == .powerpc))) | |
| 173 | 176 | { |
| 174 | 177 | break :blk try fs.path.join(allocator, &[_][]const u8{ prefix, abi_list.path, "nofpu", basename }); |
| 175 | 178 | } else if (abi_list.targets[0].arch == .arm) { |
| ... | ... | @@ -234,8 +237,8 @@ pub fn main() !void { |
| 234 | 237 | const vers_txt_path = try fs.path.join(allocator, &[_][]const u8{ glibc_out_dir, "vers.txt" }); |
| 235 | 238 | const vers_txt_file = try fs.cwd().createFile(vers_txt_path, .{}); |
| 236 | 239 | defer vers_txt_file.close(); |
| 237 | var buffered = std.io.BufferedOutStream(fs.File.WriteError).init(&vers_txt_file.outStream().stream); | |
| 238 | const vers_txt = &buffered.stream; | |
| 240 | var buffered = std.io.bufferedOutStream(vers_txt_file.outStream()); | |
| 241 | const vers_txt = buffered.outStream(); | |
| 239 | 242 | for (global_ver_list) |name, i| { |
| 240 | 243 | _ = global_ver_set.put(name, i) catch unreachable; |
| 241 | 244 | try vers_txt.print("{}\n", .{name}); |
| ... | ... | @@ -246,8 +249,8 @@ pub fn main() !void { |
| 246 | 249 | const fns_txt_path = try fs.path.join(allocator, &[_][]const u8{ glibc_out_dir, "fns.txt" }); |
| 247 | 250 | const fns_txt_file = try fs.cwd().createFile(fns_txt_path, .{}); |
| 248 | 251 | defer fns_txt_file.close(); |
| 249 | var buffered = std.io.BufferedOutStream(fs.File.WriteError).init(&fns_txt_file.outStream().stream); | |
| 250 | const fns_txt = &buffered.stream; | |
| 252 | var buffered = std.io.bufferedOutStream(fns_txt_file.outStream()); | |
| 253 | const fns_txt = buffered.outStream(); | |
| 251 | 254 | for (global_fn_list) |name, i| { |
| 252 | 255 | const kv = global_fn_set.get(name).?; |
| 253 | 256 | kv.value.index = i; |
| ... | ... | @@ -277,8 +280,8 @@ pub fn main() !void { |
| 277 | 280 | const abilist_txt_path = try fs.path.join(allocator, &[_][]const u8{ glibc_out_dir, "abi.txt" }); |
| 278 | 281 | const abilist_txt_file = try fs.cwd().createFile(abilist_txt_path, .{}); |
| 279 | 282 | defer abilist_txt_file.close(); |
| 280 | var buffered = std.io.BufferedOutStream(fs.File.WriteError).init(&abilist_txt_file.outStream().stream); | |
| 281 | const abilist_txt = &buffered.stream; | |
| 283 | var buffered = std.io.bufferedOutStream(abilist_txt_file.outStream()); | |
| 284 | const abilist_txt = buffered.outStream(); | |
| 282 | 285 | |
| 283 | 286 | // first iterate over the abi lists |
| 284 | 287 | for (abi_lists) |*abi_list, abi_index| { |