Commit Graph

16 Commits

Author SHA1 Message Date
Jonathan Marler a282ac7a91 Support Reader for InStream 2020-06-09 13:36:17 -04:00
Vexu 0e30edd8d0 std: handle ConnectionTimedOut in switch
regression from #5266
closes #5270
2020-05-06 12:52:26 +03:00
Andrew Kelley 3657a54618 fix regressions in elf parsing code 2020-03-11 17:34:12 -04:00
Andrew Kelley 431d76c023 add std.io.StreamSource and fixes to emitRaw 2020-03-11 15:40:34 -04:00
Andrew Kelley c71991c869 fix compilation errors for emitRaw 2020-03-11 14:34:13 -04:00
Andrew Kelley ed13cffca4 rework some old ELF parsing code and start to fix emitRaw 2020-03-10 22:01:58 -04:00
Andrew Kelley ba0e3be5cf (breaking) rework stream abstractions
The main goal here is to make the function pointers comptime, so that we
don't have to do the crazy stuff with async function frames.

Since InStream, OutStream, and SeekableStream are already generic
across error sets, it's not really worse to make them generic across the
vtable as well.

See #764 for the open issue acknowledging that using generics for these
abstractions is a design flaw.

See #130 for the efforts to make these abstractions non-generic.

This commit also changes the OutStream API so that `write` returns
number of bytes written, and `writeAll` is the one that loops until the
whole buffer is written.
2020-03-10 15:32:32 -04:00
xackus 00be934569 short std.builtin enum literals in std lib 2020-03-01 13:57:41 -05:00
Andrew Kelley 3683ba87ac complete the native target detection based on /usr/bin/env 2020-02-28 14:51:56 -05:00
Andrew Kelley 4616af0ca4 introduce operating system version ranges as part of the target
* re-introduce `std.build.Target` which is distinct from `std.Target`.
   `std.build.Target` wraps `std.Target` so that it can be annotated as
   "the native target" or an explicitly specified target.
 * `std.Target.Os` is moved to `std.Target.Os.Tag`. The former is now a
   struct which has the tag as well as version range information.
 * `std.elf` gains some more ELF header constants.
 * `std.Target.parse` gains the ability to parse operating system
   version ranges as well as glibc version.
 * Added `std.Target.isGnuLibC()`.
 * self-hosted dynamic linker detection and glibc version detection.
   This also adds the improved logic using `/usr/bin/env` rather than
   invoking the system C compiler to find the dynamic linker when zig
   is statically linked. Related: #2084
   Note: this `/usr/bin/env` code is work-in-progress.
 * `-target-glibc` CLI option is removed in favor of the new `-target`
   syntax. Example: `-target x86_64-linux-gnu.2.27`

closes #1907
2020-02-28 14:51:53 -05:00
Michaël Larouche 9b11e5e1f1 Add InstallRawStep to Zig build system that does a similar job to llvm-objcopy. To use it, do 'exe.installRaw("kernel.bin");' where exe is a LibExeObjStep
Part of #2826
2020-02-03 15:07:34 -05:00
Andrew Kelley bf3ac66150 remove type coercion from array values to references
* Implements #3768. This is a sweeping breaking change that requires
   many (trivial) edits to Zig source code. Array values no longer
   coerced to slices; however one may use `&` to obtain a reference to
   an array value, which may then be coerced to a slice.

 * Adds `IrInstruction::dump`, for debugging purposes. It's useful to
   call to inspect the instruction when debugging Zig IR.

 * Fixes bugs with result location semantics. See the new behavior test
   cases, and compile error test cases.

 * Fixes bugs with `@typeInfo` not properly resolving const values.

 * Behavior tests are passing but std lib tests are not yet. There
   is more work to do before merging this branch.
2019-11-27 03:37:50 -05:00
Andrew Kelley 7de138ad7c std.elf: breaking improvements to the API
and also integration with std.Target.Arch
2019-11-26 14:25:35 -05:00
Andrew Kelley e0db54e89d update the codebase to use @as 2019-11-08 15:57:24 -05:00
LemonBoy ba711f1115 Add ELF architecture constant for RISC-V 2019-10-13 12:12:33 +02:00
Andrew Kelley ed36dbbd9c mv std/ lib/
that's all this commit does. further commits will fix cli flags and
such.

see #2221
2019-09-25 23:35:41 -04:00