Commit Graph

41 Commits

Author SHA1 Message Date
Andrew Kelley 92a36040b1 msp430 target: c_long is always 32 bits
closes #1125
2018-06-18 01:03:45 -04:00
Andrew Kelley e5956f23ca add target C int type information for msp430 target
closes #1125
2018-06-17 12:47:27 -04:00
Ben Noordhuis d464b25322 support --target-arch wasm32 (#1094)
Add wasm32 support to the build-obj, build-exe and build-lib commands
of the stage 1 compiler.  Wasm64 should work transparently once it's
supported in upstream LLVM.

To export a function:

    // lib.zig - for exposition, not necessary for this example
    pub use @import("add.zig");

    // add.zig
    export fn add(a: i32, b: i32) i32 {
        return a + b;
    }

To import a function:

    // cube.zig
    extern fn square(x: i32) i32;

    export fn cube(x: i32) i32 {
        return x * square(x);
    }
2018-06-09 22:39:22 -04:00
Andrew Kelley 967bad43a0 OpenBSD has the same C integer sizes as Linux
Thanks Jan S <jan.schreib@gmail.com> for this information

closes #1016
2018-05-16 20:18:38 -04:00
Andrew Kelley a6ae45145f add @newStackCall builtin function
See #1006
2018-05-12 17:35:15 -04:00
Andrew Kelley b01c50d6fa find libc and zig std lib at runtime
this removes the following configure options:
 * ZIG_LIBC_LIB_DIR
 * ZIG_LIBC_STATIC_LIB_DIR
 * ZIG_LIBC_INCLUDE_DIR
 * ZIG_DYNAMIC_LINKER
 * ZIG_EACH_LIB_RPATH
 * zig's reliance on CMAKE_INSTALL_PREFIX

these options are still available as command line options, however,
the default will attempt to execute the system's C compiler to
collect system defaults for these values.

closes #870
2018-03-30 17:10:54 -04:00
Marc Tiehuis d6e84e325b Add WebAssembly output workaround for LLVM 6 2018-03-13 21:53:42 +13:00
Andrew Kelley b57cb04afc Merge remote-tracking branch 'origin/master' into llvm6 2018-03-08 10:59:24 -05:00
Andrew Kelley cc0f660ad2 unless hf is specified in target environ, assume soft floating point
closes #804
2018-03-06 16:57:41 -05:00
Andrew Kelley 5a8d87f504 Merge branch 'master' into llvm6 2018-01-08 10:34:45 -05:00
Andrea Orru e932919e68 Darwin -> MacOSX, added Zen. See #438 2018-01-06 23:10:53 -05:00
Andrew Kelley 3a600297ca Merge remote-tracking branch 'origin/master' into llvm6 2017-11-06 22:41:12 -05:00
Marc Tiehuis 795703a39c Add emit command-line option (#580)
Add emit command-line option
2017-11-03 09:09:33 -04:00
Andrew Kelley 188fd47a51 add missing environment 2017-11-02 21:54:24 -04:00
Andrew Kelley 9a99bd3a71 use llvm named structs for const values when possible
normally we want to use llvm types for constants. but
union constants (which are found inside enums) when
they are initialized with the non-most-aligned-member
must be unnamed structs.

these bubble up to all aggregate types. if a constant of
an aggregate type contains, recursively, a union constant
with a non-most-aligned-member initialized, the aggregate
typed constant must be unnamed too.

this fixes all the asserts that were coming in from
llvm master branch.
2017-11-02 21:54:24 -04:00
Andrew Kelley 94ec2190f8 update to llvm master 2017-11-02 21:54:24 -04:00
Andrew Kelley 08708ea4dc fix typo in target_can_exec logic 2017-09-30 20:10:09 -04:00
Andrew Kelley 845f22101b zig test on 64-bit windows runs 32-bit tests 2017-09-30 14:40:16 -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 0e9bdb44a6 test suite cross-compile builds tests for other targets 2017-08-30 14:55:26 -04:00
Andrew Kelley 2bd6c60752 update for llvm 5.0.0rc1 2017-08-26 00:34:40 -04:00
Andrew Kelley a0a57beed5 fix invalid target info 2017-08-06 18:14:46 -04:00
Andrew Kelley d8d45908fa building with mingw for windows 2017-05-23 00:26: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 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 cd31f875a6 update to llvm 4.0 2017-03-10 02:29:01 -05:00
Andrew Kelley b9c943b066 tell LLVM the target sub arch type 2017-02-05 18:23:54 -05:00
Andrew Kelley cd7713b178 make --target-os freestanding work 2017-02-02 23:14:08 -05:00
Andrew Kelley 3239b3cb69 use size_t for indexes
protect against incorrect copies in debug mode
2016-09-19 11:54:01 -04:00
Andrew Kelley 4e7effd3d3 port to llvm 3.9 2016-09-04 18:30:40 -07:00
Andrew Kelley ed50bd1b65 progress toward stack trace printing 2016-08-17 20:11:04 -07:00
Andrew Kelley 76e1541803 update to llvm 3.8.0 2016-03-08 18:56:14 -07:00
Andrew Kelley 58c13aa949 rename 'environ' to 'env_type'
environ appears to clash with another symbol in mingw land
2016-02-16 20:03:41 -07:00
Andrew Kelley c6bf9c6942 MacOS has the same int sizes as Linux
Source: https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/64bitPorting/transition/transition.html
2016-02-15 16:26:33 -07:00
Andrew Kelley fe95a227c8 add windows C int sizes 2016-02-13 16:29:30 -07:00
Andrew Kelley 4e3f6de027 c integer size takes into account architecture and OS 2016-02-12 12:07:11 -07:00
Andrew Kelley 2dc4ac0e21 add @compile_var("os") and @compile_var("arch") 2016-02-11 18:33:04 -07:00
Andrew Kelley 2bf6c28bc3 ability to cross compile
hello_libc.zig can produce a windows build
2016-02-11 01:33:27 -07:00
Andrew Kelley 54a8b6a110 cleanup target data organization 2016-02-10 16:58:15 -07:00
Andrew Kelley 1ff2edf67e add "targets" command to list architectures, oses, abis 2016-02-10 15:41:50 -07:00