aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/target-arm64.c
diff options
context:
space:
mode:
Diffstat (limited to 'target-arm64.c')
-rw-r--r--target-arm64.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/target-arm64.c b/target-arm64.c
index cddabb82..71db639c 100644
--- a/target-arm64.c
+++ b/target-arm64.c
@@ -11,7 +11,17 @@ static void init_arm64(const struct target *self)
static void predefine_arm64(const struct target *self)
{
+ static const char *cmodels[CMODEL_LAST] = {
+ [CMODEL_LARGE] = "LARGE",
+ [CMODEL_SMALL] = "SMALL",
+ [CMODEL_TINY] = "TINY",
+ };
+ const char *cmodel = cmodels[arch_cmodel];
+
predefine("__aarch64__", 1, "1");
+
+ if (cmodel)
+ add_pre_buffer("#define __AARCH64_CMODEL_%s__ 1\n", cmodel);
}
const struct target target_arm64 = {