mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
Merge pull request #21263 from alexrp/thumb-fixes
Some fixes for `thumb-linux-*` support
This commit is contained in:
commit
f29bdd6746
@ -283,7 +283,9 @@ fn _start() callconv(.Naked) noreturn {
|
||||
\\ mov fp, #0
|
||||
\\ mov lr, #0
|
||||
\\ mov a1, sp
|
||||
\\ and sp, #-16
|
||||
\\ mov ip, sp
|
||||
\\ and ip, ip, #-16
|
||||
\\ mov sp, ip
|
||||
\\ b %[posixCallMainAndExit]
|
||||
,
|
||||
.csky =>
|
||||
|
||||
@ -5536,10 +5536,6 @@ pub fn addCCArgs(
|
||||
else => {},
|
||||
}
|
||||
|
||||
if (target.cpu.arch.isThumb()) {
|
||||
try argv.append("-mthumb");
|
||||
}
|
||||
|
||||
{
|
||||
var san_arg: std.ArrayListUnmanaged(u8) = .{};
|
||||
const prefix = "-fsanitize=";
|
||||
@ -5636,10 +5632,6 @@ pub fn addCCArgs(
|
||||
try argv.append("-Werror=date-time");
|
||||
}
|
||||
|
||||
if (target_util.supports_fpic(target) and mod.pic) {
|
||||
try argv.append("-fPIC");
|
||||
}
|
||||
|
||||
if (mod.unwind_tables) {
|
||||
try argv.append("-funwind-tables");
|
||||
} else {
|
||||
@ -5730,6 +5722,14 @@ pub fn addCCArgs(
|
||||
},
|
||||
}
|
||||
|
||||
if (target.cpu.arch.isThumb()) {
|
||||
try argv.append("-mthumb");
|
||||
}
|
||||
|
||||
if (target_util.supports_fpic(target) and mod.pic) {
|
||||
try argv.append("-fPIC");
|
||||
}
|
||||
|
||||
try argv.ensureUnusedCapacity(2);
|
||||
switch (comp.config.debug_format) {
|
||||
.strip => {},
|
||||
|
||||
@ -384,6 +384,7 @@ fn addCcArgs(
|
||||
try args.appendSlice(&[_][]const u8{
|
||||
"-std=c99",
|
||||
"-ffreestanding",
|
||||
"-fno-builtin",
|
||||
"-fexcess-precision=standard",
|
||||
"-frounding-math",
|
||||
"-fno-strict-aliasing",
|
||||
@ -422,6 +423,10 @@ fn addCcArgs(
|
||||
"-Qunused-arguments",
|
||||
"-w", // disable all warnings
|
||||
});
|
||||
|
||||
if (target.cpu.arch.isThumb()) {
|
||||
try args.append("-mimplicit-it=always");
|
||||
}
|
||||
}
|
||||
|
||||
fn start_asm_path(comp: *Compilation, arena: Allocator, basename: []const u8) ![]const u8 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user