Commit Graph

314 Commits (284f6baf1c1884b2c5d17fd9724fdb5913e63e4e)

Author SHA1 Message Date
Andrew Kelley 54edbc6815 Merge remote-tracking branch 'origin/master' into llvm8 2019-03-13 12:56:58 -04:00
emekoi 1ed38a682e added z3 and fixed dynamic linker on mingw 2019-03-13 10:37:53 -04:00
Andrew Kelley c73cd05468
musl: remove files that have case conflicts 2019-03-13 01:00:12 -04:00
Andrew Kelley 9741b2aab4
avoid a string that is too long for msvc 2019-03-12 18:09:40 -04:00
Andrew Kelley 5570bc986b
remove accidental swap file 2019-03-12 17:44:03 -04:00
Andrew Kelley 62486c35a4
ability to build musl from source
bundles musl 1.1.21

See #514
2019-03-12 17:32:32 -04:00
Andrew Kelley 5734b7a37a
building musl start files from source 2019-03-12 13:18:52 -04:00
Andrew Kelley b7c331eb61
add musl headers 2019-03-12 10:30:12 -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 3cdd2c0bdd Merge remote-tracking branch 'origin/master' into llvm8 2019-03-10 13:48:06 -04:00
Andrew Kelley 8369ddb09c
glibc: add missing linux header 2019-03-09 01:24:30 -05:00
Jay Weisskopf cddc77dd97 Remove glibc compat shim with restrictive license
Unlike the other glibc source code checked into the repo, `csu/init.c`
did not have a license clause that allowed linking without restrictions.

`_IO_stdin_used` is the only symbol in the file and appears to be a 20
year old compatibility shim for the glibc 2.0 ABI. Obsolete in 2.1.
2019-03-08 08:46:06 -05:00
Andrew Kelley ce76de35f1
multi-arch glibc headers 2019-03-07 12:16:10 -05:00
Andrew Kelley 697b1233f0
support other architectures for glibc startup files 2019-03-06 12:10:03 -05:00
Andrew Kelley b554f6294f
add popcountdi2 to compiler_rt 2019-03-05 23:09:00 -05:00
Andrew Kelley ba144b366c
build libunwind.a from source and link it 2019-03-05 22:45:41 -05:00
Andrew Kelley 4c386436ea
support glibc dl, m, pthread, rt 2019-03-05 18:17:22 -05:00
Andrew Kelley c5fdea59d3
building glibc from source 2019-03-05 13:26:59 -05:00
Andrew Kelley aeb16010f3
initial glibc support 2019-03-04 22:15:53 -05:00
Andrew Kelley 0714e19598
Merge remote-tracking branch 'origin/master' into llvm8 2019-03-04 08:24:56 -05:00
Andrew Kelley e402455704
rename std lib files to new convention 2019-03-02 16:46:04 -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 2dcf1a2392
Merge remote-tracking branch 'origin/master' into llvm8 2019-02-28 09:19:18 -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
John Schmidt 0eed72d687 Add priority queue 2019-02-26 13:21:11 -05:00
Andrew Kelley a77a17e2c2
add `zig cc` command to act like a C compiler
closes #490
2019-02-24 12:53:28 -05:00
Andrew Kelley 6fd8d455bc
better libc detection (#1996)
* better libc detection

This introduces a new command `zig libc` which prints
the various paths of libc files. It outputs them to stdout
in a simple text file format that it is capable of parsing.
You can use `zig libc libc.txt` to validate a file.

These arguments are gone:
--libc-lib-dir [path]        directory where libc crt1.o resides
--libc-static-lib-dir [path] directory where libc crtbegin.o resides
--msvc-lib-dir [path]        (windows) directory where vcruntime.lib resides
--kernel32-lib-dir [path]    (windows) directory where kernel32.lib resides

Instead we have this argument:
--libc [file]                Provide a file which specifies libc paths

This is used to pass a libc text file (which can be generated with
`zig libc`). So it is easier to manage multiple cross compilation
environments.

`--cache on` now works when linking against libc.

`ZigTarget` now has a bool field `is_native`

Better error messaging when you try to link against libc or use
`@cImport` but the various paths cannot be found. It should also be
faster.

* save native_libc.txt in zig-cache

This avoids having to detect libc at runtime on every invocation.
2019-02-23 09:35:56 -05:00
daurnimator da7880b4cf
std: Add valgrind module 2019-02-20 16:52:20 +11:00
Andrew Kelley 3e586264e5
Merge pull request #1972 from coypoop/netbsd
Add NetBSD support
2019-02-18 00:10:31 -05:00
Maya Rashish bc10382ec1 Add NetBSD support
Mostly picking the same paths as FreeBSD.
We need a little special handling for crt files, as netbsd uses its
own (and not GCC's) for those, with slightly different names.
2019-02-17 09:17:34 +02:00
Andrew Kelley 356cfa08f4
translate-c: proof of concept for transitioning to userland
See #1964
2019-02-16 15:26:44 -05:00
Andrew Kelley ba56f365c8
bring zig fmt to stage1 2019-02-16 00:53:32 -05:00
Marc Tiehuis c34ce6878e Add parseFloat to std.fmt
This is not intended to be the long-term implementation as it doesn't
provide various properties that we eventually will want (e.g.
round-tripping, denormal support). It also uses f64 internally so the
wider f128 will be inaccurate.
2019-02-14 00:07:51 +13:00
Marc Tiehuis be861a85c8 compiler-rt: Add __addtf3, __subtf3 and __truncdfhf2
Allows addition/subtraction of f128 and narrowing casts to f16 from
larger float types.
2019-02-13 23:24:52 +13:00
Andrew Kelley 1864acd326
Merge remote-tracking branch 'origin/master' into llvm8 2019-02-09 18:57:39 -05:00
Andrew Kelley c2db077574
std.debug.assert: remove special case for test builds
Previously, std.debug.assert would `@panic` in test builds,
if the assertion failed. Now, it's always `unreachable`.

This makes release mode test builds more accurately test
the actual code that will be run.

However this requires tests to call `std.testing.expect`
rather than `std.debug.assert` to make sure output is correct.

Here is the explanation of when to use either one, copied from
the assert doc comments:

Inside a test block, it is best to use the `std.testing` module
rather than assert, because assert may not detect a test failure
in ReleaseFast and ReleaseSafe mode. Outside of a test block, assert
is the correct function to use.

closes #1304
2019-02-08 18:23:38 -05:00
Andrew Kelley 3e08b3a4f8
update embedded LLD to 8.0.0rc2 2019-02-07 17:07:18 -05:00
Andrew Kelley 89ffb58197 implement Thread Local Storage on Windows 2019-02-06 18:32:41 -05:00
Andrew Kelley d2602b442e
require running std lib tests coherently
this should actually improve CI times a bit too

See the description at the top of std/os/startup.zig (deleted in this
commit) for a more detailed understanding of what this commit does.
2019-02-06 14:32:20 -05:00
Andrew Kelley b1775ca168
thread local storage working for linux x86_64 2019-02-06 13:48:04 -05:00
Andrew Kelley bfc1772d8e fixups 2019-02-01 12:22:21 -05:00
Andrew Kelley d8b6fa9134
Merge pull request #1859 from mgxm/fbsd2
Progress towards tier 1 support for FreeBSD x86_64
2018-12-29 12:49:23 -05:00
Andrew Kelley a918ce26b8
fixups 2018-12-26 15:25:54 -05:00
nebulaeonline fdea12b2d9 msvc subsystem option handling; added uefi os type 2018-12-23 22:44:02 -05:00
Marcio Giaxa 666b153144 freebsd: remove syscall files 2018-12-19 18:41:40 -02:00
Wink Saville 634d11ab28 Add add compiler_rt routines for float to signed integer conversion
And add std.math.f128_* constants.

The routines are:

  __fixdfdi, __fixdfsi, __fixdfti,
  __fixsfdi, __fixsfsi, __fixsfti,
  __fixtfdi, __fixtfsi, __fixtfti.

These all call fixint which is a generic zig function that does the
conversion:

  pub fn fixint(comptime fp_t: type, comptime fixint_t: type, a: fp_t) fixint_t

There are also a set tests:

  __fixdfdi_test, __fixdfsi_test, __fixdfti_test,
  __fixsfdi_test, __fixsfsi_test, __fixsfti_test,
  __fixtfdi_test, __fixtfsi_test, __fixtfti_test.
2018-12-12 00:21:42 -05:00
Andrew Kelley a40d160a5c
introduce std.io.SeekableStream
Relevant #764

dwarf debug info is modified to use this instead of std.os.File
directly to make it easier for bare metal projects to take advantage
of debug info parsing
2018-12-02 18:36:18 -05:00
Andrew Kelley 9493738e54
Merge branch 'freebsd-up' of https://github.com/myfreeweb/zig into freebsd2 2018-11-19 17:24:41 -05:00
tgschultz 58610a4427 Add std.meta to deployment (#1670) 2018-10-20 11:40:26 -04:00
Greg V e5627f8e63 Support more of std on FreeBSD 2018-10-20 15:21:35 +03:00