Commit Graph

437 Commits (ab56d3e18ca7dbc430fdc2ca51fce08804cc3599)

Author SHA1 Message Date
Andrew Kelley e381a42de9
quick fix: add -mcpu=baseline support to zig0
When the build.zig logic to build libzigstage2 was converted to a cmake
command, it neglected to use baseline CPU features rather than compiling
with native features.

This adds a hard coded flag `-mcpu=baseline` which can be used to detect
the native target, but mark it as non-native so that it does not get the
CPU features specific to the host used to compile libzigstage2.

Full `-mcpu` support is happening in the upcoming pull request #4509,
and so this "quick fix" will be cleaned up in that branch, before it is
merged to master.

closes #4506
2020-02-20 17:02:29 -05:00
Andrew Kelley a26800c099
stage1: don't copy unchanged output files
when both `--cache on` and `--output-dir` parameters
are provided. This prevents re-linking `zig` with every
`make` even when `libzigstage2.a` was unchanged.
2020-02-16 21:10:03 -05:00
Andrew Kelley 20f3b0efff rename libuserland to libstage2 2020-02-16 19:16:08 -05:00
Andrew Kelley c25742010d add the dummy libc paths back in 2020-02-16 19:02:26 -05:00
Andrew Kelley 7eb0a3edce
remove libc dependency of zig0 building libstage2
Rather than `zig0 build ...` the build now does
`zig0 build-lib ...`, avoiding the requirement of linking the build
script, and thus avoiding the requirement of finding native libc,
for systems where libc is the system ABI.
2020-02-16 18:57:34 -05:00
Andrew Kelley 4b02a39aa9
self-hosted libc detection
* libc_installation.cpp is deleted.
   src-self-hosted/libc_installation.zig is now used for both stage1 and
   stage2 compilers.
 * (breaking) move `std.fs.File.access` to `std.fs.Dir.access`. The API
   now encourages use with an open directory handle.
 * Add `std.os.faccessat` and related functions.
 * Deprecate the "C" suffix naming convention for null-terminated
   parameters. "C" should be used when it is related to libc. However
   null-terminated parameters often have to do with the native system
   ABI rather than libc. "Z" suffix is the new convention. For example,
   `std.os.openC` is deprecated in favor of `std.os.openZ`.
 * Add `std.mem.dupeZ` for using an allocator to copy memory and add a
   null terminator.
 * Remove dead struct field `std.ChildProcess.llnode`.
 * Introduce `std.event.Batch`. This API allows expressing concurrency
   without forcing code to be async. It requires no Allocator and does
   not introduce any failure conditions. However it is not thread-safe.
 * There is now an ongoing experiment to transition away from
   `std.event.Group` in favor of `std.event.Batch`.
 * `std.os.execvpeC` calls `getenvZ` rather than `getenv`. This is
   slightly more efficient on most systems, and works around a
   limitation of `getenv` lack of integration with libc.
 * (breaking) `std.os.AccessError` gains `FileBusy`, `SymLinkLoop`, and
   `ReadOnlyFileSystem`. Previously these error codes were all reported
   as `PermissionDenied`.
 * Add `std.Target.isDragonFlyBSD`.
 * stage2: access to the windows_sdk functions is done with a manually
   maintained .zig binding file instead of `@cImport`.
 * Update src-self-hosted/libc_installation.zig with all the
   improvements that stage1 has seen to src/libc_installation.cpp until
   now. In addition, it now takes advantage of Batch so that evented I/O
   mode takes advantage of concurrency, but it still works in blocking
   I/O mode, which is how it is used in stage1.
2020-02-16 13:25:30 -05:00
Andrew Kelley fb6b94f80f
cmake: remove case mismatch detection on build mode
See discussion here for context:
c6df5deb34 (comments)

Michael - I appreciate what you did here, making the configure script
work better for people in practice. When it was checking the build type
against a whitelist, I think it was worth it. However, now that we are
supporting systems which use non-standard cmake build modes, I don't
think this case-mismatch detection thing is worth it. It's starting to
get to the point where it's a lot of complication for very little
benefit. Besides, cmake is not case sensitive. If we support
non-standard build modes, then we would need to support a hypothetical
build mode of `release` (lower case).

So let's just remove this and rely on people to use the build system
correctly (like they will have to do when building any cmake project
from source).
2020-02-13 20:47:44 -05:00
Michael Dusan 471662f7c9
stage1: limit cmake checks on build type
Various maintainers pass custom build types and we don't need to check
those. We are interested only in checking and diagnosing common errors
for Zig project supported types.

Check is now limited to look for case-mismatch only on the well-known
values { Debug, Release, RelWithDebInfo, MinSizeRel }.
2020-02-12 17:23:48 -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
Michael Dusan d0a9da74ef
stage1: fix cmake regression
- add `None` as a valid CMAKE_BUILD_TYPE
- this is a legitimate setting used by packagers

regression was caused by c6df5deb34
2020-02-05 08:24:50 -05:00
Michael Dusan c6df5deb34
stage1: guard against case-mismatched build types
- zig CMakeLists.txt CMAKE_BUILD_TYPE string comparisons are case-sensitive
- cmake itself is unclear about how tolerant it is for case-mismatches
- add CMAKE_BUILD_TYPE guard in CMakeLists.txt to force exact matches
2020-02-04 20:39:05 -05:00
Michael Dusan b9f4ac86ef
cmake: support `make` and `make install`
(2nd attempt to get this right)
2020-01-17 19:39:43 -05:00
Michael Dusan d53e8a5751 Revert "cmake: support `make` and `make install`"
This reverts commit cd062b08d0.
2020-01-17 14:24:54 -05:00
Michael Dusan 97cca1376a
cmake: fix install lib path message 2020-01-17 00:53:41 -05:00
Michael Dusan cd062b08d0
cmake: support `make` and `make install`
- `make` or `ninja` will not build but not install
- `make install` or `ninja install` will build __and__ install

Only for build system generator Visual Studio, specify the following
to disable installation of lib files:

    ZIG_SKIP_INSTALL_LIB_FILES=ON
2020-01-16 18:56:13 -05:00
Vexu fceda07f94
use self hosted translate-c for cimports 2019-12-29 11:04:45 +02:00
Michael Dusan fe254ea309 stage1: avoid building empty memory_profiling.cpp
During build an empty .o on macOS/Xcode emits warning:

    ranlib: file: zig_cpp/libcompiler.a(memory_profiling.cpp.o) has no symbols
    ranlib: file: zig_cpp/libcompiler.a(memory_profiling.cpp.o) has no symbols
2019-11-25 19:08:36 -05:00
emekoi cb8dacabd8 explicity linked ntdll on mingw-w64 2019-10-22 20:42:51 -04:00
Andrew Kelley 87f632b08a fs.Dir.openDir: use empty object name for "." on Windows 2019-10-21 19:19:49 -04:00
Andrew Kelley fa9f1d2396
add -DZIG_ENABLE_MEM_PROFILE option and -fmem-report flag
This can be used to find what's taking up memory in the compiler.
Here's an example of how to use it:

```
./zig test ../lib/std/std.zig --cache off -fmem-report
```

And here's the output I get for this on x86_64-linux-gnu today:

```
Const: 6462833 items, 152 bytes each, total 936.84 MiB
ConstGlobalRefs: 17236534 items, 24 bytes each, total 394.51 MiB
ResetResult: 1698108 items, 160 bytes each, total 259.11 MiB
ConstExprValue: 3118299 items, 80 bytes each, total 237.91 MiB
EndExpr: 1345395 items, 168 bytes each, total 215.56 MiB
Unknown_8: 27370821 items, 8 bytes each, total 208.82 MiB
VarPtr: 1127866 items, 168 bytes each, total 180.70 MiB
IrBasicBlock: 794834 items, 120 bytes each, total 90.96 MiB
LoadPtr: 554024 items, 160 bytes each, total 84.54 MiB
Unknown_64: 1245715 items, 64 bytes each, total 76.03 MiB
Unknown_40: 1879218 items, 40 bytes each, total 71.69 MiB
Unknown_72: 989117 items, 72 bytes each, total 67.92 MiB
Return: 423783 items, 160 bytes each, total 64.66 MiB
Unknown_168: 332480 items, 168 bytes each, total 53.27 MiB
Unknown_152: 336890 items, 152 bytes each, total 48.84 MiB
AddImplicitReturnType: 230819 items, 168 bytes each, total 36.98 MiB
Br: 217835 items, 168 bytes each, total 34.90 MiB
Unknown_184: 179529 items, 184 bytes each, total 31.50 MiB
FieldPtr: 179388 items, 184 bytes each, total 31.48 MiB
BinOp: 171004 items, 176 bytes each, total 28.70 MiB
LoadPtrGen: 173287 items, 168 bytes each, total 27.76 MiB
CondBr: 137864 items, 192 bytes each, total 25.24 MiB
Unknown_720: 30918 items, 720 bytes each, total 21.23 MiB
CallSrc: 99320 items, 216 bytes each, total 20.46 MiB
Unknown_160: 129243 items, 160 bytes each, total 19.72 MiB
Unknown_1: 19339456 items, 1 bytes each, total 18.44 MiB
CheckStatementIsVoid: 119838 items, 160 bytes each, total 18.29 MiB
Unknown_48: 371178 items, 48 bytes each, total 16.99 MiB
TestComptime: 101443 items, 160 bytes each, total 15.48 MiB
DeclVarSrc: 72578 items, 184 bytes each, total 12.74 MiB
StorePtr: 72776 items, 176 bytes each, total 12.22 MiB
ZigVar: 79201 items, 160 bytes each, total 12.09 MiB
Unknown_16: 770643 items, 16 bytes each, total 11.76 MiB
Phi: 60482 items, 184 bytes each, total 10.61 MiB
TestErrSrc: 66177 items, 168 bytes each, total 10.60 MiB
Unknown_240: 45164 items, 240 bytes each, total 10.34 MiB
ElemPtr: 58232 items, 184 bytes each, total 10.22 MiB
AllocaSrc: 60053 items, 176 bytes each, total 10.08 MiB
CallGen: 44873 items, 224 bytes each, total 9.59 MiB
SaveErrRetAddr: 63787 items, 152 bytes each, total 9.25 MiB
Unknown_112: 82283 items, 112 bytes each, total 8.79 MiB
AllocaGen: 51909 items, 176 bytes each, total 8.71 MiB
Unknown_24: 373599 items, 24 bytes each, total 8.55 MiB
ResultLocPeer: 113683 items, 72 bytes each, total 7.81 MiB
DeclRef: 36343 items, 168 bytes each, total 5.82 MiB
UnwrapErrPayload: 34603 items, 168 bytes each, total 5.54 MiB
Ref: 33414 items, 168 bytes each, total 5.35 MiB
Unknown_104: 53882 items, 104 bytes each, total 5.34 MiB
DeclVarGen: 32540 items, 168 bytes each, total 5.21 MiB
StructFieldPtr: 30449 items, 176 bytes each, total 5.11 MiB
UnwrapErrCode: 31508 items, 168 bytes each, total 5.05 MiB
Unknown_56: 90256 items, 56 bytes each, total 4.82 MiB
SpillBegin: 28722 items, 168 bytes each, total 4.60 MiB
SpillEnd: 28722 items, 160 bytes each, total 4.38 MiB
ResultLocReturn: 64573 items, 48 bytes each, total 2.96 MiB
PtrType: 14702 items, 184 bytes each, total 2.58 MiB
SliceType: 15005 items, 176 bytes each, total 2.52 MiB
Unknown_176: 13326 items, 176 bytes each, total 2.24 MiB
RefGen: 12881 items, 168 bytes each, total 2.06 MiB
UnOp: 12102 items, 176 bytes each, total 2.03 MiB
SwitchBr: 9453 items, 200 bytes each, total 1.80 MiB
TestErrGen: 11143 items, 160 bytes each, total 1.70 MiB
Unknown_32: 52359 items, 32 bytes each, total 1.60 MiB
CheckSwitchProngs: 9094 items, 184 bytes each, total 1.60 MiB
TypeOf: 9259 items, 160 bytes each, total 1.41 MiB
IntCast: 8772 items, 168 bytes each, total 1.41 MiB
OptionalUnwrapPtr: 8755 items, 168 bytes each, total 1.40 MiB
SwitchTarget: 9094 items, 160 bytes each, total 1.39 MiB
Cast: 8198 items, 176 bytes each, total 1.38 MiB
WidenOrShorten: 8448 items, 160 bytes each, total 1.29 MiB
ErrorUnion: 7613 items, 176 bytes each, total 1.28 MiB
SliceSrc: 6249 items, 192 bytes each, total 1.14 MiB
ErrWrapCode: 7133 items, 168 bytes each, total 1.14 MiB
TypeName: 7328 items, 160 bytes each, total 1.12 MiB
ImplicitCast: 5480 items, 176 bytes each, total 941.88 KiB
ResolveResult: 5638 items, 168 bytes each, total 924.98 KiB
ResultLocInstruction: 22696 items, 40 bytes each, total 886.56 KiB
BitCastSrc: 4947 items, 168 bytes each, total 811.62 KiB
CompileErr: 5148 items, 160 bytes each, total 804.38 KiB
ReturnPtr: 5305 items, 152 bytes each, total 787.46 KiB
Unreachable: 5038 items, 152 bytes each, total 747.83 KiB
TestNonNull: 4716 items, 160 bytes each, total 736.88 KiB
BitCastGen: 4431 items, 160 bytes each, total 692.34 KiB
PtrToInt: 4289 items, 160 bytes each, total 670.16 KiB
SliceGen: 3573 items, 192 bytes each, total 669.94 KiB
ArrayType: 4081 items, 168 bytes each, total 669.54 KiB
IntType: 3868 items, 168 bytes each, total 634.59 KiB
Unknown_88: 7213 items, 88 bytes each, total 619.87 KiB
Truncate: 3771 items, 168 bytes each, total 618.68 KiB
TypeInfo: 3740 items, 160 bytes each, total 584.38 KiB
SwitchVar: 3385 items, 176 bytes each, total 581.80 KiB
ContainerInitFields: 3223 items, 184 bytes each, total 579.13 KiB
ContainerInitList: 2309 items, 192 bytes each, total 432.94 KiB
PtrCastGen: 2626 items, 168 bytes each, total 430.83 KiB
BoolNot: 2457 items, 160 bytes each, total 383.91 KiB
FnProto: 2054 items, 184 bytes each, total 369.08 KiB
MergeErrSets: 1927 items, 176 bytes each, total 331.20 KiB
Unknown_136: 2486 items, 136 bytes each, total 330.17 KiB
Unknown_80: 4059 items, 80 bytes each, total 317.11 KiB
Bswap: 1670 items, 168 bytes each, total 273.98 KiB
TypeId: 1680 items, 160 bytes each, total 262.50 KiB
PtrCastSrc: 1371 items, 176 bytes each, total 235.64 KiB
ErrName: 1193 items, 160 bytes each, total 186.41 KiB
UnionTag: 1120 items, 160 bytes each, total 175.00 KiB
TagName: 1050 items, 160 bytes each, total 164.06 KiB
SizeOf: 942 items, 160 bytes each, total 147.19 KiB
MemberName: 871 items, 168 bytes each, total 142.90 KiB
Import: 881 items, 160 bytes each, total 137.66 KiB
PtrOfArrayToSlice: 758 items, 168 bytes each, total 124.36 KiB
UnionFieldPtr: 710 items, 176 bytes each, total 122.03 KiB
EnumToInt: 778 items, 160 bytes each, total 121.56 KiB
CheckRuntimeScope: 700 items, 168 bytes each, total 114.84 KiB
FieldParentPtr: 632 items, 184 bytes each, total 113.56 KiB
BoolToInt: 719 items, 160 bytes each, total 112.34 KiB
ResultLocPeerParent: 904 items, 104 bytes each, total 91.81 KiB
IntToPtr: 537 items, 168 bytes each, total 88.10 KiB
AlignOf: 561 items, 160 bytes each, total 87.66 KiB
AtomicRmw: 356 items, 208 bytes each, total 72.31 KiB
MemberCount: 441 items, 160 bytes each, total 68.91 KiB
Memset: 342 items, 176 bytes each, total 58.78 KiB
PopCount: 321 items, 168 bytes each, total 52.66 KiB
AlignCast: 251 items, 168 bytes each, total 41.18 KiB
IrInstruction *: 5230 items, 8 bytes each, total 40.86 KiB
IrBasicBlock *: 5230 items, 8 bytes each, total 40.86 KiB
TagType: 261 items, 160 bytes each, total 40.78 KiB
HasDecl: 234 items, 168 bytes each, total 38.39 KiB
OverflowOp: 191 items, 200 bytes each, total 37.30 KiB
Export: 209 items, 176 bytes each, total 35.92 KiB
SetCold: 219 items, 160 bytes each, total 34.22 KiB
ReturnAddress: 216 items, 152 bytes each, total 32.06 KiB
FromBytes: 178 items, 176 bytes each, total 30.59 KiB
SetRuntimeSafety: 188 items, 160 bytes each, total 29.38 KiB
OptionalWrap: 151 items, 168 bytes each, total 24.77 KiB
Clz: 143 items, 168 bytes each, total 23.46 KiB
ResizeSlice: 135 items, 168 bytes each, total 22.15 KiB
UnionInitNamedField: 106 items, 184 bytes each, total 19.05 KiB
Panic: 102 items, 160 bytes each, total 15.94 KiB
SwitchElseVar: 93 items, 168 bytes each, total 15.26 KiB
ToBytes: 89 items, 168 bytes each, total 14.60 KiB
IntToFloat: 78 items, 168 bytes each, total 12.80 KiB
Unknown_4360: 3 items, 4360 bytes each, total 12.77 KiB
ErrWrapPayload: 72 items, 168 bytes each, total 11.81 KiB
FloatOp: 62 items, 176 bytes each, total 10.66 KiB
FloatToInt: 47 items, 168 bytes each, total 7.71 KiB
FloatCast: 46 items, 168 bytes each, total 7.55 KiB
ErrToInt: 47 items, 160 bytes each, total 7.34 KiB
Asm: 33 items, 216 bytes each, total 6.96 KiB
ErrSetCast: 40 items, 168 bytes each, total 6.56 KiB
Memcpy: 34 items, 176 bytes each, total 5.84 KiB
AtomicLoad: 17 items, 184 bytes each, total 3.05 KiB
AwaitSrc: 16 items, 168 bytes each, total 2.62 KiB
Resume: 14 items, 160 bytes each, total 2.19 KiB
AwaitGen: 12 items, 176 bytes each, total 2.06 KiB
ArgType: 12 items, 168 bytes each, total 1.97 KiB
AnyFrameType: 12 items, 160 bytes each, total 1.88 KiB
SuspendFinish: 10 items, 160 bytes each, total 1.56 KiB
SuspendBegin: 10 items, 160 bytes each, total 1.56 KiB
Ctz: 9 items, 168 bytes each, total 1.48 KiB
FrameHandle: 8 items, 152 bytes each, total 1.19 KiB
SetEvalBranchQuota: 7 items, 160 bytes each, total 1.09 KiB
AssertZero: 7 items, 160 bytes each, total 1.09 KiB
UndeclaredIdent: 7 items, 160 bytes each, total 1.09 KiB
CmpxchgSrc: 5 items, 216 bytes each, total 1.05 KiB
CmpxchgGen: 5 items, 200 bytes each, total 1000.00 bytes
IntToEnum: 4 items, 168 bytes each, total 672.00 bytes
VectorType: 4 items, 168 bytes each, total 672.00 bytes
ErrorReturnTrace: 2 items, 160 bytes each, total 320.00 bytes
Breakpoint: 2 items, 152 bytes each, total 304.00 bytes
FrameAddress: 2 items, 152 bytes each, total 304.00 bytes
Unknown_4: 61 items, 4 bytes each, total 244.00 bytes
VectorToArray: 1 items, 168 bytes each, total 168.00 bytes
SetAlignStack: 1 items, 160 bytes each, total 160.00 bytes
Unknown_12: 2 items, 12 bytes each, total 24.00 bytes
ErrorTableEntry *: 0 items, 8 bytes each, total 0.00 bytes
AstNode *: 0 items, 8 bytes each, total 0.00 bytes
Total bytes used: 3.51 GiB
```

You can see that most of the memory is taken up by IR instructions,
as well as comptime values. This points toward 2 changes which will
greatly reduce memory usage:

 * Rework semantic analysis so that IR instructions can be freed.
   Currently the comptime value struct (ConstExprValue) is embedded
   directly into the IrInstruction struct. If this is made to be
   separate, at the very least pass 1 IR instructions can be freed.
   This includes `Const` which is the largest usage of memory currently.

 * Rework the ConstExprValue struct to no longer be a tagged union.
   For example, there's no need for an integer comptime value to be
   80 bytes.

From this you can also see that this eliminates some things from being
the culprit. Before doing this analysis, I considered whether doing
string interning would help. From the above output, you can see that all
strings in the compiler account for only 18 MiB, so string interning
would have been a dead end.
2019-10-19 03:23:23 -04:00
Sahnvour 5b51f41cee
stage1: override cmake's default compilation flags to statically link the CRT on windows
we want to use /MT instead of /MD for a fully static executable
2019-10-16 19:04:50 -04:00
Andrew Kelley 59ac7b91da
add -fdump-analysis to dump type information to json
This commit adds -fdump-analysis which creates
a `$NAME-analysis.json` file with all of the finished
semantic analysis that the stage1 compiler produced.
It contains types, packages, declarations, and files.

This is an initial implementation; some data will be
missing. However it's easy to improve the implementation,
which is in `src/dump_analysis.cpp`.

The next step for #21 will be to create Zig code which parses
this json file and creates user-facing HTML documentation.

This feature has other uses, however; for example, it could
be used for IDE integration features until the self-hosted
compiler is available.
2019-10-03 17:58:22 -04:00
Andrew Kelley 0dd8adcdb4
Release 0.5.0 2019-09-30 10:09:33 -04:00
Andrew Kelley 2f20833097
add -DZIG_SKIP_INSTALL_LIB_FILES cmake option
closes #2221
2019-09-26 02:21:29 -04:00
Andrew Kelley dc7016344e
remove --override-std-dir. fix issues caused by moving std lib 2019-09-25 23:59:07 -04:00
Andrew Kelley 185cb13278
Merge remote-tracking branch 'origin/master' into llvm9 2019-09-10 13:00:35 -04:00
Andrew Kelley 0489d06c24
make the std lib support event-based I/O
also add -fstack-report
2019-09-10 10:26:52 -04:00
Andrew Kelley 2482bdf22b
release builds of stage1 have llvm ir verification
the stage2 zig code however gets compiled in release mode,
and stripped.
2019-09-09 09:33:33 -04:00
Sahnvour 19cf9bd062 use /debug:fastlink when building with msvc and debug info 2019-09-09 00:26:39 -04:00
emekoi 9423d382fb fixed compiler error for gcc 9.2.0 2019-09-06 19:20:25 -04:00
Michael Dusan 00d82e34df cmake: improve building without git repository
- quiet `fatal: not a git repository` message
- if git probe fails skip ZIG_VERSION modification
2019-09-02 21:36:16 -04:00
Andrew Kelley 6529658ad8
Merge remote-tracking branch 'origin/master' into llvm9 2019-08-16 16:43:56 -04:00
Andrew Kelley 8b97a1aee2
Merge pull request #3033 from ziglang/rewrite-coroutines
rework async function semantics
2019-08-15 14:01:01 -07:00
Andrew Kelley 729807203a
force static libs for vendored dependencies 2019-08-15 14:34:52 -04:00
Andrew Kelley ffab950e0c
update embedded LLD to 9.0.0rc1 2019-08-03 12:56:35 -04:00
Andrew Kelley b3b6a98451
Merge remote-tracking branch 'origin/master' into rewrite-coroutines 2019-08-02 16:31:43 -04:00
emekoi 357fb4f143 avoid passing -static to msvc when static linking 2019-07-27 17:54:20 -05:00
emekoi 5593c63e12 improved CMake file for MinGW 2019-07-26 16:26:01 -05:00
Andrew Kelley 72e983670e
simple async function call working 2019-07-21 16:21:16 -04:00
daurnimator 3a67c13b5d cmake: allow user to select static vs dynamic LLVM 2019-07-16 12:33:13 -04:00
Andrew Kelley 0cd660462f
move install_files.h to not be generated code 2019-07-15 01:47:26 -04:00
Andrew Kelley 40a562f26d
cmake: fix incorrect dependencies 2019-07-15 01:45:26 -04:00
Andrew Kelley 6096dc5f94
move some of the installation from cmake to zig build
This moves the installation of shipped source files from large
CMakeLists.txt lists to zig build recursive directory installation.

On my computer a cmake `make install` takes 2.4 seconds even when it has
to do nothing, and prints a lot of unnecessary lines to stdout that say
"up-to-date: [some file it is installing]".

After this commit, the default output of `make` is down to 1
second, and it does not print any junk to stdout. Further, a `make
install` is no longer required and `make` is sufficient.

This closes #2874.

It also closes #2585. `make` now always invokes `zig build` for
installing files and libuserland.a, and zig's own caching system makes
that go fast.
2019-07-15 01:45:26 -04:00
Andrew Kelley 7d9ee5d6d5
Merge pull request #2882 from andersfr/hash-branch
Implementation of MurmurHash and CityHash
2019-07-13 20:08:18 -04:00
emekoi 1547692d18 fixed static linking on mingw-w64 2019-07-13 20:05:13 -04:00
andersfr 69129c2e93 Intentional wraparound used + 2019-07-13 13:59:15 +02:00
emekoi bdfb31420a fixed compilation on mingw-w64 2019-07-12 19:40:51 -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