diff --git a/0052-linux-user-binfmt-support-host-binaries.patch b/0052-linux-user-binfmt-support-host-binaries.patch index fb0d04d8..f3b63b1f 100644 --- a/0052-linux-user-binfmt-support-host-binaries.patch +++ b/0052-linux-user-binfmt-support-host-binaries.patch @@ -1,4 +1,4 @@ -From 3ee42b48dd69ca6f4cf35a065628088bbdf7fa4f Mon Sep 17 00:00:00 2001 +From 20d9c73417a401a79a3c5ae9aa07d635a06e9519 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Thu, 2 Feb 2012 18:02:33 +0100 Subject: [PATCH] linux-user: binfmt: support host binaries @@ -8,11 +8,11 @@ trying to run, let's just use that instead as it will be a lot faster. Signed-off-by: Alexander Graf --- - linux-user/binfmt.c | 27 +++++++++++++++++++++++++++ - 1 files changed, 27 insertions(+), 0 deletions(-) + linux-user/binfmt.c | 25 +++++++++++++++++++++++++ + 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/linux-user/binfmt.c b/linux-user/binfmt.c -index cd1f513..74f5741 100644 +index cd1f513..87dc4c6 100644 --- a/linux-user/binfmt.c +++ b/linux-user/binfmt.c @@ -5,6 +5,9 @@ @@ -25,7 +25,7 @@ index cd1f513..74f5741 100644 int main(int argc, char **argv, char **envp) { -@@ -28,6 +31,30 @@ int main(int argc, char **argv, char **envp) +@@ -28,6 +31,28 @@ int main(int argc, char **argv, char **envp) binfmt[0] = '\0'; /* Now argv[0] is the real qemu binary name */ @@ -39,9 +39,7 @@ index cd1f513..74f5741 100644 + goto skip; + } + guestarch++; -+ hostbin = malloc(strlen(argv[1] + strlen("/emul/-for-/" ARCH_NAME) + -+ strlen(guestarch) + 1)); -+ sprintf(hostbin, "/emul/" ARCH_NAME "-for-%s/%s", guestarch, argv[1]); ++ asprintf(&hostbin, "/emul/" ARCH_NAME "-for-%s/%s", guestarch, argv[1]); + if (!access(hostbin, X_OK)) { + /* + * We found a host binary replacement for the non-host binary. Let's