aboutsummaryrefslogtreecommitdiff
path: root/src/config.zig.in
AgeCommit message (Collapse)Author
2022-12-06redo CMakeLists.txt to use WASI interpreterAndrew Kelley
current status is that it hits error: OutOfMemory for unknown reasons, probably due to bugs in the C WASI interpreter port.
2022-11-10cmake: Mark <root>/.git/HEAD as a configure dependencyCody Tapscott
This ensures that the Zig version will be re-computed when jumping through the source tree, which is especially important if bisecting across AstGen- or other changes that must not use the old cache.
2022-10-23build: add `-Donly-c` optionAndrew Kelley
This option can be used to produce a C backend build of the self-hosted compiler, which only has the C backend enabled. Once the C backend is capable of self-hosting, this will be a way for us to replace our stage1 codebase with a C backend build of self-hosted, which we can then use for bootstrapping. See #5246 for more details. Using this option right now results in a crash because the C backend is not yet passing all the behavior tests.
2022-08-19make self-hosted the default compilerAndrew Kelley
stage1 is available behind the -fstage1 flag. closes #89
2022-08-19build: remove the option to omit stage2Andrew Kelley
2022-07-03update build scripts to LLD and LLVM 14 librariesAndrew Kelley
2022-06-09stage2: use std.debug.Trace only when explicitly enabledAndrew Kelley
Because it bumps up the stack space requirements, which is making a test case fail on aarch64 drone CI.
2021-10-22macho: dump linker's state as JSONJakub Konka
Each element of the output JSON has the VM address of the generated binary nondecreasing (some elements might occupy the same VM address for example the atom and the relocation might coincide in the address space). The generated JSON can be inspected manually or via a preview tool `zig-snapshots` that I am currently working on and will allow the user to inspect interactively the state of the linker together with the positioning of sections, symbols, atoms and relocations within each snapshot state, and in the future, between snapshots too. This should allow for quicker debugging of the linker which is nontrivial when run in the incremental mode. Note that the state will only be dumped if the compiler is built with `-Dlink-snapshot` flag on, and then the compiler is passed `--debug-link-snapshot` flag upon compiling a source/project.
2021-08-31stage2: update LLVM backend to for LLVM 13Andrew Kelley
There was some new code in master branch enumerating all the targets and a new target was added so we needed to add the glue code. This commit also introduces some build options to support experimental LLVM targets.
2021-06-14add ast-check flag to zig fmt, fix found bugsVeikka Tuominen
2021-03-21stage1: add cmake flag for enabling loggingJakub Konka
Now that we ship our own linker for MachO by default in both stage1 and stage2, we need a way to enable logs for verbose debugging. This commit adds `ZIG_ENABLE_LOGGING` cmake option which is equivalent to stage2's `-Dlog` flag. To enable it when building stage1 with cmake, add: ``` cmake .. -DZIG_ENABLE_LOGGING=on ```
2021-01-19stage2: -Dlog enables all logging, log scopes can be set at runtimeAndrew Kelley
Previously you had to recompile if you wanted to change the log scopes that get printed. Now, log scopes can be set at runtime, and -Dlog controls whether all logging is available at runtime. Purpose here is a nicer development experience. Most likely stage2 developers will always want -Dlog enabled and then pass --debug-log scopes when debugging particular issues.
2021-01-04ci: omit stage2 backend from stage1 on WindowsAndrew Kelley
to avoid out-of-memory on the CI runs.
2021-01-02stage2: implement function call inlining in the frontendAndrew Kelley
* remove the -Ddump-zir thing. that's handled through --verbose-ir * rework Fn to have an is_inline flag without requiring any more memory on the heap per function. * implement a rough first version of dumping typed zir (tzir) which is a lot more helpful for debugging than what we had before. We don't have a way to parse it though. * keep track of whether the inline-ness of a function changes because if it does we have to go update callsites. * add compile error for inline and export used together. inline function calls and comptime function calls are implemented the same way. A block instruction is set up to capture the result, and then a scope is set up that has a flag for is_comptime and some state if the scope is being inlined. when analyzing `ret` instructions, zig looks for inlining state in the scope, and if found, treats `ret` as a `break` instruction instead, with the target block being the one set up at the inline callsite. Follow-up items: * Complete out the debug TZIR dumping code. * Don't redundantly generate ZIR for each inline/comptime function call. Instead we should add a new state enum tag to Fn. * comptime and inlining branch quotas. * Add more test cases.
2021-01-01Restore the reverted semantic versioning commitsAndrew Kelley
restore "Comply with semantic versioning pre-release format" restore "stage2: SemVer compliance for development builds" restore "Remove 'g' prefix from commit hash in Zig semver" This reverts commit d96d8639e592b4bb4b2e330c4bd7412256b297d2. This reverts commit e8810f579406673edad0c9780c9d990f3034717a. This reverts commit 9afe5859a3e428b259a306c36a860e4d82dbb4bb.
2020-12-31Revert "stage2: SemVer compliance for development builds"Andrew Kelley
This reverts commit 4af763d401b48f7186650335c8e42e8fe29751bf.
2020-12-29stage2: SemVer compliance for development buildsJay Petacat
This matches the behavior of CMake builds. These changes should have been in PR #6509, but were missed.
2020-12-07restore the option to build with cmakeAndrew Kelley
restore cmake to be capable of figuring out the zig version restore config.h and config.zig. config.h is used to detect whether we should propagate cmake configuration information to build.zig; however it can be overridden with -Dstatic-llvm. fix not passing -DZIG_LINK_MODE with zig build. when using the cmake build path, build.zig no longer tries to call llvm-config. Instead it relies 100% on the LLVM_LIBRARIES cmake variable. build.zig logic reworked and simplified.
2020-12-07ability to build stage1 using only a zig tarballAndrew Kelley
The main idea here is that there are now 2 ways to get a stage1 zig binary: * The cmake path. Requirements: cmake, system C++ compiler, system LLVM, LLD, Clang libraries, compiled by the system C++ compiler. * The zig path. Requirements: a zig installation, system LLVM, LLD, Clang libraries, compiled by the zig installation. Note that the former can be used to now take the latter path. Removed config.h.in and config.zig.in. The build.zig script no longer is coupled to the cmake script. cmake no longer tries to determine the zig version. A build with cmake will yield a stage1 zig binary that reports 0.0.0+zig0. This is going to get reverted. `zig build` now accepts `-Dstage1` which will build the stage1 compiler, and put the stage2 backend behind a feature flag. build.zig is simplified to only support the use case of enabling LLVM support when the LLVM, LLD, and Clang libraries were built by zig. This part is probably sadly going to have to get reverted to make package maintainers happy. Zig build system addBuildOption supports a couple new types. The biggest reason to make this change is that the zig path is an attractive option for doing compiler development work on Windows. It allows people to work on the compiler without having MSVC installed, using only a .zip file that contains Zig + LLVM/LLD/Clang libraries.
2020-12-02stage2: wire up -Dskip-non-nativeAndrew Kelley
The purpose of this is to save time in the edit-compile-test cycle when working on stage2 code.
2020-09-17delete all stage1 c++ code not directly related to compiling stage2Andrew Kelley
Deleted 16,000+ lines of c++ code, including: * an implementation of blake hashing * the cache hash system * compiler.cpp * all the linking code, and everything having to do with building glibc, musl, and mingw-w64 * much of the stage1 compiler internals got slimmed down since it now assumes it is always outputting an object file. More stuff: * stage1 is now built with a different strategy: we have a tiny zig0.cpp which is a slimmed down version of what stage1 main.cpp used to be. Its only purpose is to build stage2 zig code into an object file, which is then linked by the host build system (cmake) into stage1. zig0.cpp uses the same C API that stage2 now has access to, so that stage2 zig code can call into stage1 c++ code. - stage1.h is - stage2.h is - stage1.zig is the main entry point for the Zig/C++ hybrid compiler. It has the functions exported from Zig, called in C++, and bindings for the functions exported from C++, called from Zig. * removed the memory profiling instrumentation from stage1. Abandon ship! * Re-added the sections to the README about how to build stage2 and stage3. * stage2 now knows as a comptime boolean whether it is being compiled as part of stage1 or as stage2. - TODO use this flag to call into stage1 for compiling zig code. * introduce -fdll-export-fns and -fno-dll-export-fns and clarify its relationship to link_mode (static/dynamic) * implement depending on LLVM to detect native target cpu features when LLVM extensions are enabled and zig lacks CPU feature detection for that target architecture. * C importing is broken, will need some stage2 support to function again.
2020-09-09start moving `zig cc` to stage2Andrew Kelley
* build.zig: repair the ability to link against llvm, clang, and lld * move the zig cc arg parsing logic to stage2 - the preprocessor flag is still TODO - the clang arg iterator code is improved to use slices instead of raw pointers because it no longer has to deal with an extern struct. * clean up error printing with a `fatal` function and use log API for messages rather than std.debug.print * add support for more CLI options to stage2 & update usage text - hooking up most of these new options is TODO * clean up the way libc and libc++ are detected via command line options. target information is used to determine if any of the libc candidate names are chosen. * add native library directory detection * implement the ability to invoke clang from stage2 * introduce a build_options.have_llvm so we can comptime branch on whether LLVM is linked in or not.
2020-08-17simplify `zig info` and rename it to `zig env`Andrew Kelley
also add version to it