asahi: Don't depend on glibc to decode

fopencookie is a glibc feature, so we can't use it on macOS (and
probably other libc's?). It's only used for the hypervisor interface,
though, so we can just make the hypervisor piece glibc-only while
otherwise fixing the wrap.dylib build.

Fixes: ee83453f69 ("asahi: Add a shared library interface for decode")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24293>
This commit is contained in:
Alyssa Rosenzweig
2023-07-22 12:40:49 -04:00
parent f997d32f9f
commit e890bb0e75

View File

@@ -971,17 +971,24 @@ libagxdecode_writer(void *cookie, const char *buffer, size_t size)
return lib_config.stream_write(buffer, size);
}
#ifdef _GNU_SOURCE
static cookie_io_functions_t funcs = {.write = libagxdecode_writer};
#endif
static decoder_params lib_params;
void
libagxdecode_init(struct libagxdecode_config *config)
{
#ifdef _GNU_SOURCE
lib_config = *config;
agxdecode_dump_stream = fopencookie(NULL, "w", funcs);
chip_id_to_params(&lib_params, config->chip_id);
#else
/* fopencookie is a glibc extension */
unreachable("libagxdecode only available with glibc");
#endif
}
void