SHA256
1
0
forked from pool/qemu
Alexander Graf 2012-02-03 13:34:20 +00:00 committed by Git OBS Bridge
parent 64dd019b6c
commit ce9a9e892b

View File

@ -1,4 +1,4 @@
From e2e0df8cf7c45e148e96d3d7c5aeb6d70fd0c966 Mon Sep 17 00:00:00 2001
From 3ee42b48dd69ca6f4cf35a065628088bbdf7fa4f Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
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 <agraf@suse.de>
---
linux-user/binfmt.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
linux-user/binfmt.c | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/linux-user/binfmt.c b/linux-user/binfmt.c
index cd1f513..b9e225f 100644
index cd1f513..74f5741 100644
--- a/linux-user/binfmt.c
+++ b/linux-user/binfmt.c
@@ -5,6 +5,9 @@
@ -25,7 +25,7 @@ index cd1f513..b9e225f 100644
int main(int argc, char **argv, char **envp)
{
@@ -28,6 +31,29 @@ int main(int argc, char **argv, char **envp)
@@ -28,6 +31,30 @@ int main(int argc, char **argv, char **envp)
binfmt[0] = '\0';
/* Now argv[0] is the real qemu binary name */
@ -39,7 +39,8 @@ index cd1f513..b9e225f 100644
+ goto skip;
+ }
+ guestarch++;
+ hostbin = malloc(strlen(argv[1] + strlen("/emul/-for-/" ARCH_NAME) + 1));
+ hostbin = malloc(strlen(argv[1] + strlen("/emul/-for-/" ARCH_NAME) +
+ strlen(guestarch) + 1));
+ sprintf(hostbin, "/emul/" ARCH_NAME "-for-%s/%s", guestarch, argv[1]);
+ if (!access(hostbin, X_OK)) {
+ /*