13406 Commits

Author SHA1 Message Date
Andrew Kelley
41efdc73b9 langref: add docs for @extern 2021-04-22 16:24:14 -07:00
LemonBoy
6cd71931cb stage1: Unbreak build on FreeBSD
It turns out that the endianness-detection header delivered with the
softfloat library is extremely brittle and gives wrong results when
targeting FreeBSD (long story short, _BIG_ENDIAN is always defined there
and that breaks the #if defined() chain).

Use our own endianness detection header to work around any potential
problem.
2021-04-21 22:07:55 +02:00
Jakub Konka
c8753aceef macho: fix typos in consts defs 2021-04-21 06:49:34 +02:00
Michael Dusan
0c6dfa6f0c target: drop ppc32 and prefer ppc
- original PR #7949 (incorrectly) patched a generated-file and changes
  have subsequently been lost/overwritten
- fix #7947 in a different way: drop `ppc32` because `ppc` already exists
2021-04-20 16:19:59 -04:00
Frank Denis
10f2d62789
std/crypto: use finer-grained error sets in function signatures (#8558)
std/crypto: use finer-grained error sets in function signatures

Returning the `crypto.Error` error set for all crypto operations
was very convenient to ensure that errors were used consistently,
and to avoid having multiple error names for the same thing.

The flipside is that callers were forced to always handle all
possible errors, even those that could never be returned by a
function.

This PR makes all functions return union sets of the actual errors
they can return.

The error sets themselves are all limited to a single error.

Larger sets are useful for platform-specific APIs, but we don't have
any of these in `std/crypto`, and I couldn't find any meaningful way
to build larger sets.
2021-04-20 19:57:27 +02:00
Andrew Kelley
1e06a74348
Merge pull request #8542 from LemonBoy/floating-point-is-hard-my-dude
Floating point is hard my dude
2021-04-20 13:28:03 -04:00
Veikka Tuominen
2ca26ffde7
Merge pull request #8582 from LemonBoy/more-libc-impl
Improve the libc implementation
2021-04-20 19:54:16 +03:00
Jakub Konka
d64c76e8f1 zld: fix parsing of weak symbols 2021-04-20 16:55:32 +02:00
Jakub Konka
7bc6554a58 zld: map __DATA,__common as __DATA_CONST,__common 2021-04-20 16:55:32 +02:00
Jakub Konka
e5b83056ae zld: resolve symbols as globals before resolving locals 2021-04-20 16:55:32 +02:00
Jakub Konka
8943a0aaaa zld: dedup initializers and finalizers 2021-04-20 16:55:32 +02:00
Jakub Konka
3e73a3c29b zld: treat priv extern as weak symbol 2021-04-20 16:55:32 +02:00
LemonBoy
a5a3ad5e10 c: Minor cleanup
* Remove superfluous "test_" prefix in test names
* Use aliased isNan everywhere
2021-04-20 15:44:54 +02:00
LemonBoy
a4e2539b09 c: Implement fmax and fmaxf 2021-04-20 15:44:21 +02:00
LemonBoy
fcfe25710b c: Implement fmin and fminf 2021-04-20 15:43:46 +02:00
LemonBoy
c7c77fb1b0 c: Add tests for generic_fmod implementation 2021-04-20 15:43:01 +02:00
LemonBoy
be551d85b7 translate-c: Group field access LHS if necessary 2021-04-20 15:16:25 +03:00
Evan Haas
63304a871e translate-c: group LHS of array access if necessary 2021-04-20 11:33:01 +03:00
Evan Haas
55e6bd10fe translate-c: use transCreateNodeInfixOp for pointer arithmetic 2021-04-20 11:33:01 +03:00
Isaac Freund
e2cc02717e Fix .gitattributes rules that should be recursive
These are currently incorrect according to the gitattributes(5) and
gitignore(5) man pages. However, it seems github ended up treating them
as we intended due to a bug until recently when that bug was fixed.
2021-04-19 16:55:12 -04:00
Hubert Jasudowicz
d605f02756 std: Add process_vm_readv/writev wrappers 2021-04-19 16:12:28 +02:00
joachimschmidt557
fbda9991f4 stage2 codegen: Fix silent bug in reuseOperand 2021-04-17 20:57:26 -04:00
Isaac Freund
4081e0a475 zig fmt: bypass auto indentation for // zig fmt: on
Currently an indented `// zig fmt: on` will be indented an additional
time on every run of zig fmt.
2021-04-17 20:10:20 -04:00
Isaac Freund
8e6865c8ee std/build: fix linker_allow_shlib_undefined
The relevant flags were renamed in 01a1365 but updating std.build
was overlooked.
2021-04-17 15:17:54 +02:00
Frank Denis
9f6b56ab4b
Merge pull request #8555 from chivay/pidfd
std: Add pidfd wrappers
2021-04-17 15:03:25 +02:00
jacob gw
afb9f695b1 stage2: add support for zig cc assembler -mcpu option 2021-04-17 02:00:07 -04:00
Hubert Jasudowicz
5134fb72ef std: Add pidfd wrappers 2021-04-17 01:13:16 +02:00
Isaac Freund
01a1365857 Rename --(no-)allow-shilb-undefined to -f(no-)allow-shilb-undefined
This breaks with GNU ld but is consistent with our naming convention for
all the rest of the flags.
2021-04-17 00:03:35 +02:00
daurnimator
99e7ba24b1 Add LibExeObjStep.linker_allow_shlib_undefined field to set --allow-shlib-undefined 2021-04-16 22:51:51 +02:00
daurnimator
0e687d125b Add --(no-)allow-shlib-undefined to supported zig linking flags 2021-04-16 22:51:51 +02:00
Andrew Kelley
140d9df99b
Merge pull request #8506 from LemonBoy/test-c-file
build: Test the c.zig file too
2021-04-16 13:03:52 -04:00
joachimschmidt557
5edabb3990 stage2 register manager: Add functions for allocating multiple registers 2021-04-16 13:03:10 -04:00
Manuel Floruß
2cd49d20e8 Fix std.os.windows.user32.messageBoxW
Arguments to `selectSymbol` were passed in the wrong order.
2021-04-16 13:01:25 -04:00
Andrew Kelley
235aa8c078 ci: drone: don't skip stage2 tests
the stalls seem to be happening for a different reason
2021-04-16 09:57:31 -07:00
Mahdi Khanalizadeh
d1a41feddc linux: fix number of arguments for tgkill syscall 2021-04-16 17:09:15 +02:00
Evan Haas
d4d21dd46d translate-c: better handling of int -> enum casts
In std.meta.cast when casting to an enum type from an integer type, first
do a C-style cast from the source value to the tag type of the enum.
This ensures that we don't get an error due to the source value not being
representable by the enum.

In transCCast() use std.meta.cast instead of directly emitting the cast
operation since the enum's underlying type may not be known at translation
time due to an MSVC bug, see https://github.com/ziglang/zig/issues/8003

Fixes #6011
2021-04-15 22:46:22 -04:00
Andrew Kelley
ccdf55310b stage2: properly model miscellaneous failed tasks
with error messages that go away after updates
2021-04-15 19:01:55 -07:00
Andrew Kelley
2b2920f599 ci: drone: disable stage2 tests
See #8545
2021-04-15 16:20:43 -07:00
LemonBoy
bd4421befe compiler-rt: Don't pass f16 around as arguments
Fixes some failures on AArch64.
f16 was a mistake.
2021-04-15 21:52:08 +02:00
Andrew Kelley
c795e82cbc ci: windows: update to llvm 12 msvc tarball 2021-04-15 12:40:22 -07:00
Andrew Kelley
c49fe52cb1 ci: update macos tarball to llvm 12 2021-04-15 11:27:02 -07:00
Andrew Kelley
68e69aae2b build.zig: omit LLVMTableGen from llvm libs 2021-04-15 10:58:53 -07:00
Andrew Kelley
2a6ec2e155 build.zig: update llvm libs 2021-04-15 10:43:39 -07:00
LemonBoy
5bc1dc59e6 compiler-rt: Implement __trunctfhf2 2021-04-15 18:23:09 +02:00
LemonBoy
b29677dd12 compiler-rt: Implement __extendhftf2 2021-04-15 18:21:58 +02:00
LemonBoy
7a4dad7e87 stage1: More precise serialization of f16 values
Taking a detour trough a f64 is dangerous as the softfloat library
doesn't like converting sNaN values.

The error went unnoticed as an exception is raised by the library but
the stage1 compiler doesn't give a damn.
2021-04-15 18:17:31 +02:00
LemonBoy
2d00f17d15 test: Add test to ensure signed zeros are properly computed
Ensure everything's ok at comptime and runtime.
2021-04-15 18:17:21 +02:00
LemonBoy
8e0b2f0e52 compiler-rt: Fix typo in implementation of fp truncation ops
The problem went unnoticed for years, yay.
2021-04-15 18:14:25 +02:00
LemonBoy
f9481402f0 stage1: Fix negation for zero floating point values
Toggling the sign by computing 0-x doesn't really work for zero values.
2021-04-15 18:12:11 +02:00
Andrew Kelley
a38042e3ac ci: windows: proper flags to zig build 2021-04-15 02:02:36 -07:00