26 Commits

Author SHA1 Message Date
Jimmi Holst Christensen
a0a2ce92ca std: Do not allocate the result for ChildProcess.init
Instead, just return ChildProcess directly. This structure does not
require a stable address, so we can put it on the stack just fine. If
someone wants it on the heap they should do.

  const proc = try allocator.create(ChildProcess);
  proc.* = ChildProcess.init(args, allocator);
2022-04-29 22:50:34 -04:00
Cody Tapscott
5065830aa0 Avoid depending on child process execution when not supported by host OS
In accordance with the requesting issue (#10750):
- `zig test` skips any tests that it cannot spawn, returning success
- `zig run` and `zig build` exit with failure, reporting the command the cannot be run
- `zig clang`, `zig ar`, etc. already punt directly to the appropriate clang/lld main(), even before this change
- Native `libc` Detection is not supported

Additionally, `exec()` and related Builder functions error at run-time, reporting the command that cannot be run
2022-02-06 22:21:46 -07:00
Meghan
c08b190c69
lint: duplicate import (#10519) 2022-01-07 00:06:06 -05:00
Lee Cannon
1093b09a98
allocgate: renamed getAllocator function to allocator 2021-11-30 23:32:47 +00:00
Lee Cannon
75548b50ff
allocgate: stage 1 and 2 building 2021-11-30 23:32:47 +00:00
Lee Cannon
85de022c56
allocgate: std Allocator interface refactor 2021-11-30 23:32:47 +00:00
Andrew Kelley
08c768ad82 pre-merge cleanups
* Annotate workarounds with their corresponding GitHub issue links.
 * Enable test coverage for LTO on Windows with the added c_compiler test.
2021-11-15 16:32:15 -07:00
xavier
564629f704 build: workaround link error with LTO and mingw
The symbol "_tls_index" gets lost when using LTO.
Disabling LTO on the object file that defines it allows the link to work.

fixes https://github.com/ziglang/zig/issues/8531
2021-11-15 16:15:39 -07:00
J.C. Moyer
33889e1974 mingw-w64: add missing file frexp.c to mingwex.lib
Fixes a frexp() segfault on Windows.
2021-11-15 17:28:49 -05:00
Ryan Liptak
59f5053bed Update all ensureCapacity calls to the relevant non-deprecated version 2021-09-19 13:52:56 +02:00
Michal Ziulek
e06052f201
Added implementation for _fseeki64 and _ftelli64 from mingw-w64 9.0.0 (#9402). (#9766)
* Added fseeki64.c from mingw-w64 9.0.0. This file was missing in Zig distribution. This file contains implementation for _fseeki64 and _ftelli64 functions.
2021-09-15 13:38:00 -04:00
Jonathan Marler
375619820e changes to build zig-bootstrap aarch64-windows 2021-09-07 14:27:50 -06:00
Jonathan Marler
fd2c1d8605
Fix building aarch64-windows-gnu by adding missing libc files and compiler_rt functions (#9555)
* fix issue 9519

Added some missing files from mingw

* add missing compiler_rt functions

* finish PR

* add aarch64-windows-gnu to test targets

* add more compiler_rt

* add log2

* add pow

* add modti3
2021-09-07 19:44:21 +03:00
Jonathan Marler
f28868e8fd mingw.zig: fix logic to add crt sources
The current version of code uses isARM to check if we are compiling to any arm target then checks the target bit width to either add the 32-bit sources or 64-bit source.  However, isARM only returns true for 32-bit targets, and isAARCH64 is for the 64-bit targets.

I also replaced the unreachable with a @panic when we receive an unsupported arch because this code is reachable and should turn into an error.
2021-08-21 20:40:07 +03:00
Jacob G-W
641ecc260f std, src, doc, test: remove unused variables 2021-06-21 17:03:03 -07:00
Andrew Kelley
3647784d05 stage2: add missing frexpl.c to mingw c source file list 2021-01-22 23:35:13 -07:00
Timon Kruiper
b1cfa923be stage2: rename and move files related to LLVM backend 2021-01-06 10:52:20 +01:00
LemonBoy
1c13ca5a05 stage2: Use {s} instead of {} when formatting strings 2021-01-02 17:12:57 -07:00
Timon Kruiper
4a0d64300b stage2: rename llvm.zig to llvm_bindings.zig
Putting functions in this file will create functions like
`llvm.function`, and the compiler thinks these are llvm intrinsics.
2020-12-28 21:15:13 +01:00
Andrew Kelley
6ab9268a90 stage2: re-use compiler runtime libs across opt modes and strip flag
Previously Zig would need to recompile runtime libs if you changed the
values of --strip or -O. Now, unless the `debug_compiler_runtime_libs`
flag is set (which is currently not exposed to the CLI), Zig will always
choose ReleaseFast or ReleaseSmall for compiler runtime libraries.

When the main application chooses ReleaseFast or ReleaseSmall, that
value is propagated to compiler runtime libraries. Otherwise a decision
is made based on the target, which is currently ReleaseSmall for
freestanding WebAssembly and ReleaseFast for everything else.

Ultimately the purpose of this commit is to have Debug and ReleaseSafe
builds of applications still get optimized builds of, e.g. libcxx and
libunwind, as well as to spend less time unnecessarily rebuilding compiler
runtime libraries.
2020-12-24 14:11:58 -07:00
Alexandros Naskos
3e1639c53b
Fixed mingw-w64 8.0.0 compilation
Reaplied mingw-w64 header patch
2020-11-05 20:04:25 +02:00
Alexandros Naskos
708962d51e
Updated mingw-w64 to version 8.0.0 2020-11-05 18:59:36 +02:00
LemonBoy
212171643c stage2: Add missing defines for building dllcrt2.o
Closes #6482
2020-10-01 11:39:22 +02:00
Andrew Kelley
af6c3a3934 mingw: better -D arg for processing def.in files
Thanks @LemonBoy
2020-09-29 00:24:54 -07:00
Andrew Kelley
ada19c498d stage2: building DLL import lib files 2020-09-28 19:20:58 -07:00
Andrew Kelley
91a73a177b stage2: building mingw-w64 and COFF LDD linking
still TODO is the task of creating import .lib files for DLLs on the fly
both for -lfoo and for e.g. `extern "kernel32"`
2020-09-28 00:06:06 -07:00