Commit Graph

22488 Commits

Author SHA1 Message Date
Stephen Gregoratto
d4ce0fe7fe Update Linux syscall list for 6.1, support Mips64
Follow up for #14541.
2023-02-05 03:25:21 -05:00
ee7
289e8fab79 langref, tools: rename --single-threaded to -fsingle-threaded
Commit 40f5e5dfc6 ("CLI: introduce -fsingle-threaded/
-fno-single-threaded", 2021-12-01) removed the `--single-threaded`
option, but didn't update all mentions of it.

    $ zig version
    0.11.0-dev.1568+c9b957c93
    $ zig build-exe --help | grep single
      -fsingle-threaded         Code assumes there is only one thread
      -fno-single-threaded      Code may not assume there is only one thread
    $ zig build-exe --single-threaded foo.zig
    error: unrecognized parameter: '--single-threaded'
2023-02-04 23:24:07 +02:00
Jonathan Marler
1876eaec51 mark deprecated assumeSentinel as pub
assumeSentinel was removed and replaced with a compileError, but it's
not pub, so the error message indicates it's private rather than
providing the compileError message.
2023-02-04 23:19:00 +02:00
Nicolas Goy
b7c96c3bbd Allow const for ArrayList.getLast, fix #14522 2023-02-04 15:24:45 -05:00
Suirad
7f24993772 Add support for mips64/mips64el 2023-02-04 15:19:53 -05:00
Manlio Perillo
c1f71963a9 compiler_rt: fix and improve documentation
- In Integer Bit Operations, use zeros consistently and fix the
    incorrect function descriptions
  - In ucmp, fix the incorrect signedness of the operands
  - In Integer Arithmetic, document the signedness of the operands in
    div, udiv, mod, umod, udivmod and divmod as it is done in LLVM
    documentation
  - In Float Conversion, replace "int_to_float" to "int to float" and
    "uint_to_float" to "uint to float"
2023-02-04 17:23:03 +02:00
Andrew Kelley
693b12f8e1 std.Build: support exposing and depending on zig modules
New API introduced: std.Build.addModule

This function exposes a zig module with the given name, which can be
used by packages that depend on this one via std.Build.Dependency.module.

std.Build.Pkg and related functionality is deleted. Every use case has a
straightforward upgrade path using the new Module struct.

std.Build.OptionsStep.getPackage is replaced by
std.Build.OptionsStep.createModule.

std.Build.CompileStep.addPackagePath is replaced by
std.Build.CompileStep.addAnonymousModule.

This partially addresses #14307 by renaming some of the instances of
"package" to "module".

Closes #14278
2023-02-04 01:55:39 -05:00
Marc Tiehuis
4009e0d2b1 remove stage1 workaround for big int set
Underlying fix should have been d7b029995c.

u128 limb sizes are still not fully tested as we are missing compiler-rt
support (__divei4, __modei4 on x86_64). Should be no zig blockers so the
assertion has been removed.
2023-02-04 00:29:04 -05:00
Luuk de Gram
c9b957c937 link: remove FnData and make it self-owned
This finishes the work started in #14502 where atoms are owned by the
linker themselves. This now makes debug atoms fully owned by dwarf,
and no information is left stored on the decl.
2023-02-03 22:55:46 +01:00
Andrew Kelley
60935decd3
Merge pull request #14523 from ziglang/zon
introduce Zig Object Notation and use it for the build manifest file (build.zig.zon)
2023-02-03 14:20:49 -05:00
Loris Cro
4c7f8286d5 autodoc: fix search regression 2023-02-03 18:05:07 +01:00
Loris Cro
e59ef95a40
Merge pull request #14515 from der-teufel-programming/autodoc-quickfixes
autodoc: Added `@qualCast` builtin function handling
2023-02-03 17:55:31 +01:00
Loris Cro
93c56a70c4
Merge pull request #14489 from der-teufel-programming/autodoc-initempty
autodoc: Implemented struct_init_empty for walkInstruction
2023-02-03 17:52:23 +01:00
Manlio Perillo
c181ba1022 langref: remove link to closed issue #4026
In the math builtin functions documentation, remove the link to issue
https://github.com/ziglang/zig/issues/4026, since it was closed by
https://github.com/ziglang/zig/pull/11532.
2023-02-03 14:49:17 +02:00
Ryan Liptak
9db084f43d Add test for optional error set return types
Closes #5820
2023-02-03 14:48:08 +02:00
Andrew Kelley
81c27c74bc use build.zig.zon instead of build.zig.ini for the manifest file
* improve error message when build manifest file is missing
 * update std.zig.Ast to support ZON
 * Compilation.AllErrors.Message: make the notes field a const slice
 * move build manifest parsing logic into src/Manifest.zig and add more
   checks, and make the checks integrate into the standard error
   reporting code so that reported errors look sexy

closes #14290
2023-02-03 00:06:11 -07:00
Andrew Kelley
873bb29c98 introduce ZON: Zig Object Notation
* std.zig.parse is moved to std.zig.Ast.parse
 * the new function has an additional parameter that requires passing
   Mode.zig or Mode.zon
 * moved parser.zig code to Parse.zig
 * added parseZon function next to parseRoot function
2023-02-03 00:06:11 -07:00
Jan Philipp Hafer
03cdb4fb58 compiler_rt: make README visually nice and improve explanations
This commit makes the text more dense with sources, noes the outstanding
audit and adds an explanation of the table before converting everything
to markdown tables.

For the status a checkmark or cross in utf8 encoding are used and the
input and output sizes of all operations are given inclusive comments for
understanding of the routines.

This should document all compiler_rt integer and float routines, but
does not include a documentation of existing ieee floating and math
routines.
2023-02-02 17:45:38 -05:00
Andrew Kelley
7505d19e93
Merge pull request #14511 from ziglang/zig-build-hashes
two package hash breaking enhancements
2023-02-02 14:03:41 -05:00
Krzysztof Wolicki Der Teufel
c3abb63fe9 autodoc: Added @qualCast builtin function handling 2023-02-02 14:47:16 +01:00
Andrew Kelley
6b7ad22981
Merge pull request #14477 from Vexu/fixes
Improve `@ptrCast` errors, fix some bugs
2023-02-01 23:31:52 -05:00
Kirk Scheibelhut
e712d5f03e remove reference to removed addTestExe 2023-02-01 22:52:32 -05:00
praschke
72a7e3dc5e mingw: stop using K&R-style function definitions
this patch is from upstream, to fix -Wdeprecated-non-prototypes issues.

K&R-style has apparently been deprecated since even C89, and C2x will be
repurposing the syntax space. this warning triggers when the change would
affect the meaning of the code.
2023-02-01 22:11:16 -05:00
Andrew Kelley
24ff8a1a5f zig build: use multihash for the hash field
https://multiformats.io/multihash/

Still, only SHA2-256 is supported. This is only intended to future-proof
the hash field of the manifest.

closes #14284
2023-02-01 20:02:35 -07:00
Andrew Kelley
ea6e0e33a7 zig build: add executable bit and file path to package hash
Unfortunately, due to the Windows equivalent of executable permissions
being a bit tricky, there is follow-up work to be done.

What is done in this commit is the hash modifications. At the fetch
layer, executable bits inside packages are ignored. In the hash
computation layer, executable bit is implemented for POSIX but not yet
for Windows. This means that the hash will not break again in the future
for packages that do not have any executable files, but it will break
for packages that do.

This is a hash-breaking change.

Closes #14308
2023-02-01 18:42:29 -07:00
Jakub Konka
304420b99c
Merge pull request #14502 from ziglang/link-owned-atoms
link: move ownership of linker atom from frontend to the linkers
2023-02-02 01:39:01 +01:00
Veikka Tuominen
629c3108aa AstGen: fix orelse type coercion in call arguments
Closes #14506
2023-02-02 00:31:35 +02:00
Josh Holland
1fba88450d langref: add paragraph and examples about indexing non-ASCII strings
PR #10610 addressed most of the points from #1854.  This
additional paragraph and examples covers the OMISSIONS section
clarifying issues about indexing into non-ASCII strings (whether valid
UTF-8 or not).  I think this finally closes #1854.
2023-02-01 21:46:46 +02:00
Evan Typanski
86ec26b1f0 translate-c: Fix types on assign expression bool 2023-02-01 21:45:53 +02:00
ominitay
3c8d968194 fmt: Make default_max_depth configurable 2023-02-01 21:43:36 +02:00
Veikka Tuominen
490addde27 Sema: fix error location on comptime arg to typed generic param
Closes #14505
2023-02-01 20:50:43 +02:00
Jakub Konka
beb20d29db link: remove union types which are now internal to backends 2023-02-01 19:32:54 +01:00
Luuk de Gram
46f54b23ae
link: make Wasm atoms fully owned by the linker 2023-02-01 19:10:56 +01:00
Jakub Konka
1aa0f8aa2f link: fix pointer invalidation issues in Elf, MachO and Coff 2023-02-01 17:46:57 +01:00
Jakub Konka
e0f3975fc8 link: make SpirV atoms fully owned by the linker 2023-02-01 16:01:43 +01:00
Jakub Konka
5de2aae63c link: decouple DI atoms from linker atoms, and manage them in Dwarf linker 2023-02-01 15:03:55 +01:00
Jakub Konka
d98fc53b8f link: use strtab.StringTable in Dwarf 2023-02-01 11:49:07 +01:00
Jakub Konka
b3277c8936 link: make Plan9 atoms fully owned by the linker 2023-02-01 11:12:53 +01:00
Jakub Konka
9fdc32c96e link: clean up type resolution in Elf.Atom and MachO.Atom 2023-02-01 09:13:49 +01:00
praschke
2ccff51154 mingw: repair msvcrt-os build flags
__LIBMSVCRT__ is still used and is distinct from __LIBMSVCRT_OS__
2023-01-31 23:25:02 -05:00
Andrew Kelley
efa25e7d5b
Merge pull request #14498 from ziglang/zig-build-api
Several enhancements to the build system. Many breaking changes to the API.

 * combine `std.build` and `std.build.Builder` into `std.Build`
 * eliminate `setTarget` and `setBuildMode`; use an options struct for `b.addExecutable` and friends
 * implement passing options to dependency packages. closes #14285
 * rename `LibExeObjStep` to `CompileStep`
 * move src.type.CType to std lib, use it from std.Build, this helps with populating config.h files.
2023-01-31 23:15:59 -05:00
Andrew Kelley
8d37c6f71c std.Build.CompileStep: fix API usage in unit test 2023-01-31 15:34:08 -07:00
Luuk de Gram
6f13a725a3
Merge pull request #14494 from Techatrix/wasm-optional-slice
wasm: correctly handle optional slices
2023-01-31 23:11:58 +01:00
Andrew Kelley
7d14baec90 tests: fix missing target for C ABI tests
This regressed earlier in this branch.
2023-01-31 15:09:35 -07:00
Andrew Kelley
3c1fc3f566 std.Build.ConfigHeaderStep: support more types 2023-01-31 15:09:35 -07:00
Andrew Kelley
2f5892671e move compiler's CType logic to std.Target
This API only depends on std.Target and is extremely useful in build
scripts when populating configure files.
2023-01-31 15:09:35 -07:00
Andrew Kelley
90e48d4b34 std.Build: avoid use of catch unreachable
Usage of `catch unreachable` in build scripts is completely harmless
because build scripts are always run in Debug mode, however, it sets a
poor example for beginners to learn from.
2023-01-31 15:09:35 -07:00
Andrew Kelley
13a9616540 std.Build: add deprecated declarations
These declarations are now aliases of their new APIs and marked as
deprecated via doc comments:
 * std.build.Builder
 * std.build
 * std.Build.LibExeObjStep
2023-01-31 15:09:35 -07:00
Andrew Kelley
16cdd1297e rename std.Build.LibExeObjStep to std.Build.CompileStep
This matches the nomenclature internally: a Compilation is the main type
that represents a single invokation of the compiler.
2023-01-31 15:09:35 -07:00
Andrew Kelley
77544683dd fix init-exe, init-lib templates 2023-01-31 15:09:35 -07:00