Commit Graph

222 Commits

Author SHA1 Message Date
Andrew Kelley
ce76de35f1
multi-arch glibc headers 2019-03-07 12:16:10 -05:00
Andrew Kelley
b554f6294f
add popcountdi2 to compiler_rt 2019-03-05 23:09:00 -05:00
sjdh02
74c123cd0a fix check for 64-bit arm platforms with new targets 2019-03-03 10:04:08 -05:00
Andrew Kelley
e402455704
rename std lib files to new convention 2019-03-02 16:46:04 -05:00
Andrew Kelley
f7835000b6
@returnAddress and @frameAddress return usize now 2019-03-02 15:34:58 -05:00
Andrew Kelley
67b4de33d2
compile error for import outside package path
closes #2024

there's a new cli option `--main-pkg-path` which you can use to choose
a different root package directory besides the one inferred from the
root source file

and a corresponding build.zig API:
foo.setMainPkgPath(path)
2019-03-02 10:38:27 -05:00
Andrew Kelley
ade10387a5
breaking changes to the way targets work in zig
* CLI: `-target [name]` instead of `--target-*` args.
   This matches clang's API.
 * `builtin.Environ` renamed to `builtin.Abi`
   - likewise `builtin.environ` renamed to `builtin.abi`
 * stop hiding the concept of sub-arch. closes #1526
 * `zig targets` only shows available targets. closes #438
 * include all targets in readme, even those that don't
   print with `zig targets` but note they are Tier 4
 * refactor target.cpp and make the naming conventions
   more consistent
 * introduce the concept of a "default C ABI" for a given
   OS/Arch combo. As a rule of thumb, if the system compiler
   is clang or gcc then the default C ABI is the gnu ABI.
2019-02-26 15:58:10 -05:00
Andrew Kelley
98869edb8b
fix zig fmt arg0 handled incorrectly 2019-02-23 20:25:33 -05:00
Andrew Kelley
00d8f4a1bb
introduce std.debug.captureStackTrace
and fix the implementation of writeStackTrace
it was printing the first frame in the wrong place
2019-02-23 13:19:06 -05:00
Andrew Kelley
a97362e677
fmt_runner: remove redundant check 2019-02-16 12:24:02 -05:00
Andrew Kelley
ba56f365c8
bring zig fmt to stage1 2019-02-16 00:53:32 -05:00
Marc Tiehuis
170ec504ec Use official llvm mirror for compiler-rt commit ref 2019-02-15 17:37:55 +13:00
Marc Tiehuis
be861a85c8 compiler-rt: Add __addtf3, __subtf3 and __truncdfhf2
Allows addition/subtraction of f128 and narrowing casts to f16 from
larger float types.
2019-02-13 23:24:52 +13:00
Andrew Kelley
c2db077574
std.debug.assert: remove special case for test builds
Previously, std.debug.assert would `@panic` in test builds,
if the assertion failed. Now, it's always `unreachable`.

This makes release mode test builds more accurately test
the actual code that will be run.

However this requires tests to call `std.testing.expect`
rather than `std.debug.assert` to make sure output is correct.

Here is the explanation of when to use either one, copied from
the assert doc comments:

Inside a test block, it is best to use the `std.testing` module
rather than assert, because assert may not detect a test failure
in ReleaseFast and ReleaseSafe mode. Outside of a test block, assert
is the correct function to use.

closes #1304
2019-02-08 18:23:38 -05:00
Andrew Kelley
89ffb58197 implement Thread Local Storage on Windows 2019-02-06 18:32:41 -05:00
Andrew Kelley
d2602b442e
require running std lib tests coherently
this should actually improve CI times a bit too

See the description at the top of std/os/startup.zig (deleted in this
commit) for a more detailed understanding of what this commit does.
2019-02-06 14:32:20 -05:00
Andrew Kelley
b1775ca168
thread local storage working for linux x86_64 2019-02-06 13:48:04 -05:00
Andrew Kelley
d8b6fa9134
Merge pull request #1859 from mgxm/fbsd2
Progress towards tier 1 support for FreeBSD x86_64
2018-12-29 12:49:23 -05:00
Andrew Kelley
a918ce26b8
fixups 2018-12-26 15:25:54 -05:00
nebulaeonline
fdea12b2d9 msvc subsystem option handling; added uefi os type 2018-12-23 22:44:02 -05:00
Marcio Giaxa
1fc56b82ad freebsd: link against libc
Since the stable kernel ABI is through libc #1759
2018-12-19 18:42:00 -02:00
Wink Saville
634d11ab28 Add add compiler_rt routines for float to signed integer conversion
And add std.math.f128_* constants.

The routines are:

  __fixdfdi, __fixdfsi, __fixdfti,
  __fixsfdi, __fixsfsi, __fixsfti,
  __fixtfdi, __fixtfsi, __fixtfti.

These all call fixint which is a generic zig function that does the
conversion:

  pub fn fixint(comptime fp_t: type, comptime fixint_t: type, a: fp_t) fixint_t

There are also a set tests:

  __fixdfdi_test, __fixdfsi_test, __fixdfti_test,
  __fixsfdi_test, __fixsfsi_test, __fixsfti_test,
  __fixtfdi_test, __fixtfsi_test, __fixtfti_test.
2018-12-12 00:21:42 -05:00
Andrew Kelley
4dafdc00d5
zig fmt 2018-11-19 17:28:18 -05:00
Andrew Kelley
9493738e54
Merge branch 'freebsd-up' of https://github.com/myfreeweb/zig into freebsd2 2018-11-19 17:24:41 -05:00
Andrew Kelley
89e82281be
fix incorrect --help text 2018-11-19 13:26:35 -05:00
Andrew Kelley
085d049a08
aarch64 improvements
* support C ABI for all return types
 * don't include __aeabi_uldivmod & co on aarch64 since
   it's 64 bit
2018-11-17 11:21:00 -05:00
Jimmi Holst Christensen
8139c5a516
New Zig formal grammar (#1685)
Reverted #1628 and changed the grammar+parser of the language to not allow certain expr where types are expected
2018-11-13 05:08:37 -08:00
Andrew Kelley
2b395d4ede
remove @minValue,@maxValue; add std.math.minInt,maxInt
closes #1466
closes #1476
2018-10-26 15:01:51 -04:00
Greg V
f3bc1c38bf Specify 16-byte stack alignment in _start on FreeBSD 2018-10-20 15:21:35 +03:00
Marc Tiehuis
19659c3bd3 freebsd: Fix argc resolution in _start
FreeBSD appears to use rdi instead of rsp as in other posix systems.
According to some loose documentation, x86 passes values on the stack,
so amd64 freebsd may be the only exception.
2018-10-20 15:15:01 +03:00
Jimmi Holst Christensen
378d3e4403
Solve the return type ambiguity (#1628)
Changed container and initializer syntax
* <container> { ... } -> <container> . { ... }
* <exrp> { ... } -> <expr> . { ...}
2018-10-15 09:51:15 -04:00
Andrew Kelley
3e72411db0
C ABI and compiler rt improvements for ARM
* add __multi3 compiler rt function. See #1290
* compiler rt includes ARM functions for thumb and aarch64 and
  other sub-arches left out. See #1526
* support C ABI for returning structs on ARM. see #1481
2018-10-13 15:18:00 -04:00
Andrew Kelley
84690ee05e
std/special/bootstrap: inline some functions to improve stack traces 2018-10-09 13:16:50 -04:00
Andrew Kelley
5a3c02137e
support building static libraries
closes #1493
closes #54
2018-10-09 13:15:14 -04:00
Andrew Kelley
d40c4e7c89
Merge pull request #1429 from shawnl/arm64
initial arm64 support
2018-10-06 00:11:39 -04:00
Andrew Kelley
9d4eaf1e07
update std lib API for I/O
std.io.FileInStream -> std.os.File.InStream
std.io.FileInStream.init(file) -> file.inStream()
std.io.FileOutStream -> std.os.File.OutStream
std.io.FileOutStream.init(file) -> file.outStream()

remove a lot of error code possibilities from os functions

std.event.net.socketRead -> std.event.net.read
std.event.net.socketWrite -> std.event.net.write
add std.event.net.readv
add std.event.net.writev
add std.event.net.readvPosix
add std.event.net.writevPosix
add std.event.net.OutStream
add std.event.net.InStream

add std.event.io.InStream
add std.event.io.OutStream
2018-09-30 17:28:35 -04:00
Andrew Kelley
4c6f1e614a
remove zig build --init. add zig init-lib and zig init-exe
init-lib creates a working static library with tests, and
init-exe creates a working hello world with a `run` target.

both now have test coverage with the new "cli tests" file.

closes #1035
2018-09-17 17:11:18 -04:00
Shawn Landden
17cb69cebc fix elf auxv handling
Auxillery vectors are not guaranteed to be in any order, this
just happens to work on x86_64.
2018-09-08 14:47:21 +00:00
Shawn Landden
cba0d76fbc clone() on arm64 2018-09-08 03:52:28 +00:00
Shawn Landden
342cff28f5 initial arm64 support 2018-09-08 03:52:28 +00:00
Andrew Kelley
832caefc2a fix regressions 2018-09-02 18:35:32 -04:00
Andrew Kelley
c4b9466da7
Merge pull request #1294 from ziglang/async-fs
introduce std.event.fs for async file system functions
2018-08-10 15:51:17 -04:00
Andrea Orru
d2f5e57b68 Merge branch 'master' into zen_stdlib 2018-08-06 01:43:19 -04:00
Andrew Kelley
5dfcd09e49 self-hosted: watch files and trigger a rebuild 2018-08-03 17:22:17 -04:00
Andrew Kelley
4d9964a457 rename error.skip to error.SkipZigTest
also print stats at the end of test runner
2018-07-21 23:43:43 -04:00
kristopher tate
df574ccf86 std.special.test_runner.zig: make tests skippable;
tracking issue #1274;

tests can be skipped by returnning `error.skip` :
2018-07-22 02:20:03 +09:00
Andrew Kelley
3f4d0ecd7e Merge remote-tracking branch 'origin/master' into m-n-threading 2018-07-09 17:14:42 -04:00
Andrew Kelley
a0c564d762 zig fmt 2018-07-09 01:23:47 -04:00
Andrew Kelley
ced3aae3b2 cleaner output from zig build when there are compile errors 2018-07-07 20:31:50 -04:00
Marc Tiehuis
1eda86e1ad Clean up outstanding compiler_rt todos 2018-07-03 13:22:12 +12:00