Commit 79d50d9933

Andrew Kelley <superjoe30@gmail.com>
2018-01-05 05:43:46
appveyor: enable verbose link for self hosted compiler
1 parent f377b1e
Changed files (4)
ci/appveyor/build_script.bat
@@ -23,7 +23,7 @@ cd %ZIGBUILDDIR%
 cmake.exe .. -Thost=x64 -G"Visual Studio 14 2015 Win64" "-DCMAKE_INSTALL_PREFIX=%ZIGBUILDDIR%" "-DCMAKE_PREFIX_PATH=%ZIGPREFIXPATH%" -DCMAKE_BUILD_TYPE=Release "-DZIG_LIBC_INCLUDE_DIR=C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt" "-DZIG_LIBC_LIB_DIR=C:\Program Files (x86)\Windows Kits\10\bin\x64\ucrt" "-DZIG_LIBC_STATIC_LIB_DIR=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64" || exit /b
 msbuild /p:Configuration=Release INSTALL.vcxproj || exit /b
 
-bin\zig.exe build --build-file ..\build.zig test -Dskip-self-hosted || exit /b
+bin\zig.exe build --build-file ..\build.zig test -Dverbose-link || exit /b
 
 @echo "MSVC build succeeded, proceeding with MinGW build"
 cd %APPVEYOR_BUILD_FOLDER%
std/special/build_runner.zig
@@ -14,7 +14,7 @@ pub fn main() -> %void {
     var arg_it = os.args();
 
     // TODO use a more general purpose allocator here
-    var inc_allocator = %%std.heap.IncrementingAllocator.init(30 * 1024 * 1024);
+    var inc_allocator = %%std.heap.IncrementingAllocator.init(40 * 1024 * 1024);
     defer inc_allocator.deinit();
 
     const allocator = &inc_allocator.allocator;
std/build.zig
@@ -842,10 +842,10 @@ pub const LibExeObjStep = struct {
     lib_paths: ArrayList([]const u8),
     disable_libc: bool,
     frameworks: BufSet,
+    verbose_link: bool,
 
     // zig only stuff
     root_src: ?[]const u8,
-    verbose: bool,
     output_h_path: ?[]const u8,
     out_h_filename: []const u8,
     assembly_files: ArrayList([]const u8),
@@ -923,7 +923,7 @@ pub const LibExeObjStep = struct {
         var self = LibExeObjStep {
             .strip = false,
             .builder = builder,
-            .verbose = false,
+            .verbose_link = false,
             .build_mode = builtin.Mode.Debug,
             .static = static,
             .kind = kind,
@@ -988,7 +988,7 @@ pub const LibExeObjStep = struct {
             .linker_script = null,
 
             .root_src = undefined,
-            .verbose = undefined,
+            .verbose_link = false,
             .output_h_path = undefined,
             .out_h_filename = undefined,
             .assembly_files = undefined,
@@ -1087,8 +1087,8 @@ pub const LibExeObjStep = struct {
         %%self.source_files.append(file);
     }
 
-    pub fn setVerbose(self: &LibExeObjStep, value: bool) {
-        self.verbose = value;
+    pub fn setVerboseLink(self: &LibExeObjStep, value: bool) {
+        self.verbose_link = value;
     }
 
     pub fn setBuildMode(self: &LibExeObjStep, mode: builtin.Mode) {
@@ -1223,15 +1223,12 @@ pub const LibExeObjStep = struct {
             %%zig_args.append(builder.pathFromRoot(asm_file));
         }
 
-        if (self.verbose) {
-            %%zig_args.append("--verbose");
-        }
         if (builder.verbose_tokenize) %%zig_args.append("--verbose-tokenize");
         if (builder.verbose_ast) %%zig_args.append("--verbose-ast");
         if (builder.verbose_cimport) %%zig_args.append("--verbose-cimport");
         if (builder.verbose_ir) %%zig_args.append("--verbose-ir");
         if (builder.verbose_llvm_ir) %%zig_args.append("--verbose-llvm-ir");
-        if (builder.verbose_link) %%zig_args.append("--verbose-link");
+        if (builder.verbose_link or self.verbose_link) %%zig_args.append("--verbose-link");
 
         if (self.strip) {
             %%zig_args.append("--strip");
build.zig
@@ -90,6 +90,8 @@ pub fn build(b: &Builder) {
     if (!skip_self_hosted) {
         test_step.dependOn(&exe.step);
     }
+    const verbose_link_exe = b.option(bool, "verbose-link", "Print link command for self hosted compiler") ?? false;
+    exe.setVerboseLink(verbose_link_exe);
 
     b.installArtifact(exe);
     installStdLib(b, std_files);