| Age | Commit message (Collapse) | Author |
|
|
|
|
|
This reverts commit a7de02e05216db9a04e438703ddf1b6b12f3fbef.
This did not implement the accepted proposal, and I did not sign off
on the changes. I would like a chance to review this, please.
|
|
* implement `@expect`
* add docs
* add a second arg for expected bool
* fix typo
* move `expect` to use BinOp
* update to newer langref format
|
|
Closes #20009
|
|
|
|
this one is even harder to document then the last large overhaul.
TLDR;
- split apart Emit.zig into an Emit.zig and a Lower.zig
- created seperate files for the encoding, and now adding a new instruction
is as simple as just adding it to a couple of switch statements and providing the encoding.
- relocs are handled in a more sane maner, and we have a clear defining boundary between
lea_symbol and load_symbol now.
- a lot of different abstractions for things like the stack, memory, registers, and others.
- we're using x86_64's FrameIndex now, which simplifies a lot of the tougher design process.
- a lot more that I don't have the energy to document. at this point, just read the commit itself :p
|
|
this provides a much better indication of when we are having a controlled panic with an error message
or when we are actually segfaulting, as before the `trap` as causing a segfault.
|
|
- add the `abs` MIR instruction
- implement `@abs` by shifting to the right by `bits - 1`, and xoring.
|
|
* rename .xros to .visionos as agreed in the tracking issue
* add support for VisionOS platform in the MachO linker
|
|
* some manual fixes to generated CPU features code. In the future it
would be nice to make the script do those automatically.
* add to various target OS switches. Some of the values I was unsure of
and added TODO panics, for example in the case of spirv CPU arch.
|
|
|
|
Closes #14904
|
|
|
|
part of #19063
This is a prerequisite for doing the same for Resinator.
|
|
Fixes a regression introduced in
c22d1c00a8825f60e7b01b97c6f73cbc21ca8257.
See #17769
|
|
* fix typos and redundancies in docs
* use Target.isGnuLibc
|
|
At a minimum required glibc is v2.17, as earlier versions do not define
some symbols (e.g., getauxval()) used by the Zig standard library.
Additionally, glibc only supports some architectures at more recent
versions (e.g., riscv64 support came in glibc v2.27). So add a
`glibc_min` field to `available_libcs` for architectures with stronger
version requirements.
Extend the existing `canBuildLibC` function to check the target against
the Zig minimum, and the architecture/os minimum.
Also filter the list shown by `zig targets`, too:
$ zig targets | jq -c '.glibc'
["2.17.0","2.18.0","2.19.0","2.20.0","2.21.0","2.22.0","2.23.0","2.24.0","2.25.0","2.26.0","2.27.0","2.28.0","2.29.0","2.30.0","2.31.0","2.32.0","2.33.0","2.34.0","2.35.0","2.36.0","2.37.0","2.38.0"]
Fixes #17034
Fixes #17769
|
|
|
|
This is necessary because on COFF, the entry symbol name is not known
until the linker has looked at the set of global symbol names to
determine which of the four possible main entry points is present.
|
|
rather than checking multiple conditions in Sema
|
|
|
|
Commit 97e23896a9168132b6d36ca22ae1af10dd53d80d regressed this behavior
because it made target_util.supportsStackProtector *correctly*
notice which zig backend is being used to generate code, while the
logic calling that function *incorrectly assumed* that .zig code is being
compiled, when in reality it might be only C code being compiled.
This commit adjusts the option resolution logic for stack protector so
that it takes into account the zig backend only if there is a zig
compilation unit. A separate piece of logic checks whether clang
supports stack protector for a given target.
closes #18009
closes #18114
closes #18254
|
|
These options are only supposed to be provided to the initialization
functions, resolved, and then computed values stored in the appropriate
place (base struct or the object-format-specific structs).
Many more to go...
|
|
Much of the logic from Compilation.create() is extracted into
Compilation.Config.resolve() which accepts many optional settings and
produces concrete settings. This separate step is needed by API users of
Compilation so that they can pass the resolved global settings to the
Module creation function, which itself needs to resolve per-Module
settings.
Since the target and other things are no longer global settings, I did
not want them stored in link.File (in the `options` field). That options
field was already a kludge; those options should be resolved into
concrete settings. This commit also starts to work on that, deleting
link.Options, moving the fields into Compilation and
ObjectFormat-specific structs instead. Some fields were ephemeral and
should not have been stored at all, such as symbol_size_hint.
The link.File object of Compilation is now a `?*link.File` and `null`
when -fno-emit-bin is passed. It is now arena-allocated along with
Compilation itself, avoiding some messy cleanup code that was there
before.
On the command line, it is now possible to configure the standard
library itself by using `--mod std` just like any other module. This
meant that the CLI needed to create the standard library module rather
than having Compilation create it.
There are a lot of changes in this commit and it's still not done. I
didn't realize how quickly this changeset was going to balloon out of
control, and there are still many lines that need to be changed before
it even compiles successfully.
* introduce std.Build.Cache.HashHelper.oneShot
* add error_tracing to std.Build.Module
* extract build.zig file generation into src/Builtin.zig
* each CSourceFile and RcSourceFile now has a Module owner, which
determines some of the C compiler flags.
|
|
|
|
|
|
closes #7265
|
|
The logic in 509be7cf1f10c5d329d2b0524f2af6bfcabd52de assumed that
`use_llvm` meant that the LLVM backend would be used, however, use_llvm
is false when there are no zig files to compile, which is the case for
zig cc. This logic resulted in `-fsingle-threaded` which made libc++
fail to compile for C++ code that includes the threading abstractions
(such as LLVM).
|
|
- Adds `illumos` to the `Target.Os.Tag` enum. A new function,
`isSolarish` has been added that returns true if the tag is either
Solaris or Illumos. This matches the naming convention found in Rust's
`libc` crate[1].
- Add the tag wherever `.solaris` is being checked against.
- Check for the C pre-processor macro `__illumos__` in CMake to set the
proper target tuple. Illumos distros patch their compilers to have
this in the "built-in" set (verified with `echo | cc -dM -E -`).
Alternatively you could check the output of `uname -o`.
Right now, both Solaris and Illumos import from `c/solaris.zig`. In the
future it may be worth putting the shared ABI bits in a base file, and
mixing that in with specific `c/solaris.zig`/`c/illumos.zig` files.
[1]: https://github.com/rust-lang/libc/tree/6e02a329a2a27f6887ea86952f389ca11e06448c/src/unix/solarish
|
|
- dropped incorrect names
- added list of names found in the SDKs
- ios, tvos and watchos filesystems are case-sensitive
|
|
- update include dirs to use combined dir
- use one libSystem.tbd (drop use of libSystem.VERSION.tbd)
- update canBuildLibC to check for minimum os version only
|
|
Structs were previously using `SegmentedList` to be given indexes, but
were not actually backed by the InternPool arrays.
After this, the only remaining uses of `SegmentedList` in the compiler
are `Module.Decl` and `Module.Namespace`. Once those last two are
migrated to become backed by InternPool arrays as well, we can introduce
state serialization via writing these arrays to disk all at once.
Unfortunately there are a lot of source code locations that touch the
struct type API, so this commit is still work-in-progress. Once I get it
compiling and passing the test suite, I can provide some interesting
data points such as how it affected the InternPool memory size and
performance comparison against master branch.
I also couldn't resist migrating over a bunch of alignment API over to
use the log2 Alignment type rather than a mismash of u32 and u64 byte
units with 0 meaning something implicitly different and special at every
location. Turns out you can do all the math you need directly on the
log2 representation of alignments.
|
|
std.builtin.Mode is deprecated.
|
|
|
|
|
|
Renamed dwarf_unwinding -> stack_iterator to better reflect that it's not just DWARF unwinding.
Added a test for unwinding with a frame pointer.
|
|
dwarf: documentation fixups
target: enable unwind tables on macho
|
|
When targeting WebAssembly, we default to building a single-threaded build
as threads are still experimental. The user however can enable a multi-
threaded build by specifying '-fno-single-threaded'. It's a compile-error
to enable this flag, but not also enable shared-memory.
|
|
When the user enabled the linker-feature 'shared-memory' we do not force
a singlethreaded build. The linker already verifies all other CPU features
required for threads are enabled. This is true for both WASI and
freestanding.
|
|
|
|
|
|
Instead of doing everything at once which is a hopelessly large task,
this introduces a piecemeal transition that can be done in small
increments at a time.
This is a minimal changeset that keeps the compiler compiling. It only
uses the InternPool for a small set of types.
Behavior tests are not passing.
Air.Inst.Ref and Zir.Inst.Ref are separated into different enums but
compile-time verified to have the same fields in the same order.
The large set of changes is mainly to deal with the fact that most Type
and Value methods now require a Module to be passed in, so that the
InternPool object can be accessed.
|
|
* Disable 128-bit atomics for x86_64 generic (currently also baseline)
because they require heavy abi agreement to correctly lower.
** This is a breaking change **
* Enable 128-bit atomics for aarch64 in Sema since it just works.
|
|
|
|
Support for the built-in libcrypt was removed in commit 6b7ddfba,
but the -lcrypt flag remained ignored, preventing linking against
external libcrypt.
Fixes #5990.
Signed-off-by: Piotr Sikora <piotr@aviatrix.com>
|
|
SPIR-V cannot build libc, ssp, compiler-rt, etc at the time of this commit, so
prevent trying to build them.
|
|
|
|
- Use .flash as the default address space for functions on AVR
- Return .flash as the address space for function pointers on AVR
without explicit address space
|
|
|