Commit Graph

11809 Commits

Author SHA1 Message Date
LemonBoy
5844511408 std: prevent instantiation of atomic.Int with non-integral types 2020-12-10 09:23:48 +01:00
LemonBoy
ef7db9717e std: introduce meta.traits.is{Integral,Float} 2020-12-10 09:23:48 +01:00
Jakub Konka
23c1b7faee
Merge pull request #7368 from kubkon/macho-trie-cleanup
stage2: MachO export trie cleanup
2020-12-10 08:32:59 +01:00
Michael Dusan
8951f72fa3
Merge pull request #7375 from mikdusan/qemu
ci linux: bump qemu-5.2.0
2020-12-10 00:05:14 -05:00
Andrew Kelley
cb896a6573 CLI: infer --name based on first C source file or object
Previously, --name would only be inferred if there was exactly 1 C
source file or exactly 1 object. Now it will be inferred if there is at
least one of either.
2020-12-09 21:20:13 -07:00
Timon Kruiper
4c51adeb0d Do not keep the build.zig cache manifest file locked.
This allows to have multiple instances of `zig build` at the same
time. For example when you have a long running `zig build run` and
then want to run `zig build somethingelse`.
2020-12-09 22:16:04 -05:00
Michael Dusan
ae0af5e5a6
ci linux: bump qemu-5.2.0 2020-12-09 21:31:31 -05:00
Andrew Kelley
7c93d9aacb mingw-w64: patch to silence implicit-function-declaration warnings
Closes #7356

I did this as a patch to the source rather than passing flags so that
it would intentionally be reverted when we update to the next release of
mingw-w64. At this time if any warnings are still emitted we should find
out why and make sure upstream is aware of the problem.
2020-12-09 16:12:03 -07:00
Andrew Kelley
6e636064e6 MoveFileEx can return ACCESS_DENIED
I observed this on Windows 10, trying to use MoveFileEx with
MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH
to overwrite a running executable.
2020-12-09 15:03:17 -07:00
Jakub Konka
44e2f210bb lld+macho: clean up error message when padding insufficient 2020-12-09 20:36:58 +01:00
Jakub Konka
184c0f3c4e stage2+macho: write code signature only when targeting aarch64 2020-12-09 20:36:58 +01:00
Jakub Konka
601600dec9 macho: parsing Trie now takes a reader and returns bytes read 2020-12-09 20:36:58 +01:00
Jakub Konka
a283404053 macho: split writing Trie into finalize and const write 2020-12-09 20:36:58 +01:00
Jakub Konka
a579f8ae8d macho: add generic terminal info nullable struct to a node 2020-12-09 20:36:58 +01:00
Jakub Konka
4c3e6c5bff macho: cleanup export trie generation and parsing
Now, ExportTrie is becoming usable for larger linking contexts such
as linking in multiple object files, or relinking dylibs, etc.
2020-12-09 20:36:58 +01:00
Andrew Kelley
ae3fd86dcc
Merge pull request #7367 from kubkon/aarch64-stp-ldp
stage2: add aarch64 load/store pair of registers instructions
2020-12-09 14:31:08 -05:00
Andrew Kelley
f291194834
Merge pull request #7362 from Vexu/std
zig fmt improvement and small miscellaneous fixes
2020-12-09 14:29:15 -05:00
Martin Wickham
676e416c86 Fix operator precedence documentation 2020-12-09 14:26:29 -05:00
Andrew Kelley
5ff0f364a5
Merge pull request #7366 from LemonBoy/fix-7346
Some compiler-rt fixes
2020-12-09 14:19:58 -05:00
LemonBoy
3f0a4ffbf4 langref: Update setEvalBranchQuota prototype 2020-12-09 20:15:58 +01:00
Jakub Konka
2082c27557 stage2+aarch64: clean up offset helper structs 2020-12-09 17:21:21 +01:00
Jakub Konka
e91dbab256 stage2+aarch64: fix stage2 tests 2020-12-09 17:21:17 +01:00
Jakub Konka
eca0727417 stage2+aarch64: use stp and ldp to navigate MachO jump table 2020-12-09 17:20:58 +01:00
Jakub Konka
21dae538ca stage2+aarch64: add load and store pair of registers instructions 2020-12-09 17:20:14 +01:00
LemonBoy
2f4f7ace7a stage1: Resolve some constants to u32, not usize
The latter may be smaller than a u32, use a u32 explicitly.
2020-12-09 17:01:18 +01:00
LemonBoy
6f220bb7ca std: explicitly cast indices to usize
This is needed for platforms where usize=u16, eg. MSP430.
2020-12-09 16:48:41 +01:00
LemonBoy
afd491c07e compiler-rt: Fix compilation of clzsi for armv6 targets 2020-12-09 16:48:02 +01:00
LemonBoy
518168edb2 compiler-rt: Avoid exposing atomic builtins when not supported
Let's a void any kind of compilation/LLVM errors for niche targets such
as AVR/MSP430 or ARM v6m. By not exporting any atomic builtin anymore
the user is free to provide their own implementation (that disable the
IRQs) or to provide the --single-threaded switch and forget about this.
2020-12-09 16:33:53 +01:00
Vexu
7e30e83900
small fixes and zig fmt 2020-12-09 13:54:26 +02:00
Vexu
be71994fb1
zig fmt: improve var decl initializer formatting 2020-12-09 13:47:22 +02:00
Lee Cannon
3599fb9bfc Fixes #7352 - ignore zig fmt ignore zig-cache 2020-12-09 12:11:52 +02:00
Andrew Kelley
391d81a380
Merge pull request #7355 from ziglang/lld-child-process
invoke LLD as a child process rather than a library
2020-12-09 02:26:13 -05:00
Andrew Kelley
7dd4afb224 stage2: link: properly implement passthrough mode for LLD child proc
passthrough mode does not mean always exit - it just means to pass
through stdio and exit if the child process exits, without doing any
special error reporting.
2020-12-08 22:37:01 -07:00
Andrew Kelley
4592fd26b9 add std.testing.expectStringEndsWith 2020-12-08 21:59:24 -07:00
Andrew Kelley
72f6c6e634 invoke LLD as a child process rather than a library
Closes #3825
2020-12-08 20:00:16 -07:00
xackus
21550bb7cd std.json: unreachable -> expect in tests 2020-12-08 19:16:17 -05:00
LemonBoy
8ac711596d stage1: Validate the specified cc for lazy fn types
Closes #7337
2020-12-08 19:09:25 -05:00
antlilja
8f646daed6 Change tag returned by zigTagType for c_longdouble to Float.
Function was returning Int before.
2020-12-09 01:18:27 +02:00
Andrew Kelley
2759313263 add support for environment variables to control cache directories
This commit adds:

ZIG_LOCAL_CACHE_DIR corresponding to --cache-dir
ZIG_GLOBAL_CACHE_DIR corresponding to --global-cache-dir
ZIG_LIB_DIR corresponding to --override-lib-dir

The main use case is for `zig cc` where we are bound by clang's CLI
options and need alternate channels to pass these configuration options.
2020-12-08 14:39:17 -07:00
antlilja
c796c4528e Add option to override default stack size in build system. 2020-12-08 16:18:16 -05:00
Nathanaël Courant
81890e30e2 Fix general purpose allocator incorrectly modifying total_requested_bytes in some cases 2020-12-08 15:53:34 -05:00
Andrew Kelley
58c8ad8ea8 tests: run-translated-c now respects -Dtarget 2020-12-08 13:46:05 -07:00
Andrew Kelley
24cbf1c706 always use codeview (pdb) when object_format is PE/COFF
Previously, when mixing Zig and C/C++ code for windows-gnu targets, zig
would get codeview format but the C/C++ code would not get any debug
info. Now, C/C++ code properly emits debug info in codeview format and
everything just works.
2020-12-08 13:31:39 -07:00
Andrew Kelley
a482b82e2d stage2: only patch up LLD binaries on aarch64-macos
The code is a bit fragile so it was causing CI failures on x86_64-macos.
Also the patch up code is only needed for aarch64-macos, so we were
doing unnecessary work.
2020-12-08 12:47:48 -07:00
Andrew Kelley
97c0e1cc41 glibc: additionally provide -lcrypt
also remove redundant "util" string matching.
2020-12-08 13:17:57 -05:00
Nathan Michaels
1847d0cfc2
Implement msp430 mapping for c_longdouble. (#7333) 2020-12-08 13:09:00 -05:00
Andrew Kelley
a01d55e801
Merge pull request #7309 from ziglang/build-stage1-with-only-zig
ability to build stage1 using only a zig tarball
2020-12-07 23:54:34 -05:00
Andrew Kelley
1afea36a16 update readme installation instructions
The readme now links to the wiki for instructions on building from
source. I plan to make many updates to the wiki soon as I start to
provide tarballs for working on the compiler.
2020-12-07 17:50:14 -07:00
Andrew Kelley
88dc688bbf restore the option to build with cmake
restore cmake to be capable of figuring out the zig version

restore config.h and config.zig. config.h is used to detect whether we
should propagate cmake configuration information to build.zig; however
it can be overridden with -Dstatic-llvm.

fix not passing -DZIG_LINK_MODE with zig build.

when using the cmake build path, build.zig no longer tries to call
llvm-config. Instead it relies 100% on the LLVM_LIBRARIES cmake variable.

build.zig logic reworked and simplified.
2020-12-07 17:27:09 -07:00
Andrew Kelley
211ac00f83 build: -lversion -luuid on windows and -DNDEBUG=1 for clang sources 2020-12-07 17:27:09 -07:00