14304 Commits

Author SHA1 Message Date
Jakub Konka
cf26f8c19b zld: handle __eh_frame section 2021-06-15 12:14:04 +02:00
Jakub Konka
15ff0db794 zld: handle __gcc_except_tab section 2021-06-15 12:14:03 +02:00
Jakub Konka
96d3c4f54f zld: clean up parsing section by type and attrs 2021-06-15 12:14:03 +02:00
Andrew Kelley
6fad1d48e4 ci: azure: update to newer msys2 release 2021-06-15 12:14:03 +02:00
Andrew Kelley
d6f2772583 zig build: rename --lib-dir, --include-dir, --exe-dir
To --prefix-lib-dir, --prefix-include-dir, --prefix-exe-dir,
respectively.
2021-06-15 12:14:03 +02:00
Andrew Kelley
c434a9a573 CLI: rename --override-lib-dir to --zig-lib-dir
This breaking change disambiguates between overriding the lib dir when
performing an installation with the Zig Build System, and overriding the
lib dir that the Zig installation itself uses.
2021-06-15 12:14:03 +02:00
Jan200101
5df5937bd2 specify the output lib, exe and include paths with flags 2021-06-15 12:14:03 +02:00
xackus
e3fa18242b translate-c: remove old code i forgot in last pr 2021-06-15 12:14:03 +02:00
Veikka Tuominen
eb7cfe9de6 add a test for dup and dup2 2021-06-15 12:14:03 +02:00
Samadi van Koten
71e99c8690 Add std.os.dup() 2021-06-15 12:14:03 +02:00
Isaac Freund
7611b80f43 std: fix auto hash of tagged union with void field 2021-06-15 12:14:03 +02:00
Takeshi Yoneda
0063f642d1 fix comments.
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2021-06-15 11:50:13 +09:00
Takeshi Yoneda
dc7d354ee4 Add a missing comment.
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2021-06-15 09:32:48 +09:00
Takeshi Yoneda
1795472eb7 cleanup, and disable threading completely.
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2021-06-15 09:28:19 +09:00
Takeshi Yoneda
bc64664a0c add various flags/options, and link libcxxabi.
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2021-06-15 01:03:25 +09:00
Takeshi Yoneda
c708962386 link/wasm: link libcxx.
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2021-06-14 23:39:39 +09:00
Takeshi Yoneda
827fa4d837 c++,wasi: enable libcxx build.
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2021-06-14 17:48:01 +09:00
Andrew Kelley
86ebd4b975
Merge pull request #9106 from Vexu/fmt
Add formatting check to CI pipeline
2021-06-13 20:39:40 -04:00
Veikka Tuominen
e63ff4f1c1 add ast-check flag to zig fmt, fix found bugs 2021-06-14 00:16:40 +03:00
Jacob G-W
df4f11f42f link/Elf: don't use \n in log.debug calls
It already inserts a \n so it produces 2 \n which
is harder to read.
2021-06-13 23:42:57 +03:00
jacob gw
b9f07b7ac2 format zig files and add formatting check to ci 2021-06-13 22:33:39 +03:00
LemonBoy
ff79b87fa0 tools: Unbreak many tools
Many tools were broken after the recent hash-table refactorings, fix
them and ensure they won't silently break again.
2021-06-13 15:25:18 -04:00
Veikka Tuominen
37f36da391
Merge pull request #9092 from xackus/translate-c-type-parsing
translate-c: improve type parsing
2021-06-13 19:51:22 +03:00
Veikka Tuominen
f58fbb1004
Merge pull request #9074 from mattbork/parse-always-scratch
parse.zig: simplify parsing functions that build lists by always using scratch buffer
2021-06-13 19:49:41 +03:00
Veikka Tuominen
029fe6c9ab meta.cast: handle casts from negative ints to ptrs 2021-06-13 16:53:01 +03:00
xackus
e5750f8c7f translate-c: better numeric type parsing 2021-06-13 16:47:55 +03:00
xackus
aa83cbb697 translate-c: better typename parsing 2021-06-13 16:47:42 +03:00
Matthew Borkowski
483933d88d parse.zig: make parseForTypeExpr accept only a TypeExpr as body 2021-06-13 16:37:53 +03:00
Matthew Borkowski
3692fb039d parse.zig: simplify parseSwitchProng and make one item cases with trailing commas produce .switch_case_one nodes 2021-06-13 16:37:53 +03:00
Matthew Borkowski
51beb71480 parse.zig: simplify parsing functions that build lists by always using scratch buffer 2021-06-13 16:37:53 +03:00
joachimschmidt557
46b9e061e0 stage2 Sema: enable float multiplication and division 2021-06-13 15:24:28 +03:00
Veikka Tuominen
6664679c8c translate-c: don't bother with unwrapping pointers
Dereferencing a c pointer implicitly includes an unwrap,
manually adding it just causes bugs.
2021-06-13 15:23:31 +03:00
Jarred Sumner
540b52931a Improve error message when std.fmt.format is missing arguments
Use fmt in fmt so the number in the error message is fmt'd
2021-06-13 10:33:49 +03:00
viri
b2879825d7 std.windows: fix OVERLAPPED, add OVERLAPPED_ENTRY 2021-06-13 10:26:02 +03:00
Garrett Squire
a6d72fea06 Make std.ChildProcess exit code u8 to match std.process.exit
This patch adjusts the exit code for a child process to be a u8. Since
the WEXITSTATUS macro returns the lower eight bits, it's safe to assume
that we can truncate the returned u32.
2021-06-12 23:13:14 +03:00
Evan Haas
ea4a25287e translate-c: better support for static local variables
Don't move static local variables into the top-level scope since this
can cause name clashes if subsequently-defined variables or parameters
in different scopes share the name.

Instead, use a variable within a struct so that the variable's lexical
scope does not change. This solution was suggested by @LemonBoy

Note that a similar name-shadowing problem exists with `extern` variables
declared within block scope, but a different solution will be needed since
they do need to be moved to the top-level scope and we can't rename them.
2021-06-12 23:12:37 +03:00
LemonBoy
44cdafd9d4 std: Fix complex ldexp implementation
Two bugs in the implementation ported from musl made all the complex
functions relying on ldexp return incorrect results in some cases.

Spotted in #9047
2021-06-12 19:56:08 +03:00
Veikka Tuominen
0d022eb1d6 zig fmt: rewrite byteOffsetOf to offsetOf 2021-06-12 19:16:01 +03:00
Exonorid
f63338195d Renamed @byteOffsetOf to @offsetOf 2021-06-12 19:16:01 +03:00
protty
2ba68f9f4c
std.Thread.Futex addition (#9070)
* std.Thread.Futex: implementation + tests

* std.Thread.Futex: fix darwin compile errors

* std.Thread.Futex: fix wait() documentation typo

* std.Thread.Futex: fix darwin version check

* std.Thread.Futex: remove unnecessary comptime keyword
2021-06-12 08:51:37 -05:00
Veikka Tuominen
2b2efa24d0 std.build: don't default to static linkage 2021-06-12 14:23:07 +03:00
Jakub Konka
05b5e49bc0
Merge pull request #9086 from ziglang/fix-9050
zig ld: act as linker for golang
2021-06-12 11:39:23 +02:00
xackus
b5c117d051 translate-c: fix enums that require c_uint type 2021-06-12 11:55:39 +03:00
LemonBoy
986a71234b std: Move PDB-related code into its own file
No functional changes are expected, this patch is only moving some code
in order to slim the huge bowl of spaghetti that is debug.zig.

The amount of memory leaked on error is much less than before but not
zero, some further work is required to smooth the edges of this old part
of the stdlib.
2021-06-12 10:51:43 +03:00
Andrew Kelley
caad5c4960 zig cc: recognize more pie flags
This is a bug fix.
2021-06-11 15:57:52 -07:00
Jakub Konka
6aa9c63f63 zld: throw an error if found unknown section in object
We will silently ignore expected section that are either won't take
part in linking such as any `__DWARF` section, or are known but are
not yet implemented such as `__TEXT,__eh_frame`. For any other
we will throw an error and exit.

Also, inform the caller that we currently are unable to handle
frameworks.
2021-06-12 00:03:47 +02:00
Jakub Konka
ac587744e3 zld: allow for existence of __DATA_CONST segments in objects
Up until now, we only expected old-fashioned objects which carried
two basic segments by name: __TEXT and __DATA. Since macOS 11.1,
there is a new segment __DATA_CONST, and we should expect and
correctly parse sections designated to that segment explicitly
as is the case in golang.
2021-06-11 23:06:43 +02:00
Andrew Kelley
f7361970b3
Merge pull request #8060 from DrDeano/feature/add-mcpu-to-target-options
Add CPU feature check to standardTargetOptions
2021-06-11 17:03:46 -04:00
Andrew Kelley
da4081fe21 cleanups to previous commit
* fix a merge conflict discovered upon rebasing latest master
 * rename Target.Cpu.Feature.Set.subSet to isSuperSetOf
 * convert a comment into an assert
2021-06-11 14:01:13 -07:00
Edward Dean
7ba175cd8b Add CPU feature check to standardTargetOptions
If there is a mismatch of CPU features provided
compared to the whitelist, then will fail the build and
print what the expected CPU model is and the feature
set for the model. Also prints what features need to be
removed.
2021-06-11 13:32:28 -07:00