Commit Graph

152 Commits

Author SHA1 Message Date
Andrew Kelley 2f9c5c0644 self-host dynamic linker detection 2020-02-17 15:23:59 -05:00
Michael Dusan edb210905d stage1: memory/report overhaul
- split util_base.hpp from util.hpp
- new namespaces: `mem` and `heap`
- new `mem::Allocator` interface
- new `heap::CAllocator` impl with global `heap::c_allocator`
- new `heap::ArenaAllocator` impl
- new `mem::TypeInfo` extracts names without RTTI
- name extraction is enabled w/ ZIG_ENABLE_MEM_PROFILE=1
- new `mem::List` takes explicit `Allocator&` parameter
- new `mem::HashMap` takes explicit `Allocator&` parameter
- add Codegen.pass1_arena and use for all `ZigValue` allocs
- deinit Codegen.pass1_arena early in `zig_llvm_emit_output()`
2020-02-10 21:08:08 -05:00
Andrew Kelley fbfda7f00e fix incorrect list of sub-arches for aarch64
tests use older sub-arch that works in the older qemu
2020-01-23 13:02:45 -05:00
Andrew Kelley 15d5cab569 fix target_triple_zig to emit zig-compatible triples 2020-01-21 12:25:22 -05:00
Andrew Kelley 327ad0ae89 target_triple_llvm: emit none instead of unknown 2020-01-21 03:05:56 -05:00
Andrew Kelley 839b3a61ad expose the ability to disable C sanitization
and disable C sanitization when building libcs.
Empirically, they seem to trigger undef-sanitization.
2019-12-16 13:51:21 -05:00
Andrew Kelley 10e172b1d7 add other OS and fix regression in build-exe for freestanding 2019-12-04 14:42:40 -05:00
Andrew Kelley dcbd5ad155 remove upstream support for Zen hobby OS
The new plan to support hobby operating systems is #3784.

And what kind of name is "Zen" anyway? There's already a
[Zen programming language](http://zenlang.sourceforge.net/)
and that's just confusing.
2019-12-02 12:01:49 -05:00
Andrew Kelley 4261fa3c49 move logic to the appropriate layers; add new compile error 2019-11-25 18:46:17 -05:00
Tse 33cc204481 DragonFlyBSD support 2019-10-30 21:21:58 -04:00
Andrew Kelley ad438a95c5 avoid passing -march=native when not supported
Clang does not support -march=native for all targets.
Arguably it should always work, but in reality it gives:
error: the clang compiler does not support '-march=native'
If we move CPU detection logic into Zig itelf, we will not need this,
instead we will always pass target features and CPU configuration explicitly.
For now, we simply avoid passing the flag when it is known to not be
supported.
2019-10-24 19:43:56 -04:00
Andrew Kelley 543e729398 Merge pull request #3331 from meme/android-ndk
Support Android NDK
2019-09-28 13:30:19 -04:00
Andrew Kelley 579301c2af avoid duplicated code of specifying the default glibc version 2019-09-27 17:39:11 -04:00
meme f7bf61a983 support Android NDK and bionic 2019-09-27 16:51:42 -04:00
LemonBoy 4ebcf64864 Initial support for mipsel architecture¬ 2019-09-26 09:31:55 +02:00
Andrew Kelley c4416b224d Merge remote-tracking branch 'origin/master' into llvm9 2019-09-15 20:59:53 -04:00
Andrew Kelley c15e464320 Merge branch 'uefi' of https://github.com/nrdmn/zig into nrdmn-uefi 2019-09-13 14:10:42 -04:00
Andrew Kelley 185cb13278 Merge remote-tracking branch 'origin/master' into llvm9 2019-09-10 13:00:35 -04:00
Andrew Kelley 8f0df86937 I'm pretty sure sp is the stack pointer on all ARM 2019-09-05 14:15:39 -04:00
Andrew Kelley 058050f22c Merge remote-tracking branch 'origin/master' into llvm9 2019-09-02 20:56:31 -04:00
Andrew Kelley 8b1900e5df Revert "Merge pull request #2991 from emekoi/mingw-ci"
This reverts commit ec7d7a5b14, reversing
changes made to 81c441f885.

It looks like this broke colors in Windows Command Prompt (#3147)
and this method of detecting native C ABI isn't working well (#3121).
2019-09-01 00:33:02 -04:00
Andrew Kelley 928ce5e326 Merge remote-tracking branch 'origin/master' into llvm9 2019-08-28 16:59:35 -04:00
Andrew Kelley ec7d7a5b14 Merge pull request #2991 from emekoi/mingw-ci
mingw improvements
2019-08-21 12:29:42 -04:00
Andrew Kelley c39bb3ebc4 target: add missing switch case 2019-08-16 16:52:45 -04:00
Andrew Kelley 6529658ad8 Merge remote-tracking branch 'origin/master' into llvm9 2019-08-16 16:43:56 -04:00
yvt 2cb1f93894 correct LLVM subarch names for arm 2019-08-16 08:46:18 -07:00
Andrew Kelley 24d5ec0783 fix async function frames not aligned enough 2019-08-11 22:35:12 -04:00
emekoi 59e2c87b4b move windows abi detection to get_native_target 2019-08-03 18:40:27 -05:00
Andrew Kelley 63ebd9d12e Merge remote-tracking branch 'origin/master' into llvm9 2019-08-03 12:39:15 -04:00
emekoi 102d3f30c4 accept unix style paths on windows-gnu 2019-08-02 19:39:33 -05:00
emekoi f15ec9a59b implemented runtime abi detetction for windows 2019-08-02 19:32:46 -05:00
Andrew Kelley 38b5812c48 allow 128 bit cmpxchg on x86_64 2019-08-01 02:46:37 -04:00
Nick Erdmann 63d56c532d src/target.cpp: UEFI improvements 2019-07-29 00:19:40 +02:00
Andrew Kelley a3854d042e basic riscv support
llvm is giving me `error: couldn't allocate output register for
constraint '{a0}'` which is a bug that needs to be fixed upstream.
2019-07-18 15:03:21 -04:00
Andrew Kelley d4ca337e6b improvements to riscv support 2019-07-18 12:21:57 -04:00
Andrew Kelley e816d592e8 update zig codebase to llvm 9 2019-07-17 17:47:39 -04:00
Andrew Kelley 95e04e3874 back to msvc as the default C ABI on Windows
Zig provides a libc for the GNU C ABI on Windows, and cannot (at least
yet) provide one for the MSVC C ABI. However when not linking libc,
zig has no problem targeting MSVC as the C ABI. And this should be the
default.

Related: #2911
2019-07-17 12:40:48 -04:00
Andrew Kelley 8f92a49dfd update to llvm9 trunk 2019-07-16 22:23:48 -04:00
Andrew Kelley c0b4121ff2 libc headers before C language headers, and disable libunwind on arm32 2019-07-16 21:38:18 -04:00
Andrew Kelley d994379173 update bundled musl source to 1.1.23 2019-07-16 19:54:14 -04:00
Andrew Kelley 7b8ba871a9 mingw libc: solve the segfault having to do with destructors
* fixed --verbose-cc printing an extra "zig" before the rest of
   the command line
 * windows-gnu targets use libfoo.a, foo.o extensions to match mingw
   conventions.
2019-07-12 14:44:34 -04:00
Andrew Kelley d9c4c96bf2 add -Wno-pragma-pack when targeting windows-gnu
windows.h has files such as pshpack1.h which do #pragma packing,
triggering a clang warning. So for this target, this warning is
disabled.

this commit also improves the error message printed when no libc can be
used, printing the "zig triple" rather than the "llvm triple".
2019-07-11 23:48:13 -04:00
Andrew Kelley b4bbfe8c05 the msvc target abi will have to be solved a different way 2019-07-11 12:56:51 -04:00
Andrew Kelley 1c7f21852f ship with mingw-w64 v6.0.0
See #514
2019-07-09 23:34:16 -04:00
Andrew Kelley 8692c6fc0d zero initialize target
Fixes glibc_version being set to garbage. I've made this mistake
before so this is an attempt to prevent future bugs. Zig doesn't
have zero-initialization, so are we being a hypocrite by using this
C feature? No, because C doesn't have the feature that forces you to
initialize all fields. That would have prevented this bug every single
time.
2019-07-08 02:10:26 -04:00
Andrew Kelley f04782785f fix not setting a target glibc version on non-linux 2019-07-07 19:24:44 -04:00
Andrew Kelley 7ccf7807b3 ability to target any glibc version 2019-07-07 17:56:08 -04:00
Andrew Kelley 516b5e649f better CLI error message for missing sub-architecture 2019-06-27 11:05:12 -04:00
Andrew Kelley 7c5ceb0c4c standard library integrates with knowledge of stripped debug info 2019-06-14 18:45:41 -04:00
Andrew Kelley 2c0280ba08 improve the stack check CLI options
See #2526
2019-05-27 20:59:19 -04:00