Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions compat/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def setup(role: Role,
target=AGENT_TARGET),
]

if glib_flavor == "upstream":
if glib_flavor == "upstream" and len(compat) > 0:
kind = "modern" if arch_is_modern(host_os, host_arch) else "legacy"
_, agent_file, gadget_file = native_file_paths(host_os)
group = OutputGroup(host_arch)
Expand Down Expand Up @@ -496,7 +496,10 @@ def call_internal_meson(argv, *args, **kwargs):
host_machine = MachineSpec(state.host_os, group.arch, state.host_config, group.triplet)

if state.glib_flavor == "upstream":
allowed = None
if state.allowed_prebuilds is not None and len(state.allowed_prebuilds) == 0:
allowed = state.allowed_prebuilds
else:
allowed = None
else:
allowed = state.allowed_prebuilds

Expand Down
10 changes: 10 additions & 0 deletions lib/payload/libc-shim.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
#ifdef HAVE_MUSL
# define FRIDA_STDIO_OPAQUE_FILE 1
#endif
#ifdef HAVE_ANDROID
# define FRIDA_STDIO_OPAQUE_FILE 1
#endif

static gboolean frida_deinit_expected = FALSE;

Expand Down Expand Up @@ -254,9 +257,11 @@ static off_t frida_lseek_nointr (int fd, off_t offset, int whence);
#ifndef FRIDA_STDIO_OPAQUE_FILE
G_GNUC_INTERNAL FILE __sF[3];

# ifndef __ANDROID__
G_GNUC_INTERNAL FILE * stdin = &__sF[0];
G_GNUC_INTERNAL FILE * stdout = &__sF[1];
G_GNUC_INTERNAL FILE * stderr = &__sF[2];
# endif

# ifdef HAVE_DARWIN
G_GNUC_INTERNAL FILE * __stdinp = &__sF[0];
Expand All @@ -266,9 +271,11 @@ G_GNUC_INTERNAL FILE * __stderrp = &__sF[2];
#else
static FridaFileHandle frida_stdio[3];

# ifndef __ANDROID__
G_GNUC_INTERNAL FILE * const stdin = (FILE *) &frida_stdio[0];
G_GNUC_INTERNAL FILE * const stdout = (FILE *) &frida_stdio[1];
G_GNUC_INTERNAL FILE * const stderr = (FILE *) &frida_stdio[2];
# endif
#endif

static gboolean frida_libc_shim_initialized = FALSE;
Expand Down Expand Up @@ -1512,6 +1519,7 @@ getline (char ** lineptr, size_t * n, FILE * stream)
return getdelim (lineptr, n, '\n', stream);
}

#ifndef FRIDA_STDIO_OPAQUE_FILE
G_GNUC_INTERNAL FILE *
tmpfile (void)
{
Expand All @@ -1536,6 +1544,8 @@ tmpfile (void)
return result;
}

#endif

G_GNUC_INTERNAL int
putchar (int c)
{
Expand Down