Commit Graph

4945 Commits (f8b7ea119f89c0625fd27c3ec1db338b79af58bd)

Author SHA1 Message Date
Andrew Kelley f8b7ea119f
Merge pull request #2461 from LemonBoy/dwarf-leb128
Fix minor bug in LEB128 parsing
2019-05-09 20:14:20 -04:00
Andrew Kelley 09cff0d2bd
fix translate-c regression
introduced in eb65410b62
2019-05-09 20:11:56 -04:00
LemonBoy 8cc4eaea9f Use matching types when parsing fields 2019-05-10 00:44:24 +02:00
LemonBoy 4d8f96dd88 Fix minor bug in LEB128 parsing 2019-05-10 00:41:05 +02:00
Andrew Kelley eea2de108d
translate-c: progress on self-hosted function prototypes
See #1964
2019-05-09 16:52:30 -04:00
Andrew Kelley 214625587c
translate-c: use C API for builtin types
See #1964
2019-05-09 15:46:48 -04:00
Andrew Kelley 010963ce43
stage1: make some asserts print source location 2019-05-09 14:52:06 -04:00
Andrew Kelley c459edac18
compile error for attempt to cast enum literal to error
closes #2203
2019-05-09 13:18:13 -04:00
Andrew Kelley 72899da44b
fix std.os.copyFile
closes #2454
2019-05-09 13:05:06 -04:00
Andrew Kelley eb65410b62
translate-c: enough C tokenization/parsing to handle shifting in macros
See #2451
2019-05-09 12:48:38 -04:00
Andrew Kelley 62065a9aea
translate-c: handle int to ptr and ptr to int casting
See #2451
2019-05-09 12:17:23 -04:00
Andrew Kelley a7346ea49f fix build on macOS
Sadly due to a workaround for LLD linker limitations on macOS
we cannot put libuserland into an .a file; instead we have to use object
files. Again due to linker limitations, bundling compiler_rt.o into
another relocatable object also doesn't work. So we're left with
disabling stack probing on macOS for the stage1 self-hosted code.

These workarounds could all be removed if the macos support in the LLD
linker improved, or if Zig project had its own linker that did not have
these issues.
2019-05-08 22:45:49 -04:00
Andrew Kelley 4b9e12be50
Merge pull request #2452 from LemonBoy/more-more-builtins
More more builtins
2019-05-08 22:24:12 -04:00
Andrew Kelley 46e1c34fcf
self-hosted translate-c progress on function decls
See #1964
2019-05-08 22:05:59 -04:00
Andrew Kelley 9bbd71c9ab
add --bundle-compiler-rt function to link options
and use it when building libuserland.a

The self-hosted part of stage1 relies on zig's compiler-rt, and so we
include it in libuserland.a.

This should potentially be the default, but for now it's behind a linker
option.

self-hosted translate-c: small progress on translating functions.
2019-05-08 20:51:49 -04:00
Andrew Kelley 3bd5c16f39
stage1: remove unneeded extern function 2019-05-08 19:33:57 -04:00
Andrew Kelley e3542196c0
translate-c: NULL pointers translate to `null`
See #1967
2019-05-08 19:21:54 -04:00
Andrew Kelley 9c12237d2d
std.debug: fix stack trace iteration code
Previously, the stack trace iteration code was using the number of
frames collected as the number of frames to print, not recognizing the
fixed size of the buffer. So it would redundantly print items, matching
the total number of frames ever collected.

Now the iteration code is limited to the actual stack trace frame count,
and will not print duplicate frames.

Closes #2447
Closes #2151
2019-05-08 19:11:01 -04:00
Andrew Kelley a4aee8b24d
C pointers support if and orelse
See #1967
2019-05-08 18:47:14 -04:00
LemonBoy 4208fa9ad9 compiler-rt: add __floatsitf 2019-05-09 00:25:50 +02:00
LemonBoy 383b8a032e compiler-rt: Add __aeabi_unwind_cpp_pr{0,1,2} 2019-05-09 00:07:46 +02:00
LemonBoy 2dce137d92 compiler-rt: Add __extendsfdf2
Add AEABI builtin __aeabi_f2d
2019-05-09 00:07:46 +02:00
LemonBoy 2be066d057 compiler-rt: Add __floatdidf
Add AEABI builtin __aeabi_l2d
2019-05-08 23:57:09 +02:00
LemonBoy d4434dfb67 compiler-rt: Add __floatundidf & __floatunsidf
Add AEABI builtins __aeabi_ul2d, __aeabi_ui2d
2019-05-08 23:57:09 +02:00
LemonBoy 92fd2df054 compiler-rt: Add __truncdfsf2
Add AEABI builtin __aeabi_d2f
2019-05-08 23:57:09 +02:00
Andrew Kelley 0099583bd3
C pointers support .? operator
see #1967
2019-05-08 17:39:00 -04:00
LemonBoy c00167e91a compiler-rt: More division intrinsics 2019-05-08 22:30:20 +02:00
LemonBoy 917103710e compiler-rt: Add __floatsidf & __floatsisf
Also add their AEABI aliases, __aeabi_i2f & __aeabi_i2d
2019-05-08 22:26:54 +02:00
Andrew Kelley 50bbb34594
C pointers support `null`
See #1967
2019-05-08 16:06:34 -04:00
LemonBoy be7cacfbbe Implement stack probes for x86/x86_64
Enabled on non-Windows systems only since it already requires stack
probes.
2019-05-08 12:36:54 -04:00
Marc Tiehuis 24ee765318
Merge pull request #2448 from markfirmware/patch-1
Update README.md
2019-05-08 23:32:49 +12:00
markfirmware b083ef18e3
Update README.md 2019-05-08 05:11:21 -04:00
Andrew Kelley 9c0596e627
Merge pull request #2427 from LemonBoy/linux-tls
Proper support for TLS on linux
2019-05-07 12:26:26 -04:00
Andrew Kelley 097a62555e
Merge pull request #2439 from LemonBoy/fixes-fixes-fixes
A batch of miscellaneous fixes
2019-05-07 12:26:02 -04:00
LemonBoy 043bd71621 Add ARCH_SET_* definitions for x86_64 2019-05-07 13:19:38 +02:00
LemonBoy b1db696c10 Less error messages
Decrease the overall size of the binary, programming errors are caught
with unreachable.
2019-05-07 13:09:20 +02:00
LemonBoy 2f041239cb Always initialize the TLS 2019-05-07 13:09:20 +02:00
LemonBoy cfcf02489d std: Implement on-demand TLS allocation 2019-05-07 13:09:19 +02:00
LemonBoy d8ab301aa8 std: Implement TLS support for Linux
Tested on x86_64, i386, ARM, AARCH64
2019-05-07 13:09:18 +02:00
LemonBoy 4ab7b459df Avoid endless recursion in __extendhfsf2
On some platforms the conversion ended up creating a dangerous recursive
loop that ate all the stack.

The conversion to f16 is also pointless since we're operating on the raw
bits anyway.
2019-05-07 11:47:23 +02:00
LemonBoy 94b504c9e4 Fix float comparison result in __aeabi_{f,d}cmp* 2019-05-07 11:47:23 +02:00
LemonBoy a3beda27fc Add missing cast to usize 2019-05-07 11:47:23 +02:00
Andrew Kelley 7432fb04d6
Merge pull request #2354 from LemonBoy/iterate_phdr_impl
dl_iterate_phdr implementation
2019-05-06 15:48:37 -04:00
LemonBoy 939ec878a0 Fix edge case in addXf3
The operands may be zero, use the wrapping operators and avoid a
spurious integer-overflow error.
2019-05-06 21:41:08 +02:00
LemonBoy 60242e96df Fix definition of epoll_* struct on non x86_64 arches 2019-05-06 21:39:02 +02:00
LemonBoy a095db0df7 Add a test case 2019-05-06 18:30:49 +02:00
Andrew Kelley 7a41af2632
Merge pull request #2422 from tgschultz/stdlib-packed-int-array
Added PackedIntArray, PackedIntSlice to std
2019-05-05 15:25:17 -04:00
LemonBoy 07dfccf967 Review 2019-05-05 13:00:20 +02:00
Andrew Kelley 5d347c01cf
Merge pull request #2374 from LemonBoy/fileszoff-reform
Make io offsets/sizes u64 instead of usize
2019-05-04 15:20:42 -04:00
Andrew Kelley 6a34da963b
Merge branch 'LemonBoy-stdlib-32b' 2019-05-04 15:19:14 -04:00