aboutsummaryrefslogtreecommitdiff
path: root/tools/update_clang_options.zig
AgeCommit message (Collapse)Author
2025-10-30std.debug.lockStderrWriter: also return ttyconfMatthew Lugg
`std.Io.tty.Config.detect` may be an expensive check (e.g. involving syscalls), and doing it every time we need to print isn't really necessary; under normal usage, we can compute the value once and cache it for the whole program's execution. Since anyone outputting to stderr may reasonably want this information (in fact they are very likely to), it makes sense to cache it and return it from `lockStderrWriter`. Call sites who do not need it will experience no significant overhead, and can just ignore the TTY config with a `const w, _` destructure.
2025-08-30update tools and other miscellaneous things to new APIsAndrew Kelley
2025-08-11std.ArrayList: make unmanaged the defaultAndrew Kelley
2025-07-16tools: fix some bitrotAlex Rønne Petersen
2025-07-07update standalone and incremental tests to new APIAndrew Kelley
2025-04-26compiler: Allow configuring UBSan mode at the module level.Alex Rønne Petersen
* Accept -fsanitize-c=trap|full in addition to the existing form. * Accept -f(no-)sanitize-trap=undefined in zig cc. * Change type of std.Build.Module.sanitize_c to std.zig.SanitizeC. * Add some missing Compilation.Config fields to the cache. Closes #23216.
2025-04-14zig cc: Respect Clang's -static and -dynamic flags.Alex Rønne Petersen
Before: ❯ zig cc main.c -target x86_64-linux-musl && musl-ldd ./a.out musl-ldd: ./a.out: Not a valid dynamic program ❯ zig cc main.c -target x86_64-linux-musl -static && musl-ldd ./a.out musl-ldd: ./a.out: Not a valid dynamic program ❯ zig cc main.c -target x86_64-linux-musl -dynamic && musl-ldd ./a.out musl-ldd: ./a.out: Not a valid dynamic program After: ❯ zig cc main.c -target x86_64-linux-musl && musl-ldd ./a.out musl-ldd: ./a.out: Not a valid dynamic program ❯ zig cc main.c -target x86_64-linux-musl -static && musl-ldd ./a.out musl-ldd: ./a.out: Not a valid dynamic program ❯ zig cc main.c -target x86_64-linux-musl -dynamic && musl-ldd ./a.out /lib/ld-musl-x86_64.so.1 (0x72c10019e000) libc.so => /lib/ld-musl-x86_64.so.1 (0x72c10019e000) Closes #11909.
2025-04-04compiler: Recognize -fno-sanitize=<...> in addition to -fsanitize=<...>.Alex Rønne Petersen
2025-02-22zig build fmtAndrew Kelley
2024-12-11compiler: Improve the handling of unwind table levels.Alex Rønne Petersen
The goal here is to support both levels of unwind tables (sync and async) in zig cc and zig build. Previously, the LLVM backend always used async tables while zig cc was partially influenced by whatever was Clang's default.
2024-11-02std.Target: Rename amdgpu module to amdgcn.Alex Rønne Petersen
This was an inconsistency left over from c825b567b26c475e058e074e5d22af006854fab6.
2024-09-17cc: Add support for -Wp,Maciej 'vesim' Kuliński
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-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-05-26std: restructure child process namespaceAndrew Kelley
2024-05-08zig cc: update clang CLI data to LLVM 18Andrew Kelley
release/18.x branch, commit 78b99c73ee4b96fe9ce0e294d4632326afb2db42
2024-03-27mingw: support -municodeElaine Gibson
2024-02-02cli+build: handle -ObjC flag and route it to MachO linkerJakub Konka
2023-10-22child_process + Build: rename exec to run + all related codeJan Philipp Hafer
Justification: exec, execv etc are unix concepts and portable version should be called differently. Do no touch non-Zig code. Adjust error names as well, if associated. Closes #5853.
2023-10-04comp: add support for -fdata-sectionsJakub Konka
2023-06-24all: migrate code to new cast builtin syntaxmlugg
Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change
2023-06-19all: zig fmt and rename "@XToY" to "@YFromX"Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-19std: Support user-provided jsonParse method. Unify json.Parser and ↵Josh Wolfe
json.parse* (#15705)
2023-05-23std.sort: add pdqsort and heapsortAli Chraghi
2023-05-13std: Rewrite low-level json api to support streaming (#15602)Josh Wolfe
2023-04-20fixes to the previous commitAndrew Kelley
* CompileStep: Avoid calling producesPdbFile() to determine whether the option should be respected. If the user asks for it, put it on the command line and let the Zig CLI deal with it appropriately. * Make the namespace of `std.dwarf.Format.dwarf32` no longer have a redundant "dwarf" in it. * Add `zig cc` integration for `-gdwarf32` and `-gdwarf64`. * Toss in a bonus bug fix for `-gdwarf-2`, `-gdwarf-3`, etc. * Avoid using default init values for struct fields unnecessarily. * Add missing cache hash addition for the new option.
2023-04-08zig cc: handle the -r flagAndrew Kelley
This makes -r treated the same as -c which is to output an object file. Zig's ELF linker code already handles multiple object files into an object file with the -r flag to LLD. closes #11683
2023-04-05Merge remote-tracking branch 'origin/master' into llvm16Andrew Kelley
2023-04-01link: handle -u flag in all linkersJakub Konka
Also clean up parsing of linker args - reuse `ArgsIterator`. In MachO, ensure we add every symbol marked with `-u` as undefined before proceeding with symbol resolution. Additionally, ensure those symbols are never garbage collected. MachO entry_in_dylib test: pass `-u _my_main` when linking executable so that it is not incorrectly garbage collected by the linker.
2023-02-19Merge remote-tracking branch 'origin/master' into llvm16Andrew Kelley
2023-02-18update std lib and compiler sources to new for loop syntaxAndrew Kelley
2023-01-26update clang options data to LLVM 16Andrew Kelley
2023-01-13zig run/cc: recognize "-x language"Motiejus Jakštys
This commit adds support for "-x language" for a couple of hand-picked supported languages. There is no reason the list of supported languages to not grow (e.g. add "c-header"), but I'd like to keep it small at the start. Alternative 1 ------------- I first tried to add a new type "Language", and then add that to the `CSourceFile`. But oh boy what a change it turns out to be. So I am keeping myself tied to FileExt and see what you folks think. Alternative 2 ------------- I tried adding `Language: ?[]const u8` to `CSourceFile`. However, the language/ext, whatever we want to call it, still needs to be interpreted in the main loop: one kind of handling for source files, other kind of handling for everything else. Test case --------- *standalone.c* #include <iostream> int main() { std::cout << "elho\n"; } Compile and run: $ ./zig run -x c++ -lc++ standalone.c elho $ ./zig c++ -x c++ standalone.c -o standalone && ./standalone elho Fixes #10915
2022-12-18Add missing clang opts: -install_name and -undefinedJakub Konka
2022-10-18Revert "adding `static` and `dynamic` ZigEquivalentAndrew Kelley
enums so that we can branch to set `link_mode` properly when we iterate over the clang arguments. also replaced `dynamic` flag in clang_options_data.zig with proper definition similarly to `static`." This reverts commit 6af0eeb58d1d220d407ce4c463eaeb25b35f2761. This change needs more careful consideration. It regressed zig-bootstrap due to cmake passing `-static -lkernel32` and zig failing with error.UnableToStaticLink. See https://github.com/ziglang/zig-bootstrap/issues/134
2022-10-13adding `static` and `dynamic` ZigEquivalent enums so that we can branch to ↵cod1r
set `link_mode` properly when we iterate over the clang arguments. also replaced `dynamic` flag in clang_options_data.zig with proper definition similarly to `static`.
2022-08-29Merge remote-tracking branch 'origin/master' into llvm15Andrew Kelley
2022-08-19stage2: implement stack protectorsAndrew Kelley
This is one of the final remaining TODOs for the LLVM backend.
2022-08-08cc: add support for -M flagJakub Konka
2022-08-08update update_clang_options.zig to latest formatting changesJakub Konka
2022-08-02update clang CLI options to LLVM 15Andrew Kelley
2022-07-11stage2: cleanups to --compress-debug-sectionsAndrew Kelley
* make the setting in the linker backend be non-optional; by this time all defaults are supposed to be resolved. * integrate with `zig cc` * change the CLI parsing to match C compiler parsing, allowing `--compress-debug-sections` alone to choose a default encoding of zlib.
2022-07-05CLI: add support for -fno-builtinAndrew Kelley
2022-07-03clang: parse --verbose flag as -vJakub Konka
2022-06-29clang: add Zig equivalent for -headerpad_max_install_names cli flagJakub Konka
2022-06-28clang: update cmdline options to include weak libs and frameworksJakub Konka
Clang accepts `-weak-lx`, `-weak_library x` and `-weak_framework x`.
2022-03-04zig cc: integrate with -fstack-check, -fno-stack-checkAndrew Kelley
2022-01-19stage2: improvements to entry point handlingAndrew Kelley
* rename `entry` to `entry_symbol_name` for the zig build API * integrate with `zig cc` command line options * integrate with COFF linking with LLD * integrate with self-hosted ELF linker * don't put it in the hash for MachO since it is ignored
2022-01-11zig cc: integration with sysroot arg (#10568)Jakub Konka
Prior to this change, even if the use specified the sysroot on the compiler line like so ``` zig cc --sysroot=/path/to/sdk ``` it would only be used as a prefix to include paths and not as a prefix for `zig ld` linker.