1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-04-18 21:24:07 +03:00

CONC-764: Build error in ma_context.c on android

Some research show that X18 is mentioned as a platform-reserved
register on most non-linux platforms, including MacOS, Windows, and
FreeBSD. So only put it in the clobber list in Linux.

Note that the ma_context.c code does not itself use the X18 register
in any way. On platforms where X18 is reserved, the co-routine code
will preserve it. On platforms where co-routine code can modify X18,
it does not need to be preserved. Putting X18 in the clobber list is
only to avoid GCC itself generating code that requires that X18 is
preserved.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
Kristian Nielsen 2025-04-01 20:32:49 +02:00
parent 8e371bbe8e
commit 5b7df2276c

View File

@ -726,7 +726,7 @@ my_context_spawn(struct my_context *c, void (*f)(void *), void *d)
: [save] "r" (save)
: "x3", "x4", "x5", "x6", "x7",
"x9", "x10", "x11", "x14", "x15",
#ifndef __ANDROID__
#if defined(__linux__) && !defined(__ANDROID__)
"x18",
#endif
"x30",
@ -833,7 +833,7 @@ my_context_continue(struct my_context *c)
: [save] "r" (save)
: "x1", "x2", "x3", "x4", "x5", "x6", "x7",
"x9", "x10", "x11", "x12", "x13", "x14", "x15",
#ifndef __ANDROID__
#if defined(__linux__) && !defined(__ANDROID__)
"x18",
#endif
"x30",
@ -914,7 +914,7 @@ my_context_yield(struct my_context *c)
: [save] "r" (save)
: "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7",
"x9", "x10", "x11", "x12", "x13", "x14", "x15",
#ifndef __ANDROID__
#if defined(__linux__) && !defined(__ANDROID__)
"x18",
#endif
"x30",