authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-04-24 14:13:55-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-04-24 14:13:55-04:00
loged419555229a6d93eb7b08950620f86641f44d92
tree52d3131b1efcdf31bf9bcdd90e6ad1382beecb35
parente4a86d4653c5854437371e2b63006bd4a1b4c83d
signature Commit is signed but in an unrecognized format.

build libuserland in cross compilation mode

Previously libuserland was being built for the native target, which could depend on native CPU features such as AVX. The CI infrastructure is intending to create binaries that are widely compatible and do not make use of specific CPU features. There could be something to gain from enabling native CPU features sometimes, by introducing a new cmake configuration option, but since it's planned to eventually ship self-hosted rather than stage1, I don't think it really matters. closes #2348

2 files changed, 2 insertions(+), 0 deletions(-)

CMakeLists.txt+1
...@@ -6701,6 +6701,7 @@ add_custom_command(...@@ -6701,6 +6701,7 @@ add_custom_command(
6701 DEPENDS6701 DEPENDS
6702 "${CMAKE_SOURCE_DIR}/src-self-hosted/stage1.zig"6702 "${CMAKE_SOURCE_DIR}/src-self-hosted/stage1.zig"
6703 "${CMAKE_SOURCE_DIR}/src-self-hosted/translate_c.zig"6703 "${CMAKE_SOURCE_DIR}/src-self-hosted/translate_c.zig"
6704 "${CMAKE_SOURCE_DIR}/build.zig"
6704)6705)
6705add_custom_target(userland_target DEPENDS "${LIBUSERLAND}")6706add_custom_target(userland_target DEPENDS "${LIBUSERLAND}")
6706add_executable(zig "${ZIG_MAIN_SRC}")6707add_executable(zig "${ZIG_MAIN_SRC}")
build.zig+1
...@@ -389,6 +389,7 @@ fn addLibUserlandStep(b: *Builder) void {...@@ -389,6 +389,7 @@ fn addLibUserlandStep(b: *Builder) void {
389 else389 else
390 b.addStaticLibrary("userland", "src-self-hosted/stage1.zig");390 b.addStaticLibrary("userland", "src-self-hosted/stage1.zig");
391 artifact.disable_gen_h = true;391 artifact.disable_gen_h = true;
392 artifact.setTarget(builtin.arch, builtin.os, builtin.abi);
392 artifact.linkSystemLibrary("c");393 artifact.linkSystemLibrary("c");
393 const libuserland_step = b.step("libuserland", "Build the userland compiler library for use in stage1");394 const libuserland_step = b.step("libuserland", "Build the userland compiler library for use in stage1");
394 libuserland_step.dependOn(&artifact.step);395 libuserland_step.dependOn(&artifact.step);