authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-09 09:33:33-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-09 09:33:33-04:00
log2482bdf22b77bdee718167da5390157cc792dced
tree9fb2cf78ae9d18d52bbbff2fb61b74161f68558d
parent19cf9bd06283d020fa013333b04504133a2e26cb
signature Commit is signed but in an unrecognized format.

release builds of stage1 have llvm ir verification

the stage2 zig code however gets compiled in release mode, and stripped.

3 files changed, 12 insertions(+), 4 deletions(-)

CMakeLists.txt+6
......@@ -590,12 +590,18 @@ if(MSVC)
590590else()
591591 set(LIBUSERLAND "${CMAKE_BINARY_DIR}/libuserland.a")
592592endif()
593if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
594 set(LIBUSERLAND_RELEASE_MODE "false")
595else()
596 set(LIBUSERLAND_RELEASE_MODE "true")
597endif()
593598add_custom_target(zig_build_libuserland ALL
594599 COMMAND zig0 build
595600 --override-std-dir std
596601 --override-lib-dir "${CMAKE_SOURCE_DIR}"
597602 libuserland install
598603 "-Doutput-dir=${CMAKE_BINARY_DIR}"
604 "-Drelease=${LIBUSERLAND_RELEASE_MODE}"
599605 "-Dlib-files-only"
600606 --prefix "${CMAKE_INSTALL_PREFIX}"
601607 DEPENDS zig0
build.zig+6-2
......@@ -63,7 +63,7 @@ pub fn build(b: *Builder) !void {
6363 try configureStage2(b, test_stage2, ctx);
6464 try configureStage2(b, exe, ctx);
6565
66 addLibUserlandStep(b);
66 addLibUserlandStep(b, mode);
6767
6868 const skip_release = b.option(bool, "skip-release", "Main test suite skips release builds") orelse false;
6969 const skip_release_small = b.option(bool, "skip-release-small", "Main test suite skips release-small builds") orelse skip_release;
......@@ -370,11 +370,15 @@ const Context = struct {
370370 llvm: LibraryDep,
371371};
372372
373fn addLibUserlandStep(b: *Builder) void {
373fn addLibUserlandStep(b: *Builder, mode: builtin.Mode) void {
374374 const artifact = b.addStaticLibrary("userland", "src-self-hosted/stage1.zig");
375375 artifact.disable_gen_h = true;
376376 artifact.bundle_compiler_rt = true;
377377 artifact.setTarget(builtin.arch, builtin.os, builtin.abi);
378 artifact.setBuildMode(mode);
379 if (mode != .Debug) {
380 artifact.strip = true;
381 }
378382 artifact.linkSystemLibrary("c");
379383 if (builtin.os == .windows) {
380384 artifact.linkSystemLibrary("ntdll");
src/codegen.cpp-2
......@@ -7381,10 +7381,8 @@ static void do_code_gen(CodeGen *g) {
73817381 LLVMDumpModule(g->module);
73827382 }
73837383
7384#ifndef NDEBUG
73857384 char *error = nullptr;
73867385 LLVMVerifyModule(g->module, LLVMAbortProcessAction, &error);
7387#endif
73887386}
73897387
73907388static void zig_llvm_emit_output(CodeGen *g) {