| ... | ... | @@ -318,14 +318,6 @@ pub fn resolve(options: Options) ResolveError!Config { |
| 318 | 318 | break :b false; |
| 319 | 319 | }; |
| 320 | 320 | |
| 321 | | var link_libunwind = b: { |
| 322 | | if (link_libcpp and target_util.libCxxNeedsLibUnwind(target)) { |
| 323 | | if (options.link_libunwind == false) return error.LibCppRequiresLibUnwind; |
| 324 | | break :b true; |
| 325 | | } |
| 326 | | break :b options.link_libunwind orelse false; |
| 327 | | }; |
| 328 | | |
| 329 | 321 | const link_libc = b: { |
| 330 | 322 | if (target_util.osRequiresLibC(target)) { |
| 331 | 323 | if (options.link_libc == false) return error.OsRequiresLibC; |
| ... | ... | @@ -335,7 +327,7 @@ pub fn resolve(options: Options) ResolveError!Config { |
| 335 | 327 | if (options.link_libc == false) return error.LibCppRequiresLibC; |
| 336 | 328 | break :b true; |
| 337 | 329 | } |
| 338 | | if (link_libunwind) { |
| 330 | if (options.link_libunwind == true) { |
| 339 | 331 | if (options.link_libc == false) return error.LibUnwindRequiresLibC; |
| 340 | 332 | break :b true; |
| 341 | 333 | } |
| ... | ... | @@ -406,12 +398,17 @@ pub fn resolve(options: Options) ResolveError!Config { |
| 406 | 398 | break :b .static; |
| 407 | 399 | }; |
| 408 | 400 | |
| 409 | | // This is done here to avoid excessive duplicated logic due to the complex dependencies between these options. |
| 410 | | if (options.output_mode == .Exe and link_libc and target_util.libCNeedsLibUnwind(target, link_mode)) { |
| 411 | | if (options.link_libunwind == false) return error.LibCRequiresLibUnwind; |
| 412 | | |
| 413 | | link_libunwind = true; |
| 414 | | } |
| 401 | const link_libunwind = b: { |
| 402 | if (options.output_mode == .Exe and link_libc and target_util.libCNeedsLibUnwind(target, link_mode)) { |
| 403 | if (options.link_libunwind == false) return error.LibCRequiresLibUnwind; |
| 404 | break :b true; |
| 405 | } |
| 406 | if (link_libcpp and target_util.libCxxNeedsLibUnwind(target)) { |
| 407 | if (options.link_libunwind == false) return error.LibCppRequiresLibUnwind; |
| 408 | break :b true; |
| 409 | } |
| 410 | break :b options.link_libunwind orelse false; |
| 411 | }; |
| 415 | 412 | |
| 416 | 413 | const import_memory = options.import_memory orelse (options.output_mode == .Obj); |
| 417 | 414 | const export_memory = b: { |