aboutsummaryrefslogtreecommitdiff
path: root/src/clang_options_data.zig
AgeCommit message (Collapse)Author
2025-08-30zig cc: update options data to LLVM 21Alex Rønne Petersen
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-04-04zig cc: Update options data to Clang 20.Alex Rønne Petersen
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-09-19clang: Update options data to Clang 19.Alex Rønne Petersen
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-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-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-04comp: add support for -fdata-sectionsJakub Konka
2023-09-19zig cc: update clang CLI data to LLVM 17Andrew Kelley
release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8
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-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-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-03Merge remote-tracking branch 'origin/master' into llvm14Andrew Kelley
2022-07-03clang: parse --verbose flag as -vJakub Konka
2022-07-01update clang command line options to LLVM 14Andrew Kelley
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.
2021-11-26zig cc: honor all -m and -mno- CPU feature flagsAndrew Kelley
closes #9196
2021-11-21zig cc: add -fcolor-diagnostics and -fcaret-diagnostics integrationAndrew Kelley
Closes #6290
2021-11-21zig cc: add -ffunction-sections integrationAndrew Kelley
Also update to latest LLVM 13 command line options. See #6290
2021-10-16Add build.zig and command line flagsLee Cannon
2021-09-16zig cc: support -S and -emit-llvm CLI parametersAndrew Kelley
closes #6425
2021-09-01stage2: update for new usingnamespace semanticsAndrew Kelley
2021-06-11zig cc: recognize more pie flagsAndrew Kelley
This is a bug fix.
2021-06-11better awareness of unwind tablesAndrew Kelley
* stage1 backend allows configuring the uwtables function attr via a flag rather than its own logic. * stage2 defaults to enabling uwtable attr when linking libunwind, or always on windows * stage2 makes link_eh_frame_hdr true automatically if uwtable attr is set to be on for zig functions * CLI: add -funwind-tables and -fno-unwind-tables to allow the user to override the defaults. * hook it up to `zig cc` closes #9046
2021-06-09cc,wasi: support WASI reactors via -mexec-model flag.Takeshi Yoneda
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2021-03-28Merge remote-tracking branch 'origin/master' into llvm12Andrew Kelley
2021-03-14macho: fix various linker flagsMichael Dusan
fix drivers: zig {cc,c++} - `-dynamiclib` is an alias to `-shared` - associate `-dynamiclib` with zig `.shared` semantics fix drivers: zig {cc,c++,build-lib,build-exe} - use `-dynamic` for {exe,dylib} - for dylib this fixes a regression - for exe this replaces incorrect use of `-static`
2021-03-04Merge remote-tracking branch 'origin/master' into llvm12Andrew Kelley
Syncing with master branch because I want to re-run update_clang_options.zig in the llvm12 branch.