| ... | ... | @@ -1007,6 +1007,11 @@ fn buildOutputType( |
| 1007 | 1007 | ensure_libc_on_non_freestanding = true; |
| 1008 | 1008 | ensure_libcpp_on_non_freestanding = arg_mode == .cpp; |
| 1009 | 1009 | want_native_include_dirs = true; |
| 1010 | // Clang's driver enables this switch unconditionally. |
| 1011 | // Disabling the emission of .eh_frame_hdr can unexpectedly break |
| 1012 | // some functionality that depend on it, such as C++ exceptions and |
| 1013 | // DWARF-based stack traces. |
| 1014 | link_eh_frame_hdr = true; |
| 1010 | 1015 | |
| 1011 | 1016 | const COutMode = enum { |
| 1012 | 1017 | link, |
| ... | ... | @@ -1274,6 +1279,10 @@ fn buildOutputType( |
| 1274 | 1279 | image_base_override = std.fmt.parseUnsigned(u64, linker_args.items[i], 0) catch |err| { |
| 1275 | 1280 | fatal("unable to parse '{s}': {s}", .{ arg, @errorName(err) }); |
| 1276 | 1281 | }; |
| 1282 | } else if (mem.eql(u8, arg, "--eh-frame-hdr")) { |
| 1283 | link_eh_frame_hdr = true; |
| 1284 | } else if (mem.eql(u8, arg, "--no-eh-frame-hdr")) { |
| 1285 | link_eh_frame_hdr = false; |
| 1277 | 1286 | } else { |
| 1278 | 1287 | warn("unsupported linker arg: {s}", .{arg}); |
| 1279 | 1288 | } |