| author | |
| committer | |
| log | f29bdd6746691d0a547140e435056a000419480f |
| tree | 0ca346e932f845c4dc710dc00484c3c3b64c20e4 |
| parent | 96fcc8d63bf8391e5cf2246e9427e9ab56399d86 |
| parent | 0ecc6332b4eb1ced547ffa38f57471134aaa4d13 |
| signature |
Some fixes for `thumb-linux-*` support3 files changed, 16 insertions(+), 9 deletions(-)
lib/std/start.zig+3-1| ... | ... | @@ -283,7 +283,9 @@ fn _start() callconv(.Naked) noreturn { |
| 283 | 283 | \\ mov fp, #0 |
| 284 | 284 | \\ mov lr, #0 |
| 285 | 285 | \\ mov a1, sp |
| 286 | \\ and sp, #-16 | |
| 286 | \\ mov ip, sp | |
| 287 | \\ and ip, ip, #-16 | |
| 288 | \\ mov sp, ip | |
| 287 | 289 | \\ b %[posixCallMainAndExit] |
| 288 | 290 | , |
| 289 | 291 | .csky => |
src/Compilation.zig+8-8| ... | ... | @@ -5536,10 +5536,6 @@ pub fn addCCArgs( |
| 5536 | 5536 | else => {}, |
| 5537 | 5537 | } |
| 5538 | 5538 | |
| 5539 | if (target.cpu.arch.isThumb()) { | |
| 5540 | try argv.append("-mthumb"); | |
| 5541 | } | |
| 5542 | ||
| 5543 | 5539 | { |
| 5544 | 5540 | var san_arg: std.ArrayListUnmanaged(u8) = .{}; |
| 5545 | 5541 | const prefix = "-fsanitize="; |
| ... | ... | @@ -5636,10 +5632,6 @@ pub fn addCCArgs( |
| 5636 | 5632 | try argv.append("-Werror=date-time"); |
| 5637 | 5633 | } |
| 5638 | 5634 | |
| 5639 | if (target_util.supports_fpic(target) and mod.pic) { | |
| 5640 | try argv.append("-fPIC"); | |
| 5641 | } | |
| 5642 | ||
| 5643 | 5635 | if (mod.unwind_tables) { |
| 5644 | 5636 | try argv.append("-funwind-tables"); |
| 5645 | 5637 | } else { |
| ... | ... | @@ -5730,6 +5722,14 @@ pub fn addCCArgs( |
| 5730 | 5722 | }, |
| 5731 | 5723 | } |
| 5732 | 5724 | |
| 5725 | if (target.cpu.arch.isThumb()) { | |
| 5726 | try argv.append("-mthumb"); | |
| 5727 | } | |
| 5728 | ||
| 5729 | if (target_util.supports_fpic(target) and mod.pic) { | |
| 5730 | try argv.append("-fPIC"); | |
| 5731 | } | |
| 5732 | ||
| 5733 | 5733 | try argv.ensureUnusedCapacity(2); |
| 5734 | 5734 | switch (comp.config.debug_format) { |
| 5735 | 5735 | .strip => {}, |
src/musl.zig+5| ... | ... | @@ -384,6 +384,7 @@ fn addCcArgs( |
| 384 | 384 | try args.appendSlice(&[_][]const u8{ |
| 385 | 385 | "-std=c99", |
| 386 | 386 | "-ffreestanding", |
| 387 | "-fno-builtin", | |
| 387 | 388 | "-fexcess-precision=standard", |
| 388 | 389 | "-frounding-math", |
| 389 | 390 | "-fno-strict-aliasing", |
| ... | ... | @@ -422,6 +423,10 @@ fn addCcArgs( |
| 422 | 423 | "-Qunused-arguments", |
| 423 | 424 | "-w", // disable all warnings |
| 424 | 425 | }); |
| 426 | ||
| 427 | if (target.cpu.arch.isThumb()) { | |
| 428 | try args.append("-mimplicit-it=always"); | |
| 429 | } | |
| 425 | 430 | } |
| 426 | 431 | |
| 427 | 432 | fn start_asm_path(comp: *Compilation, arena: Allocator, basename: []const u8) ![]const u8 { |