aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
AgeCommit message (Collapse)Author
2024-10-23fix windows buildAndrew Kelley
2024-10-23CLI: dylibs provided by path act as inferred root moduleAndrew Kelley
2024-10-23CLI: fix detection of link inputsAndrew Kelley
2024-10-23rework linker inputsAndrew Kelley
* Compilation.objects changes to Compilation.link_inputs which stores objects, archives, windows resources, shared objects, and strings intended to be put directly into the dynamic section. Order is now preserved between all of these kinds of linker inputs. If it is determined the order does not matter for a particular kind of linker input, that item should be moved to a different array. * rename system_libs to windows_libs * untangle library lookup from CLI types * when doing library lookup, instead of using access syscalls, go ahead and open the files and keep the handles around for passing to the cache system and the linker. * during library lookup and cache file hashing, use positioned reads to avoid affecting the file seek position. * library directories are opened in the CLI and converted to Directory objects, warnings emitted for those that cannot be opened.
2024-10-23introduce a CLI flag to enable .so scripts; default offAndrew Kelley
The compiler defaults this value to off so that users whose system shared libraries are all ELF files don't have to pay the cost of checking every file to find out if it is a text file instead. When a GNU ld script is encountered, the error message instructs users about the CLI flag that will immediately solve their problem.
2024-10-23move ld script processing to the frontendAndrew Kelley
along with the relevant logic, making the libraries within subject to the same search criteria as all the other libraries. this unfortunately means doing file system access on all .so files when targeting ELF to determine if they are linker scripts, however, I have a plan to address this.
2024-10-16std.Target: Move isLib{C,Cxx}LibName() to std.zig.target.Alex Rønne Petersen
These are really answering questions about the Zig compiler's capacity to provide a libc/libc++ implementation. As such, std.zig.target seems like a more fitting place for these.
2024-10-16std.Target: Rename is_lib{c,cxx}_lib_name() to isLib{C,Cxx}LibName().Alex Rønne Petersen
2024-10-16incremental: introduce `file` dependencies to handle AstGen failuresmlugg
The re-analysis here is a little coarse; it'd be nice in the future to have a way for an AstGen failure to preserve *all* analysis which depends on the last success, and just hide the compile errors which depend on it somehow. But I'm not sure how we'd achieve that, so this works fine for now. Resolves: #21223
2024-10-16std.Target: Change Cpu.baseline() to also be able to take OS into consideration.Alex Rønne Petersen
2024-10-10link: fix false positive crtbegin/crtend detectionAndrew Kelley
Embrace the Path abstraction, doing more operations based on directory handles rather than absolute file paths. Most of the diff noise here comes from this one. Fix sorting of crtbegin/crtend atoms. Previously it would look at all path components for those strings. Make the C runtime path detection partially a pure function, and move some logic to glibc.zig where it belongs.
2024-10-09zig fetch: update saved dependency with resolved URLIan Johnson
Closes #21645
2024-10-03Merge pull request #21570 from alexrp/windows-itaniumAlex Rønne Petersen
Initial port work for `*-windows-itanium` support.
2024-10-02handle -x language flag without spacesxdBronch
2024-09-28Initial port work for `*-windows-itanium` support.Alex Rønne Petersen
https://llvm.org/docs/HowToBuildWindowsItaniumPrograms.html This is a weird middle ground between `*-windows-gnu` and `*-windows-msvc`. It uses the C++ ABI of the former while using the system libraries of the latter.
2024-09-26update crash report to the new panic interfaceAndrew Kelley
2024-09-26remove formatted panicsAndrew Kelley
implements #17969
2024-09-24fetch: fix mutating unrelated fields when saving (#19816)Krzysztof Wolicki
closes #19725
2024-09-17cc: Add support for -Wp,Maciej 'vesim' Kuliński
2024-09-12Replace deprecated default initializations with decl literalsLinus Groh
2024-09-09zig cc: Support `-rtlib=none` for disabling compiler-rt.Alex Rønne Petersen
2024-08-28std: update `std.builtin.Type` fields to follow naming conventionsmlugg
The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
2024-08-21translate-c: populate file system inputs on errormlugg
Resolves: #20648
2024-08-19replace Compilation.Emit with std.Build.Cache.PathRobin Voetter
This type is exactly the same as std.Build.Cache.Path, except for one function which is not used anymore. Therefore we can replace it without consequences.
2024-08-19fix various issues related to Path handling in the compiler and stdRobin Voetter
A compilation build step for which the binary is not required could not be compiled previously. There were 2 issues that caused this: - The compiler communicated only the results of the emitted binary and did not properly communicate the result if the binary was not emitted. This is fixed by communicating the final hash of the artifact path (the hash of the corresponding /o/<hash> directory) and communicating this instead of the entire path. This changes the zig build --listen protocol to communicate hashes instead of paths, and emit_bin_path is accordingly renamed to emit_digest. - There was an error related to the default llvm object path when CacheUse.Whole was selected. I'm not really sure why this didn't manifest when the binary is also emitted. This was fixed by improving the path handling related to flush() and emitLlvmObject(). In general, this commit also improves some of the path handling throughout the compiler and standard library.
2024-08-17compiler: use incremental cache mode with -fincrementalmlugg
This results in correct reporting to the build system of file system inputs with `-fincremental --watch` on a `fno-emit-bin` build.
2024-08-08Compilation: Mark .c++ files as having C++ extensionsin-ack
Some projects, such as Cap'n Proto, use .c++ as their filenames. Without this, compiling them fails because zig c++ will fall back to using the linker.
2024-08-07Merge pull request #20512 from aikawayataro/add-v-linker-argAndrew Kelley
zig ld: handle -v linker arg
2024-08-02main: Give a more helpful message when we have a minimum glibc version.Alex Rønne Petersen
2024-07-28link: Accept `-Brepro` linker option and pass it to LLD.Alex Rønne Petersen
Enable it by default when building Zig code in release modes. Contributes to #9432.
2024-07-26remove deprecated --mod CLI now that a zig1.wasm update happenedAndrew Kelley
2024-07-25main: Don't pass `--seed` for `zig run`.Alex Rønne Petersen
2024-07-25add --debug-rt CLI arg to the compiler + bonus editsAndrew Kelley
The flag makes compiler_rt and libfuzzer be in debug mode. Also: * fuzzer: override debug logs and disable debug logs for frequently called functions * std.Build.Fuzz: fix bug of rerunning the old unit test binary * report errors from rebuilding the unit tests better * link.Elf: additionally add tsan lib and fuzzer lib to the hash
2024-07-25Merge pull request #20783 from ziglang/cache-fixAndrew Kelley
build compiler_rt and fuzzer in parallel; fix false positive cache hits
2024-07-25main: avoid sending an empty file system inputs messageJacob Young
When all compiler inputs are invalid paths, there could be errors yet no valid file system inputs. Closes #20713
2024-07-24CLI: better error message when build runner cannot be spawnedAndrew Kelley
2024-07-23default "trace pc guard" coverage offAndrew Kelley
* Add -f(no-)sanitize-coverage-trace-pc-guard CLI flag which defaults to off. This value lowers to TracePCGuard = true (LLVM backend) and -Xclang -fsanitize-coverage-trace-pc-guard. These settings are not automatically included with -ffuzz. * Add `Build.Step.Compile` flag for sanitize_coverage_trace_pc_guard with appropriate documentation. * Add `zig cc` integration for the respective flags. * Avoid crashing in ELF linker code when -ffuzz -femit-llvm-ir used together.
2024-07-23add std.testing.random_seedAndrew Kelley
closes #17609
2024-07-23Merge pull request #20725 from ziglang/fuzzAndrew Kelley
initial support for integrated fuzzing
2024-07-23zig ld: handle -V linker argAikawa Yataro
The "-V' argument lists the supported emulations. While linker emulation is not implemented, it's beneficial to warn user regarding this.
2024-07-22initial support for integrated fuzzingAndrew Kelley
* Add the `-ffuzz` and `-fno-fuzz` CLI arguments. * Detect fuzz testing flags from zig cc. * Set the correct clang flags when fuzz testing is requested. It can be combined with TSAN and UBSAN. * Compilation: build fuzzer library when needed which is currently an empty zig file. * Add optforfuzzing to every function in the llvm backend for modules that have requested fuzzing. * In ZigLLVMTargetMachineEmitToFile, add the optimization passes for sanitizer coverage. * std.mem.eql uses a naive implementation optimized for fuzzing when builtin.fuzz is true. Tracked by #20702
2024-07-22add more tracy hooksJakub Konka
2024-07-20add std.fmt.hexAndrew Kelley
converts an unsigned integer into an array
2024-07-19dev: introduce dev environments that enable compiler feature setsJacob Young
2024-07-16Merge pull request #20632 from jacobly0/codegen-threadJacob Young
InternPool: enable separate codegen/linking thread
2024-07-16InternPool: reduce max tid width by one bitJacob Young
@mlugg keeps stealing my bits!
2024-07-15frontend server: serveUpdateResults fixAndrew Kelley
Serve empty error bundle to indicate the update is done. Otherwise the build system, when using -fno-emit-bin, fails to detect the update is done.
2024-07-14frontend: add -fincremental, -fno-incremental flagAndrew Kelley
Remove --debug-incremental This flag is also added to the build system. Importantly, this tells Compile step whether or not to keep the compiler running between rebuilds. It defaults off because it is currently crashing zirUpdateRefs.
2024-07-13Merge pull request #20620 from kcbanner/fixup_msvc_bootstrapAndrew Kelley
Fixes for bootrapping with MSVC
2024-07-13Fix handling of `--save-exact=name` in fetchKrzysztof Wolicki