Commit Graph

3088 Commits (70c8cabb34606b61e2d7fcf3c0217e6bd0c3cefa)

Author SHA1 Message Date
LemonBoy 3e22077d46 Fix the ELF base calculation
Find the effective ELF load address in dl_iterate_phdr by computing the
difference between the in-memory phdr and its p_vaddr specified in the
ELF file.

This makes the dl_iterate_phdr test pass and restores the stack traces.
2020-11-23 15:06:07 +01:00
LemonBoy 0a84f85945 Minor code cleanup in start_pie.zig
Thanks @daurnimator for catching this.
2020-11-23 12:36:40 +01:00
LemonBoy 560043dadf Fix logic for detecting _DYNAMIC symbol
Prevent spurious crashes for non-PIE executables.
2020-11-23 12:00:12 +01:00
Andrew Kelley c7170e4a54 Support PIE (Position Independent Executables)
Closes #4503
Revives #3960
Merges branch 'pie' into master
2020-11-22 17:30:34 -07:00
Andrew Kelley abc717f203 modernize the PIE patch for the latest master branch
This is the part of #3960 that has to be rewritten to apply to latest
master branch code.
2020-11-22 17:28:11 -07:00
Andrew Kelley 55ab50efbd Merge branch 'piepiepie' of https://github.com/LemonBoy/zig into pie
Conflicts:
 lib/std/dynamic_library.zig (fixed in this commit)
 src/all_types.hpp
 src/codegen.cpp
 src/link.cpp
 src/main.cpp

Will manually apply the diffs to these deleted files to the new zig
code in a followup commit.
2020-11-22 12:39:44 -07:00
Vexu 98d5bfbd4d
update grammar in langref 2020-11-22 21:30:09 +02:00
Žiga Željko 2fbe9519ac std: add support for ppoll 2020-11-21 14:06:04 -08:00
LemonBoy a2e9554699 std: Add test for meta.declarations on opaque{} 2020-11-21 14:03:49 -08:00
Andrew Kelley 7dcda5b0e8
Merge pull request #7182 from LemonBoy/externnnn
Initial implementation of @extern builtin
2020-11-21 09:41:49 -08:00
Andrew Kelley bf0cc32aa6
Merge pull request #7165 from LemonBoy/ppc64final
Make the PPC64 port usable
2020-11-20 17:40:17 -08:00
Isaac Freund 8cf319d206 std/os: define and use dev_t for linux x86_64 2020-11-20 17:35:52 -08:00
Sébastien Marie 87eb498d89 openbsd: malloc_usable_size is unavailable on OpenBSD 2020-11-20 17:31:29 -08:00
Isaac Freund f473b3e87c std/os: add time_t definiton for x86_64 linux 2020-11-20 17:23:43 -08:00
LemonBoy 9b7d9c72b0 stage1: Initial implementation of @extern 2020-11-20 22:32:43 +01:00
LemonBoy 9c5eea9f40 stage2: Use correct ppc generic feature set 2020-11-20 08:38:10 +01:00
LemonBoy e374ae3598 std: Use newfstatat on PPC64
One more variation in the syscall table, hooray!
2020-11-20 08:38:10 +01:00
LemonBoy 4e2a4e194b std: Use correct clone() stub
The previous clone() definition was written for 32bit PPC targets,
trying to execute it on a PPC64 machine lead to countless crashes.

Use the clone() definition kindly lifted from Musl libc.
2020-11-20 08:38:10 +01:00
Jakub Konka c25cb39d17
Merge pull request #7160 from semarie/openbsd-getdents
openbsd: getdents could return invalid entry with d_fileno==0
2020-11-20 00:23:57 +01:00
Isaac Freund a5691ee363 std.meta.declarations: support opaque {} 2020-11-19 15:04:38 -08:00
Andrew Kelley 473cb1fd74
Merge pull request #6390 from LemonBoy/reboot-3970
std.fmt meets UTF-8
2020-11-19 14:58:11 -08:00
LemonBoy d526b0ffb0 std: Disable _only_ the flaky part of the ResetEvent test
The remaining part is working just fine as it's not time-dependent.
2020-11-19 15:46:20 -07:00
Andrew Kelley 647c6e0d09 tfw you can't even disable a test without getting the logic wrong 2020-11-19 13:28:54 -07:00
LemonBoy 60638f0c82 Nicer code for the error code path 2020-11-19 18:16:23 +01:00
Veikka Tuominen cf819b95fe
Merge pull request #6829 from tadeokondrak/error-unsupported-callconv
stage1: Compile error instead of falling back to C for unsupported cc
2020-11-19 19:03:08 +02:00
Tadeo Kondrak 25ec2dbc1e Add builtin.Signedness, use it instead of is_signed 2020-11-19 18:59:21 +02:00
Sébastien Marie b174942e6a openbsd, netbsd: getdents: entry with d_fileno==0 should be skipped 2020-11-19 13:55:46 +00:00
Sébastien Marie 7579ce180f Iterator: rename freebsd_entry to bsd_entry to reflect that nextBsd is not freebsd only 2020-11-19 13:54:47 +00:00
Sébastien Marie ad2ff9e65d darwin: getdents: entry with d_ino==0 should be skipped 2020-11-19 13:54:29 +00:00
Tadeo Kondrak c002a5026a
Update code to not use unsupported calling conventions for target 2020-11-19 14:01:07 +02:00
Andrew Kelley 13cccdd92c add std.heap.raw_c_allocator
This API does what `std.heap.c_allocator` previously did. See the new
doc comments for more details.
2020-11-18 22:09:34 -07:00
Andrew Kelley 02a4e5a4bf
Merge pull request #6385 from LemonBoy/callocator
std: Make C allocator respect the required alignment
2020-11-18 20:16:57 -08:00
breakin 6d3c176c12 Change seed for Murmur2_64 from u32 to u64 2020-11-18 17:05:38 -08:00
Veikka Tuominen 2418c8206a
Merge pull request #7154 from daurnimator/std.atomic
std.atomic.{Int,Bool}
2020-11-18 21:48:17 +02:00
Jakub Konka 663e112773 std: add chdir smoke test 2020-11-18 15:37:44 +01:00
Lee Cannon 64feae3ac3 Move utf8->utf16 up one level into os.zig 2020-11-18 15:37:44 +01:00
Lee Cannon dbbe709dc7 use else in err switch 2020-11-18 15:37:44 +01:00
Lee Cannon 32c998e03c Switch to RtlSetCurrentDirectory_U 2020-11-18 15:37:44 +01:00
Lee Cannon 80b1e82b1b Implement chdir and chdirZ for Windows 2020-11-18 15:37:44 +01:00
Veikka Tuominen a6470088c6
Merge pull request #6434 from daurnimator/fifo.pump
std: add LinearFifo(...).pump(src_reader, dest_writer)
2020-11-18 16:35:13 +02:00
Veikka Tuominen ee1d21bbef
Merge pull request #6649 from Rocknest/verparse
make Version.parse less strict
2020-11-18 16:06:52 +02:00
daurnimator 767dd772c0
std: add std.atomic.Bool 2020-11-19 00:58:13 +11:00
daurnimator d89d6374be
std: add tests for std.atomic.Int 2020-11-19 00:57:54 +11:00
daurnimator 8fa29bc0a2
std: fix missing operation argument to @atomicRmw 2020-11-19 00:57:35 +11:00
daurnimator eb4d93ece3
std: some more docs for std.atomic.Int 2020-11-19 00:44:38 +11:00
daurnimator 513e8161dd
std: mark std.atomic.Int as extern so it can be used in public ABIs 2020-11-19 00:41:43 +11:00
daurnimator c492ef97fd std: expose all atomic operations from std.atomic.Int 2020-11-18 15:36:40 +02:00
Vexu da84ef2a9c
make help in commands more consistent
Closes #7101

Co-authored-by: pfg <pfg@pfg.pw>
2020-11-18 13:58:27 +02:00
Alexandros Naskos 252924ae33 Added std.meta.fieldNames 2020-11-18 13:16:56 +02:00
Veikka Tuominen 6d5b76a75d
Merge pull request #7005 from jshholland/deprecate-span
Remove ArrayList.span
2020-11-18 13:14:48 +02:00