Andrew Kelley
d08c57741a
ability to make a DLL
...
See #302
2017-10-16 01:14:28 -04:00
Andrew Kelley
562f91e875
clean up some resources
2017-10-15 21:06:04 -04:00
Andrew Kelley
b505462509
replace __chkstk function with a stub that does not crash
...
Closes #508
See #302
2017-10-03 00:29:41 -04:00
Andrew Kelley
f1bd02e6f4
add @setAlignStack builtin
2017-10-03 00:29:27 -04:00
Andrew Kelley
5cbae7b671
better compiler-rt linkage logic
...
now the compiler-rt tests are passing on windows. See #302
2017-10-02 00:11:45 -04:00
Andrew Kelley
e3ea0b652c
still build compiler-rt when linking msvc CRT
...
because it's missing some things
2017-10-01 21:19:58 -04:00
Andrew Kelley
756d5c545d
remove unused function
2017-10-01 21:07:02 -04:00
Andrew Kelley
4d865e355b
support linking against MSVC libc
2017-10-01 21:05:08 -04:00
Andrew Kelley
1962c8588f
implement standard library path search
...
closes #463
See #302
2017-10-01 18:30:31 -04:00
Andrew Kelley
0975e37b16
fix implementation of --zig-std-dir
...
see #463
2017-10-01 15:51:55 -04:00
Andrew Kelley
c6295fe9ab
remove zigrt
...
adds test case for #394
partially reverts a32b5929ccf8cbf79396d8924097a1a911985dac
2017-09-30 20:21:57 -04:00
Andrew Kelley
ba41be67f0
windows gui hello world
2017-09-24 03:55:45 -04:00
Andrew Kelley
d71d6363ce
macho linking: support full lib paths correctly
2017-09-23 13:03:25 -04:00
Andrew Kelley
86eb183668
coff linking passes -DEBUG
...
which makes a .pdb file
2017-09-18 22:05:55 -04:00
Andrew Kelley
46ddeb0baf
add --verbose-link option
...
only prints the link line
2017-09-18 21:06:53 -04:00
Andrew Kelley
eb0979189b
add windows to test targets
...
cross-compiling hello world with no libc for windows is working
2017-08-31 11:41:58 -04:00
Andrew Kelley
021155db5b
successfully cross-building behavior tests for windows
2017-08-30 17:01:14 -04:00
Andrew Kelley
97013951dd
tests use darwin, not macosx since that's what macbook reports as
2017-08-30 15:15:14 -04:00
Andrew Kelley
0e9bdb44a6
test suite cross-compile builds tests for other targets
2017-08-30 14:55:26 -04:00
Andrew Kelley
ebdc6b594d
all tests passing in MacOS
...
depends on LLD 5.0.0 with 3 patches
See #273
2017-08-27 17:16:42 -04:00
Andrew Kelley
ff2c794612
all behavior tests passing for macos
...
See #273
2017-08-27 05:15:24 -04:00
Andrew Kelley
91536813ec
macos updates
...
* try some macos travis stuff
* put c in the link libs for macos since we always link with libSystem
* for non-native targets on macos, allow runtime symbol resolution
- it's causing an infinite loop in LLD.
* for macos, always build compiler_rt and turn on LinkOnce because
compiler_rt on darwin is missing some stuff.
2017-08-27 02:51:25 -04:00
Andrew Kelley
2bd6c60752
update for llvm 5.0.0rc1
2017-08-26 00:34:40 -04:00
Andrew Kelley
cf46cd5f2b
organize file path of compiler_rt
2017-08-15 07:16:22 -04:00
Andrew Kelley
6a93dda3e1
progress toward windows hello world working
2017-06-14 00:04:34 -04:00
Andrew Kelley
199bbb6292
progress toward hello world without libc in windows
2017-06-04 10:08:55 -04:00
Andrew Kelley
d8d45908fa
building with mingw for windows
2017-05-23 00:26:12 -04:00
Andrew Kelley
157af4332a
builtin functions for division and remainder division
...
* add `@divTrunc` and `@divFloor` functions
* add `@rem` and `@mod` functions
* add compile error for `/` and `%` with signed integers
* add `.bit_count` for float primitive types
closes #217
2017-05-06 23:13:12 -04:00
Andrew Kelley
24a9a42966
add safe release build mode
...
closes #288
2017-05-02 17:34:21 -04:00
Andrew Kelley
363d9038c9
zig build: organize build artifacts
...
closes #328
2017-04-30 18:56:24 -04:00
Andrew Kelley
a147f06585
zig puts temporary object files in zig-cache folder
...
See #298
2017-04-28 02:22:12 -04:00
Andrew Kelley
7e11ef79d6
zig test no longer requires a separate test_runner.o file
...
See #298
2017-04-27 16:19:20 -04:00
Andrew Kelley
7b0542d08b
build system: consolidate duplicate code and more
...
* add ability to add assembly files when building an exe, obj, or lib
* add implicit cast from `[N]T` to `?[]const T` (closes #343 )
* remove link_exe and link_lib in favor of allowing build_exe and
build_lib support no root zig source file
2017-04-26 19:17:05 -04:00
Andrew Kelley
e0050af293
add some timing diagnostics
...
pass --enable-timing-info to print a nice table like this:
```
Name Start End Duration Percent
Initialize 0.0000 0.0000 0.0000 0.0001
Semantic Analysis 0.0000 0.0421 0.0420 0.2109
Code Generation 0.0421 0.0620 0.0200 0.1003
LLVM Emit Object 0.0620 0.1852 0.1231 0.6180
Build Dependencies 0.1852 0.1974 0.0122 0.0615
LLVM Link 0.1974 0.1993 0.0018 0.0093
Generate .h 0.1993 0.1993 0.0000 0.0000
Total 0.0000 0.1993 0.1993 1.0000
```
2017-04-25 12:29:25 -04:00
Andrew Kelley
d1e01e43d3
convert assemble and link tests to zig build system
2017-04-19 14:00:12 -04:00
Andrew Kelley
bf67427c67
fix crash when using zig to link
...
without explicit dynamic linker
2017-04-13 01:15:25 -04:00
Andrew Kelley
7f47b0c271
run alwaysinline pass in debug mode
...
before this commit, the optimized IR code that is displayed in
--verbose mode is not actually what gets emitted to an object
file.
that is now corrected, and we make sure to run the alwaysinliner
pass even in debug mode, so you can rely on "inline" keyword
inlining a function, guaranteed.
See #306
2017-04-11 03:37:44 -04:00
Andrew Kelley
11a6550324
fix some -Wconversion errors
2017-04-10 20:02:39 -04:00
Andrew Kelley
d65cd73a8b
add support to use zig as a linker driver
...
closes #243
I also added --grep to ./run_tests if you want to single out
some specific tests
2017-04-05 07:49:40 -04:00
Andrew Kelley
00efbfa054
link: correctly print debug linker invocation
2017-04-04 06:15:23 -04:00
Andrew Kelley
8db9d04e6f
link: fix ignoring first linker arg
...
LLD treats the first argument as arg[0], the exe name
2017-04-04 06:07:09 -04:00
Andrew Kelley
b46344fd01
link: delete code that checks the linker version
...
since we depend on LLD for linking
2017-04-03 23:29:53 -04:00
Andrew Kelley
a32b5929cc
add stack protector safety when linking libc
...
* introduce zigrt file. it contains only weak symbols so that
multiple instances can be merged. it contains __zig_panic
so that multiple .o files can call the same panic function.
* remove `@setFnVisible` builtin and add @setGlobalLinkage builtin
which is more powerful
* add `@panic` builtin function.
* fix collision of symbols with extern prototypes and internal
function names
* add stack protector safety when linking against libc. To add
the safety mechanism without libc requires implementing
Thread Local Storage. See #276
2017-03-26 21:07:07 -04:00
Andrew Kelley
5bc9feb5cb
organize std and make import relative to current file
...
closes #216
2017-03-26 06:39:28 -04:00
Andrew Kelley
87bc97daef
unify main entry point regardless of whether linking libc
...
closes #248
2017-03-22 11:26:30 -04:00
Andrew Kelley
7efa2cd81c
add --each-lib-rpath option and corresponding config option
...
This adds an rpath entry for each used dynamic library directory.
This is necessary on some systems such as NixOS.
2017-03-13 13:11:55 -04:00
Andrew Kelley
d10bbd28e9
use lld instead of system linker
2017-03-13 11:54:56 -04:00
Andrew Kelley
d3f1889951
in freestanding environment, assume gnu binutils
...
for now. soon LLD will free us from depending on
system linkers.
2017-02-03 15:53:23 -05:00
Andrew Kelley
3be4b6434c
add ability to set linker script
2017-02-03 12:34:20 -05:00
Andrew Kelley
7aeca9bfed
fix incorrect linking from previous commit
2016-09-21 17:40:50 -04:00