2339 Commits

Author SHA1 Message Date
Andrew Kelley
9627a75b07 clean up compiler_rt with some enum literals 2019-09-22 14:00:05 -04:00
Andrew Kelley
2510edeb71
fix linux stat struct on aarch64
The ABI was incorrect.
2019-09-22 11:22:22 -04:00
Andrew Kelley
ffef5d26b6
significantly increase test coverage
* add zig build option `-Dskip-libc` to skip tests that build libc
   (e.g. if you don't want to wait for musl to build)
 * add `-Denable-wine` option which uses wine to run cross compiled
   windows tests on non-windows hosts
 * add `-Denable-qemu` option which uses qemu to run cross compiled
   foreign architecture tests
 * add `-Denable-foreign-glibc=path` option which combined with
   `-Denable-qemu` enables running cross compiled tests that link
   against glibc. See
   https://github.com/ziglang/zig/wiki/Updating-libc#glibc for how to
   produce this directory.
 * the test matrix is done manually. release test builds are only
   enabled by default for the native target. this should save us some CI
   time, while still providing decent coverage of release builds.
   - add test coverage for `x86_64-linux-musl -lc` (building musl libc)
   - add test coverage for `x86_64-linux-gnu -lc` (building glibc)
   - add test coverage for `aarch64v8_5a-linux-none`
   - add test coverage for `aarch64v8_5a-linux-musl -lc` (building musl libc)
   - add test coverage for `aarch64v8_5a-linux-gnu -lc` (building glibc)
   - add test coverage for `arm-linux-none`
   - test coverage for `arm-linux-musleabihf -lc` (building musl libc) is
     disabled due to #3286
   - test coverage for `arm-linux-gnueabihf -lc` (building glibc) is disabled
     due to #3287
   - test coverage for `x86_64-windows-gnu -lc` (building mingw-w64) is
     disabled due to #3285
 * enable qemu testing on the Linux CI job. There's not really a good
   reason to enable wine, since we have a Windows CI job as well.
 * remove the no longer needed `--build-file ../build.zig` from CI
   scripts
 * fix bug in glibc compilation where it wasn't properly reading the abi
   list txt files, resulting in "key not found" error.
 * std.build.Target gains:
   - isNetBSD
   - isLinux
   - osRequiresLibC
   - getArchPtrBitWidth
   - getExternalExecutor
 * zig build system gains support for enabling wine and enabling qemu.
   `artifact.enable_wine = true;`, `artifact.enable_qemu = true;`. This
   communicates that the system has these tools installed and the build
   system will use them to run tests.
 * zig build system gains support for overriding the dynamic linker of
   an executable artifact.
 * fix std.c.lseek prototype. makes behavior tests for
   arm-linux-musleabihf pass.
 * disable std lib tests that are failing on ARM. See #3288, #3289
 * provide `std.os.off_t`.
 * disable some of the compiler_rt symbols for arm 32 bit. Fixes
   compiler_rt tests for arm 32 bit
 * add __stack_chk_guard when linking against glibc. Fixes std lib tests
   for aarch64-linux-gnu
 * workaround for "unable to inline function" using `@inlineCall`. Fixes
   compiler_rt tests for arm 32 bit.
2019-09-22 11:22:17 -04:00
LemonBoy
a11c20e26a Fix TLS for VariantI arches with a twist 2019-09-21 19:53:39 -04:00
Andrew Kelley
533aff3a6a
Merge pull request #3238 from Tetralux/fixed-allocator-reset
FixedBufferAllocator.reset
2019-09-21 12:48:45 -04:00
Tetralux
86b6790b6a
Remove 'inline', as per @andrewrk 2019-09-21 15:42:26 +00:00
Andrew Kelley
f663bcd6b2
add more RISCV64 linux bits to std lib 2019-09-20 15:24:50 -04:00
Andrew Kelley
aab1ec5c43
fix typo 2019-09-20 15:02:47 -04:00
daurnimator
2a8facafde
std: update for linux 5.3 2019-09-20 15:01:47 -04:00
daurnimator
edea0d431b
std: update riscv64 syscalls 2019-09-20 15:01:47 -04:00
Andrew Kelley
695695c852
update README
Also I verified that muldi3 has not changed since the previous ported
reference commit.
2019-09-20 12:58:00 -04:00
Andrew Kelley
8a30edcde8
Merge remote-tracking branch 'origin/master' into llvm9 2019-09-19 17:02:32 -04:00
stratact
925ffbce7f Disable Channel, Future, and Lock tests for FreeBSD (#3253)
* Disable Channel, Future, and Lock tests for FreeBSD
2019-09-19 13:45:54 -04:00
Andrew Kelley
ef3f7ecc19
update std.zig.tokenizer 2019-09-19 13:07:30 -04:00
Andrew Kelley
cd3068b4eb
Merge pull request #3017 from fengb/tokenize-cleaner-errors
Update stage2 parser errors to match compiler friendliness
2019-09-19 12:36:07 -04:00
Shawn Landden
c9937f4a2b Allow Zig programs to implement their own startup (_start) for ELF executables.
/home/shawn/git/zig-simd/build/lib/zig/std/special/start.zig:23:40: error: exported symbol collision: '_start'
        @export("_start", _start, .Strong);
        ^
/home/shawn/git/zig-simd/build/d.zig:1:1: note: other symbol is here
pub export fn _start() void {
^
/home/shawn/git/zig-simd/build/lib/zig/std/special/start.zig:124:35: error: root source file has no member called 'main'
    switch (@typeInfo(@typeOf(root.main).ReturnType)) {
2019-09-19 11:43:00 -04:00
Andrew Kelley
ef0f3ba905
relax std.auto_hash requirements regarding vectors
Previously, auto hash tests required vectors of different types to not
hash to the same value. Now, this is allowed.
2019-09-18 16:34:36 -04:00
Andrew Kelley
1cefe14424
update clone on arm32 to latest musl implementation
See musl commit 05870abeaac0588fb9115cfd11f96880a0af2108
by Rich Felker.

Commit message from musl reproduced here:

fix code path where child function returns in arm __clone built as thumb

mov lr,pc is not a valid way to save the return address in thumb mode
since it omits the thumb bit. use a chain of bl and bx to emulate blx.
this could be avoided by converting to a .S file with preprocessor
conditions to use blx if available, but the time cost here is
dominated by the syscall anyway.

while making this change, also remove the remnants of support for
pre-bx ISA levels. commit 9f290a49bf9ee247d540d3c83875288a7991699c
removed the hack from the parent code paths, but left the unnecessary
code in the child. keeping it would require rewriting two code paths
rather than one, and is useless for reasons described in that commit.
2019-09-16 14:23:43 -04:00
Jay Weisskopf
cddd6b46d8 Fix typos: "seperate" to "separate"
Fixes #3236
2019-09-15 23:39:36 -04:00
Tetralux
537b260349
Add FixedBufferAllocator.reset 2019-09-16 02:40:14 +00:00
Andrew Kelley
c4416b224d
Merge remote-tracking branch 'origin/master' into llvm9 2019-09-15 20:59:53 -04:00
Andrew Kelley
c15e464320
Merge branch 'uefi' of https://github.com/nrdmn/zig into nrdmn-uefi 2019-09-13 14:10:42 -04:00
stratact
742abc71c7 Add missing C dl_iterate_phdr function for FreeBSD 2019-09-13 15:10:35 -04:00
LemonBoy
774f770056 Correct AT_FDCWD definition 2019-09-12 13:15:50 -04:00
Andrew Kelley
cf4bccf765
improvements targeted at improving async functions
* Reuse bytes of async function frames when non-async functions
   make `noasync` calls. This prevents explosive stack growth.
 * Zig now passes a stack size argument to the linker when linking ELF
   binaries. Linux ignores this value, but it is available as a program
   header called GNU_STACK. I prototyped some code that memory maps
   extra space to the stack using this program header, but there was
   still a problem when accessing stack memory very far down. Stack
   probing is needed or not working or something. I also prototyped
   using `@newStackCall` to call main and that does work around the
   issue but it also brings its own issues. That code is commented out
   for now in std/special/start.zig. I'm on a plane with no Internet,
   but I plan to consult with the musl community for advice when I get a
   chance.
 * Added `noasync` to a bunch of function calls in std.debug. It's very
   messy but it's a workaround that makes stack traces functional with
   evented I/O enabled. Eventually these will be cleaned up as the root
   bugs are found and fixed. Programs built in blocking mode are
   unaffected.
 * Lowered the default stack size of std.io.InStream (for the async
   version) to 1 MiB instead of 4. Until we figure out how to get
   choosing a stack size working (see 2nd bullet point above), 4 MiB
   tends to cause segfaults due to stack size running out, or usage of
   stack memory too far apart, or something like that.
 * Default thread stack size is bumped from 8 MiB to 16 to match the
   size we give for the main thread. It's planned to eventually remove
   this hard coded value and have Zig able to determine this value
   during semantic analysis, with call graph analysis and function
   pointer annotations and extern function annotations.
2019-09-12 01:40:58 -04:00
Andrew Kelley
68b49f74c4
consolidate std.debug.parseDie and std.debug.parseDie1 2019-09-12 01:40:55 -04:00
LemonBoy
f36b8fd7b2 Recognize & skip the UTF-8 BOM 2019-09-11 15:20:18 -04:00
Andrew Kelley
67491a4222
disable runtime safety in std.io.InStream
Let's not be writing 0xaa in safe modes for upwards of 4 MiB for every
stream read. This is equivalent to the fact that we don't memset the
entire call stack to 0xaa for every function call.
2019-09-11 15:01:54 -04:00
Andrew Kelley
185cb13278
Merge remote-tracking branch 'origin/master' into llvm9 2019-09-10 13:00:35 -04:00
Andrew Kelley
0489d06c24
make the std lib support event-based I/O
also add -fstack-report
2019-09-10 10:26:52 -04:00
daurnimator
a29ce78651 std: add BloomFilter data structure 2019-09-10 10:20:30 -04:00
LemonBoy
fec795cd29 Adjust the stdlib to be 32bit compatible 2019-09-09 16:16:13 -04:00
LemonBoy
e4c3067617 Fix typo in TLS initialization code 2019-09-09 13:54:31 -04:00
Andrew Kelley
d1a98ccff4
implement spills when expressions used across suspend points
closes #3077
2019-09-07 00:13:12 -04:00
Andrew Kelley
0a3c6dbda9
implement noasync function calls
See #3157
2019-09-05 21:55:32 -04:00
LemonBoy
fabf45f5fc Add the noinline keyword for function declarations 2019-09-05 13:04:58 -04:00
Andrew Kelley
a7fd14096c
fix typo with tls initialization
I tested that hello world cross compiles to armv7 now.

closes #3167
2019-09-04 14:44:16 -04:00
Robin Voetter
df06976e73 Only check for TLS support on arm if TLS segment exists 2019-09-04 17:48:01 +02:00
Robin Voetter
77d04c03e3 Implement remaining requested changes
- Replace @intCast with a checked version (std/debug.zig)
- Replace @intCast with i64() when casting from a smaller type (std/fs/file.zig)
- Replace `nakedcc` with appropriate calling convention for linking with c (std/os/linux/arm-eabi.zig)
- Only check if hwcap contains TLS when the hwcap field actually exists (std/os/linux/tls.zig)
2019-09-04 16:23:25 +02:00
Robin Voetter
6a76298740 Add missing clobbers on arm-eabi and arm64 syscall conventions 2019-09-04 15:59:51 +02:00
Robin Voetter
5308eb7045 Merge remote-tracking branch 'upstream/master' into arm-support-improvement 2019-09-04 15:55:54 +02:00
Andrew Kelley
8a7e2e3479
Merge branch 'comment-in-array' of https://github.com/Vexu/zig into Vexu-comment-in-array 2019-09-03 21:49:35 -04:00
Andrew Kelley
a4ce10df80
Merge pull request #3169 from Sahnvour/string_hash_map
Using StringHashMap everywhere it's needed
2019-09-03 20:30:26 -04:00
Sahnvour
9d6f236728 add fastpath for std.mem.eql and simplify std.hash_map.eqlString
this should also be friendlier to the optimizer
2019-09-03 23:56:04 +02:00
Sahnvour
f08c6e4fe6 changing occurrences of HashMap with []const u8 as keys for StringHashMap 2019-09-03 23:53:05 +02:00
Andrew Kelley
fc0f8d0359
zig build: make install prefix available to build.zig and
prevent accident of '/' showing up in application/library names
2019-09-03 16:19:10 -04:00
Vesa Kaihlavirta
e9530ce97b Fix addition direction, remove superfluous loop counter, add tests 2019-09-03 13:45:02 -04:00
Andrew Kelley
058050f22c
Merge remote-tracking branch 'origin/master' into llvm9 2019-09-02 20:56:31 -04:00
Nick Erdmann
5e874a89b9
std/os/uefi: fix ordering of packed bit fields 2019-09-02 22:31:59 +02:00
Nick Erdmann
8db41b7adb
std/os/uefi: add support for getting memory map 2019-09-02 22:10:50 +02:00