From 55fe0ad7da5b1b3b946d81a66ade1f0e1797706c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 23 Sep 2026 13:08:39 +0200 Subject: [PATCH] llvm: enable bti and pac-ret for aarch64-linux-android --- src/codegen/llvm.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 004fb58fdb6ef3f146818dad88c349ea64c2f61a..30bd4fc0da7d1d6539b75addb6ceee819619b2a3 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -493,7 +493,7 @@ pub const Object = struct { } // The frontend should eventually offer options to control these. - if (target.cpu.arch.isAarch64() and target.os.tag == .openbsd) { + if (target.cpu.arch.isAarch64() and (target.os.tag == .openbsd or target.abi.isAndroid())) { module_flags.appendAssumeCapacity(try o.builder.metadataTuple(&.{ behavior_min, (try o.builder.metadataString("branch-target-enforcement")).toMetadata(), @@ -2253,7 +2253,7 @@ pub const Object = struct { } // The frontend should eventually offer options to control these. - if (target.cpu.arch.isAarch64() and target.os.tag == .openbsd) { + if (target.cpu.arch.isAarch64() and (target.os.tag == .openbsd or target.abi.isAndroid())) { try attributes.addFnAttr(.{ .string = .{ .kind = try o.builder.string("branch-target-enforcement"), .value = try o.builder.string(""), -- 2.54.0