Commit Graph

5493 Commits (1547692d188ddc0c6f2dfbe4a1f943b380717306)

Author SHA1 Message Date
emekoi 1547692d18 fixed static linking on mingw-w64 2019-07-13 20:05:13 -04:00
Andrew Kelley 9c39d5720f
ir: add an assertion in phi analysis 2019-07-13 18:38:52 -04:00
Andrew Kelley c0489abcdb
translate-c: fix incorrectly translated double function pointer
closes #2887
2019-07-13 12:38:10 -04:00
emekoi bdfb31420a fixed compilation on mingw-w64 2019-07-12 19:40:51 -04:00
Andrew Kelley 107e57484f
Merge pull request #2868 from ziglang/windows-libc
provide a libc for windows using mingw-w64
2019-07-12 18:12:27 -04:00
Andrew Kelley 39b850c6cf
mingw libc: delete dead linker code regarding using system libc 2019-07-12 18:10:53 -04:00
Andrew Kelley 3621d54e57
handle mingw libc defs better
also zig build handles --verbose and linkSystemLibrary better
2019-07-12 17:25:25 -04:00
Andrew Kelley 5a62ab3ef1
fix build.zig 2019-07-12 16:14:54 -04:00
Andrew Kelley 2f8983e2f6
update zig build system for mingw static lib conventions 2019-07-12 15:10:32 -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 4e58855a4a
translate-c: better detection of pointer to struct demoted to opaque 2019-07-12 12:11:26 -04:00
daurnimator 52f0300505 std: add new linux 5.2 constants 2019-07-12 11:52:32 -04:00
thomas 02b1aea291 fix typo in help text for bundle-compiler-rt 2019-07-12 10:23:39 -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
Michael Dusan 1766bd8a08 doc clarify struct size and ABI-alignment 2019-07-11 20:36:30 -04:00
Andrew Kelley c7a976972f
funding: I've been accepted into the GitHub Sponsors program 2019-07-11 13:00:39 -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 e0670557b4 fix windows not able to build mingw 2019-07-10 20:20:53 -04:00
Andrew Kelley 3714d524c3
add some more windows defs 2019-07-10 19:40:46 -04:00
Andrew Kelley 2bb93784c6
mingw: build and link mingwex.lib
zig can now cross compile hello.c targeting windows
2019-07-10 17:41:34 -04:00
Andrew Kelley 67f3bc9101
mingw: building and linking msvcrt-os.lib 2019-07-10 16:19:51 -04:00
Andrew Kelley ea90a3a9a1
mingw: building and linking mingw32.lib 2019-07-10 14:13:00 -04:00
Andrew Kelley 1c7f21852f
ship with mingw-w64 v6.0.0
See #514
2019-07-09 23:34:16 -04:00
Andrew Kelley ae2345b742
zig build: add standardTargetOptions and deprecate setTarget
in favor of setTheTarget
2019-07-09 13:31:42 -04:00
Andrew Kelley 038946288c
Revert "fixed path with spaces in llvm-config (#2854)"
This reverts commit d23798a296.

This caused build problems for several people.
2019-07-09 13:31:13 -04:00
Ian Lilley d23798a296 fixed path with spaces in llvm-config (#2854)
* fixed path with spaces in llvm-config
2019-07-09 11:48:25 -04:00
Andrew Kelley eebb00193d
zig build: install .pdb files along with binaries
closes #2848
2019-07-08 18:48:03 -04:00
Andrew Kelley 1d2fc446bd
cap getdents length argument to INT_MAX
the linux syscall treats this argument as having type int, so passing
extremely long buffer sizes would be misinterpreted by the kernel.
since "short reads" are always acceptable, just cap it down.

patch based on musl commit 3d178a7e2b75066593fbd5705742c5808395d90d
2019-07-08 17:52:28 -04:00
Andrew Kelley fc9e28ea37
std.os.getrandom does a libc version check
closes #397
2019-07-08 14:42:28 -04:00
Andrew Kelley 4953e84902
Merge pull request #2847 from ziglang/glibc-abi-versioning
support glibc version as part of the target
2019-07-08 13:51:48 -04:00
Andrew Kelley 201033d83b
avoid dependency on linux/limits.h header
it was causing a problem on the CI
2019-07-08 11:38:14 -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 56d8185650
expose glibc version in builtin 2019-07-07 17:56:43 -04:00
Andrew Kelley 3e36cad1c1
remove debug log 2019-07-07 17:56:43 -04:00
Andrew Kelley 336ddb8011
add -target-glibc to cli help and zig build 2019-07-07 17:56:43 -04:00
Andrew Kelley 7ccf7807b3
ability to target any glibc version 2019-07-07 17:56:08 -04:00
Andrew Kelley 3b97940fb3
add an update_glibc tool, delete dummy libc files
This is the beginning of supporting minimum GLIBC version as part of the
target. See #2509 for the motivation.

The dummy libc zig files are removed. A future commit will build them
on-the-fly, using the generated text files generated by the new tool,
which are checked into source control and distributed along with zig.

These generated text files are, together, 142KB (20KB gzipped).
Compare that to a naive bundling of the .abilist files, which would be
2.2MiB (375KB gzipped).

This is based on glibc 2.29.
2019-07-07 17:56:07 -04:00
Andrew Kelley d39dcd6d9d
zig build: add setLibCFile API 2019-07-07 11:31:07 -04:00
Andrew Kelley 38ba412729
Merge pull request #2837 from daurnimator/linux-AT_
std: improvements to linux constants
2019-07-07 09:53:05 -04:00
Andrew Kelley e12eb5e7f6
Merge pull request #2835 from hryx/de-keyword-anyerror
Make anyerror not a keyword
2019-07-07 09:44:48 -04:00
daurnimator 111e5ed0a2
std: MAP_FAILED is a libc concept on linux 2019-07-07 17:15:30 +10:00
daurnimator e197968734
std: Make linux MAP_ definitions match kernel 2019-07-07 14:31:27 +10:00
daurnimator 7610d39413
std: Linux AT_ constants are the same across architectures 2019-07-07 14:11:43 +10:00
hryx 28b59a0be7
Remove reference to Keyword_anyerror in docgen 2019-07-06 18:19:04 -07:00
hryx cce11a724c
Make anyerror not a keyword 2019-07-06 15:57:32 -07:00
SamTebbs33 b118806c69 Add implicit cast for *[N]T to [*c]T 2019-07-06 17:02:17 -04:00
Andrew Kelley 21c60922e3
Merge pull request #2823 from hryx/unicode-escape
Unicode escapes: support u{N...}
2019-07-06 13:14:43 -04:00
hryx 7f618184ad Prevent unreachable when file ends with struct field 2019-07-06 13:09:07 -04:00
Andrew Kelley 9471f16c79
zig fmt ignores "zig fmt: off" directive for whitespace fixes 2019-07-05 15:09:22 -04:00