release builds of stage1 have llvm ir verification
the stage2 zig code however gets compiled in release mode, and stripped.master
parent
19cf9bd062
commit
2482bdf22b
|
@ -590,12 +590,18 @@ if(MSVC)
|
||||||
else()
|
else()
|
||||||
set(LIBUSERLAND "${CMAKE_BINARY_DIR}/libuserland.a")
|
set(LIBUSERLAND "${CMAKE_BINARY_DIR}/libuserland.a")
|
||||||
endif()
|
endif()
|
||||||
|
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||||
|
set(LIBUSERLAND_RELEASE_MODE "false")
|
||||||
|
else()
|
||||||
|
set(LIBUSERLAND_RELEASE_MODE "true")
|
||||||
|
endif()
|
||||||
add_custom_target(zig_build_libuserland ALL
|
add_custom_target(zig_build_libuserland ALL
|
||||||
COMMAND zig0 build
|
COMMAND zig0 build
|
||||||
--override-std-dir std
|
--override-std-dir std
|
||||||
--override-lib-dir "${CMAKE_SOURCE_DIR}"
|
--override-lib-dir "${CMAKE_SOURCE_DIR}"
|
||||||
libuserland install
|
libuserland install
|
||||||
"-Doutput-dir=${CMAKE_BINARY_DIR}"
|
"-Doutput-dir=${CMAKE_BINARY_DIR}"
|
||||||
|
"-Drelease=${LIBUSERLAND_RELEASE_MODE}"
|
||||||
"-Dlib-files-only"
|
"-Dlib-files-only"
|
||||||
--prefix "${CMAKE_INSTALL_PREFIX}"
|
--prefix "${CMAKE_INSTALL_PREFIX}"
|
||||||
DEPENDS zig0
|
DEPENDS zig0
|
||||||
|
|
|
@ -63,7 +63,7 @@ pub fn build(b: *Builder) !void {
|
||||||
try configureStage2(b, test_stage2, ctx);
|
try configureStage2(b, test_stage2, ctx);
|
||||||
try configureStage2(b, exe, ctx);
|
try configureStage2(b, exe, ctx);
|
||||||
|
|
||||||
addLibUserlandStep(b);
|
addLibUserlandStep(b, mode);
|
||||||
|
|
||||||
const skip_release = b.option(bool, "skip-release", "Main test suite skips release builds") orelse false;
|
const skip_release = b.option(bool, "skip-release", "Main test suite skips release builds") orelse false;
|
||||||
const skip_release_small = b.option(bool, "skip-release-small", "Main test suite skips release-small builds") orelse skip_release;
|
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 {
|
||||||
llvm: LibraryDep,
|
llvm: LibraryDep,
|
||||||
};
|
};
|
||||||
|
|
||||||
fn addLibUserlandStep(b: *Builder) void {
|
fn addLibUserlandStep(b: *Builder, mode: builtin.Mode) void {
|
||||||
const artifact = b.addStaticLibrary("userland", "src-self-hosted/stage1.zig");
|
const artifact = b.addStaticLibrary("userland", "src-self-hosted/stage1.zig");
|
||||||
artifact.disable_gen_h = true;
|
artifact.disable_gen_h = true;
|
||||||
artifact.bundle_compiler_rt = true;
|
artifact.bundle_compiler_rt = true;
|
||||||
artifact.setTarget(builtin.arch, builtin.os, builtin.abi);
|
artifact.setTarget(builtin.arch, builtin.os, builtin.abi);
|
||||||
|
artifact.setBuildMode(mode);
|
||||||
|
if (mode != .Debug) {
|
||||||
|
artifact.strip = true;
|
||||||
|
}
|
||||||
artifact.linkSystemLibrary("c");
|
artifact.linkSystemLibrary("c");
|
||||||
if (builtin.os == .windows) {
|
if (builtin.os == .windows) {
|
||||||
artifact.linkSystemLibrary("ntdll");
|
artifact.linkSystemLibrary("ntdll");
|
||||||
|
|
|
@ -7381,10 +7381,8 @@ static void do_code_gen(CodeGen *g) {
|
||||||
LLVMDumpModule(g->module);
|
LLVMDumpModule(g->module);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NDEBUG
|
|
||||||
char *error = nullptr;
|
char *error = nullptr;
|
||||||
LLVMVerifyModule(g->module, LLVMAbortProcessAction, &error);
|
LLVMVerifyModule(g->module, LLVMAbortProcessAction, &error);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void zig_llvm_emit_output(CodeGen *g) {
|
static void zig_llvm_emit_output(CodeGen *g) {
|
||||||
|
|
Loading…
Reference in New Issue