| author | |
| committer | |
| log | cfedd3aca286881510e4a298756d4a5676e22137 |
| tree | 48d4fcf40d69b7fcd4773c934110a83bbd710d71 |
| parent | 6408766d6b55d228a305b877f28f45c1587f7d39 |
| signature |
This caused link errors in c++ code because it was not correct to pass
these flags to child codegens. And that was the only reason to detect
these flags. Otherwise we can safely rely on non-explicitly-detected
flag forwarding.7 files changed, 4 insertions(+), 92 deletions(-)
src-self-hosted/clang_options_data.zig+4-32| ... | ... | @@ -2554,14 +2554,7 @@ flagpd1("femulated-tls"), |
| 2554 | 2554 | flagpd1("fencode-extended-block-signature"), |
| 2555 | 2555 | sepd1("ferror-limit"), |
| 2556 | 2556 | flagpd1("fescaping-block-tail-calls"), |
| 2557 | .{ | |
| 2558 | .name = "fexceptions", | |
| 2559 | .syntax = .flag, | |
| 2560 | .zig_equivalent = .exceptions, | |
| 2561 | .pd1 = true, | |
| 2562 | .pd2 = false, | |
| 2563 | .psl = false, | |
| 2564 | }, | |
| 2557 | flagpd1("fexceptions"), | |
| 2565 | 2558 | flagpd1("fexperimental-isel"), |
| 2566 | 2559 | flagpd1("fexperimental-new-constant-interpreter"), |
| 2567 | 2560 | flagpd1("fexperimental-new-pass-manager"), |
| ... | ... | @@ -2765,14 +2758,7 @@ flagpd1("fno-elide-type"), |
| 2765 | 2758 | flagpd1("fno-eliminate-unused-debug-symbols"), |
| 2766 | 2759 | flagpd1("fno-emulated-tls"), |
| 2767 | 2760 | flagpd1("fno-escaping-block-tail-calls"), |
| 2768 | .{ | |
| 2769 | .name = "fno-exceptions", | |
| 2770 | .syntax = .flag, | |
| 2771 | .zig_equivalent = .no_exceptions, | |
| 2772 | .pd1 = true, | |
| 2773 | .pd2 = false, | |
| 2774 | .psl = false, | |
| 2775 | }, | |
| 2761 | flagpd1("fno-exceptions"), | |
| 2776 | 2762 | flagpd1("fno-experimental-isel"), |
| 2777 | 2763 | flagpd1("fno-experimental-new-pass-manager"), |
| 2778 | 2764 | flagpd1("fno-fast-math"), |
| ... | ... | @@ -2861,14 +2847,7 @@ flagpd1("fno-rewrite-includes"), |
| 2861 | 2847 | flagpd1("fno-ropi"), |
| 2862 | 2848 | flagpd1("fno-rounding-math"), |
| 2863 | 2849 | flagpd1("fno-rtlib-add-rpath"), |
| 2864 | .{ | |
| 2865 | .name = "fno-rtti", | |
| 2866 | .syntax = .flag, | |
| 2867 | .zig_equivalent = .no_rtti, | |
| 2868 | .pd1 = true, | |
| 2869 | .pd2 = false, | |
| 2870 | .psl = false, | |
| 2871 | }, | |
| 2850 | flagpd1("fno-rtti"), | |
| 2872 | 2851 | flagpd1("fno-rtti-data"), |
| 2873 | 2852 | flagpd1("fno-rwpi"), |
| 2874 | 2853 | flagpd1("fno-sanitize-address-poison-custom-array-cookie"), |
| ... | ... | @@ -3016,14 +2995,7 @@ flagpd1("fno-frontend-optimize"), |
| 3016 | 2995 | flagpd1("fropi"), |
| 3017 | 2996 | flagpd1("frounding-math"), |
| 3018 | 2997 | flagpd1("frtlib-add-rpath"), |
| 3019 | .{ | |
| 3020 | .name = "frtti", | |
| 3021 | .syntax = .flag, | |
| 3022 | .zig_equivalent = .rtti, | |
| 3023 | .pd1 = true, | |
| 3024 | .pd2 = false, | |
| 3025 | .psl = false, | |
| 3026 | }, | |
| 2998 | flagpd1("frtti"), | |
| 3027 | 2999 | flagpd1("frwpi"), |
| 3028 | 3000 | flagpd1("fsanitize-address-globals-dead-stripping"), |
| 3029 | 3001 | flagpd1("fsanitize-address-poison-custom-array-cookie"), |
src-self-hosted/stage2.zig-4| ... | ... | @@ -1286,10 +1286,6 @@ pub const ClangArgIterator = extern struct { |
| 1286 | 1286 | sanitize, |
| 1287 | 1287 | linker_script, |
| 1288 | 1288 | verbose_cmds, |
| 1289 | exceptions, | |
| 1290 | no_exceptions, | |
| 1291 | rtti, | |
| 1292 | no_rtti, | |
| 1293 | 1289 | for_linker, |
| 1294 | 1290 | linker_input_z, |
| 1295 | 1291 | }; |
src/all_types.hpp-2| ... | ... | @@ -2262,8 +2262,6 @@ struct CodeGen { |
| 2262 | 2262 | bool emit_asm; |
| 2263 | 2263 | bool emit_llvm_ir; |
| 2264 | 2264 | bool test_is_evented; |
| 2265 | bool cpp_rtti; | |
| 2266 | bool cpp_exceptions; | |
| 2267 | 2265 | CodeModel code_model; |
| 2268 | 2266 | |
| 2269 | 2267 | Buf *root_out_name; |
src/codegen.cpp-16| ... | ... | @@ -8784,8 +8784,6 @@ static Error define_builtin_compile_vars(CodeGen *g) { |
| 8784 | 8784 | cache_bool(&cache_hash, g->is_test_build); |
| 8785 | 8785 | cache_bool(&cache_hash, g->is_single_threaded); |
| 8786 | 8786 | cache_bool(&cache_hash, g->test_is_evented); |
| 8787 | cache_bool(&cache_hash, g->cpp_rtti); | |
| 8788 | cache_bool(&cache_hash, g->cpp_exceptions); | |
| 8789 | 8787 | cache_int(&cache_hash, g->code_model); |
| 8790 | 8788 | cache_int(&cache_hash, g->zig_target->is_native_os); |
| 8791 | 8789 | cache_int(&cache_hash, g->zig_target->is_native_cpu); |
| ... | ... | @@ -9259,14 +9257,6 @@ void add_cc_args(CodeGen *g, ZigList<const char *> &args, const char *out_dep_pa |
| 9259 | 9257 | case CSourceKindAsm: |
| 9260 | 9258 | break; |
| 9261 | 9259 | } |
| 9262 | if (source_kind == CSourceKindCpp) { | |
| 9263 | if (!g->cpp_rtti) { | |
| 9264 | args.append("-fno-rtti"); | |
| 9265 | } | |
| 9266 | if (!g->cpp_exceptions) { | |
| 9267 | args.append("-fno-exceptions"); | |
| 9268 | } | |
| 9269 | } | |
| 9270 | 9260 | for (size_t i = 0; i < g->zig_target->llvm_cpu_features_asm_len; i += 1) { |
| 9271 | 9261 | args.append(g->zig_target->llvm_cpu_features_asm_ptr[i]); |
| 9272 | 9262 | } |
| ... | ... | @@ -9714,8 +9704,6 @@ Error create_c_object_cache(CodeGen *g, CacheHash **out_cache_hash, bool verbose |
| 9714 | 9704 | cache_bool(cache_hash, g->have_sanitize_c); |
| 9715 | 9705 | cache_bool(cache_hash, want_valgrind_support(g)); |
| 9716 | 9706 | cache_bool(cache_hash, g->function_sections); |
| 9717 | cache_bool(cache_hash, g->cpp_rtti); | |
| 9718 | cache_bool(cache_hash, g->cpp_exceptions); | |
| 9719 | 9707 | cache_int(cache_hash, g->code_model); |
| 9720 | 9708 | |
| 9721 | 9709 | for (size_t arg_i = 0; arg_i < g->clang_argv_len; arg_i += 1) { |
| ... | ... | @@ -10550,8 +10538,6 @@ static Error check_cache(CodeGen *g, Buf *manifest_dir, Buf *digest) { |
| 10550 | 10538 | cache_bool(ch, g->emit_bin); |
| 10551 | 10539 | cache_bool(ch, g->emit_llvm_ir); |
| 10552 | 10540 | cache_bool(ch, g->emit_asm); |
| 10553 | cache_bool(ch, g->cpp_rtti); | |
| 10554 | cache_bool(ch, g->cpp_exceptions); | |
| 10555 | 10541 | cache_usize(ch, g->version_major); |
| 10556 | 10542 | cache_usize(ch, g->version_minor); |
| 10557 | 10543 | cache_usize(ch, g->version_patch); |
| ... | ... | @@ -10856,8 +10842,6 @@ CodeGen *create_child_codegen(CodeGen *parent_gen, Buf *root_src_path, OutType o |
| 10856 | 10842 | parent_gen->build_mode, parent_gen->zig_lib_dir, libc, get_global_cache_dir(), false, child_progress_node); |
| 10857 | 10843 | child_gen->root_out_name = buf_create_from_str(name); |
| 10858 | 10844 | child_gen->disable_gen_h = true; |
| 10859 | child_gen->cpp_rtti = parent_gen->cpp_rtti; | |
| 10860 | child_gen->cpp_exceptions = parent_gen->cpp_exceptions; | |
| 10861 | 10845 | child_gen->want_stack_check = WantStackCheckDisabled; |
| 10862 | 10846 | child_gen->want_sanitize_c = WantCSanitizeDisabled; |
| 10863 | 10847 | child_gen->verbose_tokenize = parent_gen->verbose_tokenize; |
src/main.cpp-18| ... | ... | @@ -458,8 +458,6 @@ static int main0(int argc, char **argv) { |
| 458 | 458 | bool only_preprocess = false; |
| 459 | 459 | bool ensure_libc_on_non_freestanding = false; |
| 460 | 460 | bool ensure_libcpp_on_non_freestanding = false; |
| 461 | bool cpp_rtti = true; | |
| 462 | bool cpp_exceptions = true; | |
| 463 | 461 | |
| 464 | 462 | ZigList<const char *> llvm_argv = {0}; |
| 465 | 463 | llvm_argv.append("zig (LLVM option parsing)"); |
| ... | ... | @@ -724,18 +722,6 @@ static int main0(int argc, char **argv) { |
| 724 | 722 | verbose_cc = true; |
| 725 | 723 | verbose_link = true; |
| 726 | 724 | break; |
| 727 | case Stage2ClangArgExceptions: | |
| 728 | cpp_exceptions = true; | |
| 729 | break; | |
| 730 | case Stage2ClangArgNoExceptions: | |
| 731 | cpp_exceptions = false; | |
| 732 | break; | |
| 733 | case Stage2ClangArgRtti: | |
| 734 | cpp_rtti = true; | |
| 735 | break; | |
| 736 | case Stage2ClangArgNoRtti: | |
| 737 | cpp_rtti = false; | |
| 738 | break; | |
| 739 | 725 | case Stage2ClangArgForLinker: |
| 740 | 726 | linker_args.append(buf_create_from_str(it.only_arg)); |
| 741 | 727 | break; |
| ... | ... | @@ -1331,8 +1317,6 @@ static int main0(int argc, char **argv) { |
| 1331 | 1317 | LinkLib *link_lib = codegen_add_link_lib(g, buf_create_from_str(link_libs.at(i))); |
| 1332 | 1318 | link_lib->provided_explicitly = true; |
| 1333 | 1319 | } |
| 1334 | g->cpp_rtti = cpp_rtti; | |
| 1335 | g->cpp_exceptions = cpp_exceptions; | |
| 1336 | 1320 | g->subsystem = subsystem; |
| 1337 | 1321 | g->valgrind_support = valgrind_support; |
| 1338 | 1322 | g->want_pic = want_pic; |
| ... | ... | @@ -1481,8 +1465,6 @@ static int main0(int argc, char **argv) { |
| 1481 | 1465 | } |
| 1482 | 1466 | CodeGen *g = codegen_create(main_pkg_path, zig_root_source_file, &target, out_type, build_mode, |
| 1483 | 1467 | override_lib_dir, libc, cache_dir_buf, cmd == CmdTest, root_progress_node); |
| 1484 | g->cpp_rtti = cpp_rtti; | |
| 1485 | g->cpp_exceptions = cpp_exceptions; | |
| 1486 | 1468 | if (llvm_argv.length >= 2) codegen_set_llvm_argv(g, llvm_argv.items + 1, llvm_argv.length - 2); |
| 1487 | 1469 | g->valgrind_support = valgrind_support; |
| 1488 | 1470 | g->link_eh_frame_hdr = link_eh_frame_hdr; |
src/stage2.h-4| ... | ... | @@ -345,10 +345,6 @@ enum Stage2ClangArg { |
| 345 | 345 | Stage2ClangArgSanitize, |
| 346 | 346 | Stage2ClangArgLinkerScript, |
| 347 | 347 | Stage2ClangArgVerboseCmds, |
| 348 | Stage2ClangArgExceptions, | |
| 349 | Stage2ClangArgNoExceptions, | |
| 350 | Stage2ClangArgRtti, | |
| 351 | Stage2ClangArgNoRtti, | |
| 352 | 348 | Stage2ClangArgForLinker, |
| 353 | 349 | Stage2ClangArgLinkerInputZ, |
| 354 | 350 | }; |
tools/update_clang_options.zig-16| ... | ... | @@ -174,22 +174,6 @@ const known_options = [_]KnownOpt{ |
| 174 | 174 | .name = "###", |
| 175 | 175 | .ident = "verbose_cmds", |
| 176 | 176 | }, |
| 177 | .{ | |
| 178 | .name = "fexceptions", | |
| 179 | .ident = "exceptions", | |
| 180 | }, | |
| 181 | .{ | |
| 182 | .name = "fno-exceptions", | |
| 183 | .ident = "no_exceptions", | |
| 184 | }, | |
| 185 | .{ | |
| 186 | .name = "frtti", | |
| 187 | .ident = "rtti", | |
| 188 | }, | |
| 189 | .{ | |
| 190 | .name = "fno-rtti", | |
| 191 | .ident = "no_rtti", | |
| 192 | }, | |
| 193 | 177 | }; |
| 194 | 178 | |
| 195 | 179 | const blacklisted_options = [_][]const u8{}; |