Commit Graph

142 Commits

Author SHA1 Message Date
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
Andrew Kelley 81e960eb74 improvements to build-lib use case of WebAssembly
* build-exe does include the startup code that supplies _start for the
   wasm32-freestanding target. Previously this did not occur because
   of logic excluding "freestanding".
 * build-lib for wasm32-freestanding target gets linked by LLD. To avoid
   infinite recursion, compiler_rt and zig libc are built as objects
   rather than libraries.
   - no "lib" prefix and ".wasm" extension instead of ".a". Rather than
   build-lib foo.zig producing "libfoo.a", now it produces "foo.wasm".
 * go back to using `.o` extension for webassembly objects
 * zig libc only provides _start symbol for wasm when linking libc.
2019-05-16 13:56:56 -04:00
Shritesh Bhattarai b64e6cb813 change wasm obj ext to .wasm 2019-05-15 20:41:22 -04:00
Andrew Kelley 14cdb01f35 improvements to zig's implementation of libc and WebAssembly
* rename std/special/builtin.zig to std/special/c.zig
   not to be confused with @import("builtin") which is entirely
   different, this is zig's multi-target libc implementation.
 * WebAssembly: build-exe is for executables which have a main().
   build-lib is for building libraries of functions to use from,
   for example, a web browser environment.
   - for now pass --export-all for libraries when there are any
     C objects because we have no way to detect the list of exports
     when compiling C code.
   - stop passing --no-entry for executables. if you want --no-entry
     then use build-lib.
 * make the "musl" ABI the default ABI for wasm32-freestanding.
 * zig provides libc for wasm32-freestanding-musl.
2019-05-15 20:14:58 -04:00
Shritesh Bhattarai 0f1d92e2cf wasm: force single threaded 2019-04-14 10:21:48 -04:00
Shritesh Bhattarai 63f2e96eea wasm: use .wasm ext for exe 2019-04-12 13:17:59 -04:00
Matthew Iannucci 27cd830ec8 Add initial support for iOS targets (#2237)
* Add iOS C int sizes... try to hack in iOS DebugInfo

* Get rid of ios link check for now

* Remove macos linkversion check
2019-04-11 13:15:17 -04:00
Andrew Kelley 64b2cf776c implement target_c_type_size_in_bits for WASI 2019-03-27 16:08:45 -04:00
Andrew Kelley 324cbb9864 stage1: implement get_dynamic_linker for riscv 2019-03-22 17:12:41 -04:00
Andrew Kelley 3c7555cb67 Merge remote-tracking branch 'origin/llvm8' 2019-03-20 13:34:07 -04:00
Andrew Kelley 3c36929603 zig targets prints the available libcs 2019-03-19 15:04:29 -04:00