A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/ziglang/zig/commit/caddbbc315e834241c6ae7e22434b574c589e5fc below:

avoid compiling self-hosted twice · ziglang/zig@caddbbc · GitHub

File tree Expand file treeCollapse file tree 5 files changed

+20

-10

lines changed

Filter options

Expand file treeCollapse file tree 5 files changed

+20

-10

lines changed Original file line number Diff line number Diff line change

@@ -1045,7 +1045,7 @@ elseif(MINGW)

1045 1045

target_link_libraries(zig2 ntdll)

1046 1046

endif()

1047 1047 1048 -

set(ZIG_BUILD_ARGS "build"

1048 +

set(ZIG_BUILD_ARGS

1049 1049

--zig-lib-dir "${CMAKE_SOURCE_DIR}/lib"

1050 1050

"-Dconfig_h=${ZIG_CONFIG_H_OUT}"

1051 1051

"-Denable-llvm"

@@ -1060,7 +1060,7 @@ set(ZIG_BUILD_ARGS "build"

1060 1060

)

1061 1061 1062 1062

add_custom_target(stage3 ALL

1063 -

COMMAND zig2 ${ZIG_BUILD_ARGS}

1063 +

COMMAND zig2 build compile ${ZIG_BUILD_ARGS}

1064 1064

DEPENDS zig2

1065 1065

COMMENT STATUS "Building stage3"

1066 1066

WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"

Original file line number Diff line number Diff line change

@@ -142,6 +142,10 @@ pub fn build(b: *Builder) !void {

142 142

};

143 143 144 144

const exe = b.addExecutable("zig", main_file);

145 + 146 +

const compile_step = b.step("compile", "Build the self-hosted compiler");

147 +

compile_step.dependOn(&exe.step);

148 + 145 149

exe.stack_size = stack_size;

146 150

exe.strip = strip;

147 151

exe.sanitize_thread = sanitize_thread;

Original file line number Diff line number Diff line change

@@ -1,5 +1,8 @@

1 -

set(ZIG_INSTALL_ARGS ${ZIG_BUILD_ARGS} --prefix "${CMAKE_INSTALL_PREFIX}")

2 -

execute_process(COMMAND "${ZIG_EXECUTABLE}" ${ZIG_INSTALL_ARGS} WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" RESULT_VARIABLE _result)

1 +

set(ZIG_INSTALL_ARGS build ${ZIG_BUILD_ARGS} --prefix "${CMAKE_INSTALL_PREFIX}")

2 +

execute_process(

3 +

COMMAND "${ZIG_EXECUTABLE}" ${ZIG_INSTALL_ARGS}

4 +

WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"

5 +

RESULT_VARIABLE _result)

3 6 4 7

if(_result)

5 8

message("::")

Original file line number Diff line number Diff line change

@@ -1109,11 +1109,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {

1109 1109 1110 1110

const use_stage1 = options.use_stage1 orelse false;

1111 1111 1112 -

const cache_mode = if (use_stage1 and !options.disable_lld_caching)

1113 -

CacheMode.whole

1114 -

else

1115 -

options.cache_mode;

1116 - 1117 1112

// Make a decision on whether to use LLVM or our own backend.

1118 1113

const use_llvm = build_options.have_llvm and blk: {

1119 1114

if (options.use_llvm) |explicit|

@@ -1154,6 +1149,14 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {

1154 1149

}

1155 1150

}

1156 1151 1152 +

// TODO: once we support incremental compilation for the LLVM backend via

1153 +

// saving the LLVM module into a bitcode file and restoring it, along with

1154 +

// compiler state, the second clause here can be removed so that incremental

1155 +

// cache mode is used for LLVM backend too. We need some fuzz testing before

1156 +

// that can be enabled.

1157 +

const cache_mode = if ((use_stage1 and !options.disable_lld_caching) or

1158 +

(use_llvm and !options.disable_lld_caching)) CacheMode.whole else options.cache_mode;

1159 + 1157 1160

const tsan = options.want_tsan orelse false;

1158 1161

// TSAN is implemented in C++ so it requires linking libc++.

1159 1162

const link_libcpp = options.link_libcpp or tsan;

Original file line number Diff line number Diff line change

@@ -1282,7 +1282,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node) !v

1282 1282

// linked are in the hash that namespaces the directory we are outputting to. Therefore,

1283 1283

// we must hash those now, and the resulting digest will form the "id" of the linking

1284 1284

// job we are about to perform.

1285 -

// After a successful link, we store the id in the metadata of a symlink named "id.txt" in

1285 +

// After a successful link, we store the id in the metadata of a symlink named "lld.id" in

1286 1286

// the artifact directory. So, now, we check if this symlink exists, and if it matches

1287 1287

// our digest. If so, we can skip linking. Otherwise, we proceed with invoking LLD.

1288 1288

const id_symlink_basename = "lld.id";

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4