Commit Graph

1681 Commits (127bb124a06dc93f4def23224d400f4050754674)

Author SHA1 Message Date
Andrew Kelley 3c7555cb67
Merge remote-tracking branch 'origin/llvm8' 2019-03-20 13:34:07 -04:00
Andrew Kelley 2fdf69bc40
Merge pull request #2079 from Sahnvour/issue-2050
Fixes c_ABI tests on windows
2019-03-20 00:11:11 -04:00
Andrew Kelley ac34841270
build.zig: allow run() on non-native target artifacts 2019-03-19 17:08:50 -04:00
Andrew Kelley af9ac0d548
better buffer length for formatIntUnsigned
see #1358
2019-03-19 10:11:28 -04:00
Andrew Kelley a581f4f0e2
Merge remote-tracking branch 'origin/master' into llvm8 2019-03-18 20:03:23 -04:00
Andrew Kelley 7dfbeca13e
libc: separate linux headers from musl/glibc 2019-03-18 13:47:59 -04:00
Sahnvour ae9b90cf6e print a message instead of returning an error when debug info comes from a source file not found (for example compiled on another computer) 2019-03-16 15:34:14 +01:00
Sahnvour 704dfaaabf avoid reading LineBlockFragmentHeader at all if the address is not in range, thus simplifying code and improving speed of execution 2019-03-16 15:34:14 +01:00
Sahnvour 094d40fb1a allow pdb modules to have no C13 data, this happens if the module is stripped 2019-03-16 15:34:14 +01:00
Sahnvour 0d4a5c40bc correct padding handling between std.pdb.ModInfo entries in DbiStream 2019-03-16 15:34:14 +01:00
Andrew Kelley 01fb421031 fix regressions on Windows from previous commit 2019-03-15 18:57:07 -04:00
Andrew Kelley 9c13e9b7ed
breaking changes to std.mem.Allocator interface API
Before, allocator implementations had to provide `allocFn`,
`reallocFn`, and `freeFn`.

Now, they must provide only `reallocFn` and `shrinkFn`.
Reallocating from a zero length slice is allocation, and
shrinking to a zero length slice is freeing.

When the new memory size is less than or equal to the
previous allocation size, `reallocFn` now has the option
to return `error.OutOfMemory` to indicate that the allocator
would not be able to take advantage of the new size.

For more details see #1306. This commit closes #1306.

This commit paves the way to solving #2009.

This commit also introduces a memory leak to all coroutines.
There is an issue where a coroutine calls the function and it
frees its own stack frame, but then the return value of `shrinkFn`
is a slice, which is implemented as an sret struct. Writing to
the return pointer causes invalid memory write. We could work
around it by having a global helper function which has a void
return type and calling that instead. But instead this hack will
suffice until I rework coroutines to be non-allocating. Basically
coroutines are not supported right now until they are reworked as
in #1194.
2019-03-15 17:57:21 -04:00
Akuli b1c8c79733 Add /lib/x86_64-linux-gnu or similar to default system library search paths
this makes compiling with libraries like zlib and ncurses easier
2019-03-14 14:51:24 -04:00
Andrew Kelley 080dd27157
breaking: fix @typeInfo handling of global error set type
`builtin.TypeInfo.ErrorSet` is now `?[]Error`
instead of `struct{errors:[]Error}`.

closes #1936
2019-03-14 11:57:56 -04:00
Andrew Kelley 20c36949e1
fix target_requires_pic and reloc_mode
disable failing thread local variable test.
see #2063
2019-03-13 23:15:34 -04:00
Andrew Kelley 5d2edac12d
breaking: remove --static; add -dynamic
`--static` is no longer an option. Instead, Zig makes things as static
as possible by default. `-dynamic` can be used to choose a dynamic
library rather than a static one.

`--enable-pic` is a new option. Usually it will be enabled
automatically, but in the case of build-exe with no dynamic libraries
on Linux or freestanding, Zig chooses off by default.

closes #1703
closes #1828
2019-03-13 19:50:41 -04:00
Andrew Kelley d213708333
this empty import workaround no longer necessary 2019-03-13 14:13:09 -04:00
Andrew Kelley 54edbc6815 Merge remote-tracking branch 'origin/master' into llvm8 2019-03-13 12:56:58 -04:00
Andrew Kelley f2ca2ace09
zig build: do a better job of detecting system paths
See #2041
2019-03-11 15:22:05 -04:00
Andrew Kelley d633dcd07a
remove the valgrind integration with std.mem.Allocator
See #1837
2019-03-11 13:34:51 -04:00
Andrew Kelley 5362ca204f
Merge branch 'valgrind' of https://github.com/daurnimator/zig into daurnimator-valgrind 2019-03-11 13:27:04 -04:00
Andrew Kelley e1fbb24d64
add test for spawning child process with empty environment
thanks to BenoitJGirard for pointing out the child process
implementation needs 3 extra null bytes in #2031
2019-03-11 11:56:08 -04:00
Andrew Kelley 4cb55d3af6 Merge remote-tracking branch 'origin/master' into llvm8 2019-03-10 18:07:28 -04:00
Andrew Kelley 918dbd4551
std.zig: `this` is no longer a keyword 2019-03-10 15:55:54 -04:00
Andrew Kelley 3cdd2c0bdd Merge remote-tracking branch 'origin/master' into llvm8 2019-03-10 13:48:06 -04:00
Andrew Kelley 8624379c71
Merge pull request #2038 from ziglang/caching
breaking changes to zig build API and improved caching
2019-03-09 01:17:36 -05:00
Andrew Kelley a45807db22 disable flaky event test until post coroutine rewrite 2019-03-09 01:15:18 -05:00
Andrew Kelley 5046aa9403 fix running things with zig build on Windows
Windows doesn't have rpaths for DLLs so we instead add
search paths to Path environment variable when running
an executable that depends on DLLs built with zig build.
2019-03-09 00:42:14 -05:00
Andrew Kelley 91955dee58
breaking changes to zig build API and improved caching
* in Zig build scripts, getOutputPath() is no longer a valid function
   to call, unless setOutputDir() was used, or within a custom make()
   function. Instead there is more convenient API to use which takes
   advantage of the caching system. Search this commit diff for
   `exe.run()` for an example.
 * Zig build by default enables caching. All build artifacts will go
   into zig-cache. If you want to access build artifacts in a convenient
   location, it is recommended to add an `install` step. Otherwise
   you can use the `run()` API mentioned above to execute programs
   directly from their location in the cache. Closes #330.
   `addSystemCommand` is available for programs not built with Zig
   build.
 * Please note that Zig does no cache evicting yet. You may have to
   manually delete zig-cache directories periodically to keep disk
   usage down. It's planned for this to be a simple Least Recently
   Used eviction system eventually.
 * `--output`, `--output-lib`, and `--output-h` are removed. Instead,
   use `--output-dir` which defaults to the current working directory.
   Or take advantage of `--cache on`, which will print the main output
   path to stdout, and the other artifacts will be in the same directory
   with predictable file names. `--disable-gen-h` is available when
   one wants to prevent .h file generation.
 * `@cImport` is always independently cached now. Closes #2015.
   It always writes the generated Zig code to disk which makes debug
   info and compile errors better. No more "TODO: remember C source
   location to display here"
 * Fix .d file parsing. (Fixes the MacOS CI failure)
 * Zig no longer creates "temporary files" other than inside a
   zig-cache directory.

This breaks the CLI API that Godbolt uses. The suggested new invocation
can be found in this commit diff, in the changes to `test/cli.zig`.
2019-03-08 23:23:11 -05:00
John Schmidt dd34c21779 PriorityQueue: add bulk insertion methods 2019-03-08 14:23:05 -05:00
Andrew Kelley 1e634a384c
Merge branch 'glibc'
See #514
2019-03-07 16:55:31 -05:00
Andrew Kelley 3d2c48e4c9 disable some tests until coroutine rewrite is finished 2019-03-07 16:11:00 -05:00
Andrew Kelley ce76de35f1
multi-arch glibc headers 2019-03-07 12:16:10 -05:00
Andrew Kelley b554f6294f
add popcountdi2 to compiler_rt 2019-03-05 23:09:00 -05:00
Andrew Kelley e2f4df6065
std.os.changeCurDir no longer needs an allocator 2019-03-05 18:43:39 -05:00
Andrew Kelley 0714e19598
Merge remote-tracking branch 'origin/master' into llvm8 2019-03-04 08:24:56 -05:00
Andrew Kelley e3b275fa47
fix build.zig not respecting --static
closes #2027
2019-03-03 12:35:09 -05:00
sjdh02 74c123cd0a fix check for 64-bit arm platforms with new targets 2019-03-03 10:04:08 -05:00
Andrew Kelley e402455704
rename std lib files to new convention 2019-03-02 16:46:04 -05:00
Andrew Kelley f7835000b6
@returnAddress and @frameAddress return usize now 2019-03-02 15:34:58 -05:00
Sahnvour 4bac22e888 all integers returned by @typeInfo are now comptime_int 2019-03-02 14:27:37 -05:00
Andrew Kelley 67b4de33d2
compile error for import outside package path
closes #2024

there's a new cli option `--main-pkg-path` which you can use to choose
a different root package directory besides the one inferred from the
root source file

and a corresponding build.zig API:
foo.setMainPkgPath(path)
2019-03-02 10:38:27 -05:00
Andrew Kelley 99b6429a89
disable tests which are tripping an llvm assertion
See #2019
2019-03-02 08:44:18 -05:00
Andrew Kelley bed81089e1
Merge pull request #2020 from ziglang/kill-namespace-type
remove the (namespace) type and make every file an empty struct
2019-03-01 18:07:46 -05:00
Andrew Kelley 582fdc2869
fix dependency loops, pub, tests, use decls, root source
* fix dependency loop detection
   - closes #679
   - closes #1500
 * fix `pub`
 * fix tests
 * fix use decls
 * main package file gets a special "" namespace path
2019-03-01 15:35:29 -05:00
Andrew Kelley 76b4e49178
add mprotect syscall 2019-02-28 20:11:36 -05:00
Andrew Kelley 5424b4320d
remove namespace type; files are empty structs
closes #1047
2019-02-28 10:11:32 -05:00
Andrew Kelley 1d7e5479b0
fix .gitignore file and add commit missing std lib file 2019-02-26 18:33:27 -05:00
Andrew Kelley 4563f6b424
add builder.addFmt API and use it to test stage1 zig fmt
closes #1968
2019-02-26 18:10:40 -05:00
Andrew Kelley ade10387a5
breaking changes to the way targets work in zig
* CLI: `-target [name]` instead of `--target-*` args.
   This matches clang's API.
 * `builtin.Environ` renamed to `builtin.Abi`
   - likewise `builtin.environ` renamed to `builtin.abi`
 * stop hiding the concept of sub-arch. closes #1526
 * `zig targets` only shows available targets. closes #438
 * include all targets in readme, even those that don't
   print with `zig targets` but note they are Tier 4
 * refactor target.cpp and make the naming conventions
   more consistent
 * introduce the concept of a "default C ABI" for a given
   OS/Arch combo. As a rule of thumb, if the system compiler
   is clang or gcc then the default C ABI is the gnu ABI.
2019-02-26 15:58:10 -05:00