diff options
author | Yury Usishchev <y.usishchev@samsung.com> | 2015-08-05 21:01:01 +0300 |
---|---|---|
committer | Dongkyun, Son <dongkyun.s@samsung.com> | 2016-01-11 14:45:52 +0900 |
commit | 78a727bb4a499f71e964a2d8a99f195b5c8dcb6c (patch) | |
tree | f89f3e558e779f6ce7f855e4791f9eb02d13e203 | |
parent | 42d85afb5622e7f32d108d53d19802d3b647ac89 (diff) | |
download | qemu-78a727bb4a499f71e964a2d8a99f195b5c8dcb6c.tar.gz qemu-78a727bb4a499f71e964a2d8a99f195b5c8dcb6c.tar.bz2 qemu-78a727bb4a499f71e964a2d8a99f195b5c8dcb6c.zip |
binfmt: use binaries from /emul
This allows removing hardcoded architecture-dependent paths
from qemu-accel package. Also allows using symlinks for qemu-*-binfmt
as path don't depend on binary name now.
Change-Id: I92b9bc6df477ef925c761045d5307aca8cc1b2d4
-rw-r--r-- | linux-user/binfmt.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/linux-user/binfmt.c b/linux-user/binfmt.c index c58be5b8c..2a9009621 100644 --- a/linux-user/binfmt.c +++ b/linux-user/binfmt.c @@ -5,11 +5,6 @@ #include <string.h> #include <stdlib.h> -#ifdef __x86_64__ -#define ARCH_NAME "x86_64" -#elif defined __i386__ -#define ARCH_NAME "i586" -#endif int main(int argc, char **argv, char **envp) { @@ -33,18 +28,11 @@ int main(int argc, char **argv, char **envp) binfmt[0] = '\0'; /* Now argv[0] is the real qemu binary name */ -#ifdef ARCH_NAME { char *hostbin; - char *guestarch; int r; - guestarch = strrchr(argv[0], '-') ; - if (!guestarch) { - goto skip; - } - guestarch++; - r = asprintf(&hostbin, "/emul/" ARCH_NAME "-for-%s/%s", guestarch, argv[1]); + r = asprintf(&hostbin, "/emul/%s", argv[1]); if (!access(hostbin, X_OK) && (r > 0)) { /* * We found a host binary replacement for the non-host binary. Let's @@ -53,8 +41,6 @@ int main(int argc, char **argv, char **envp) return execve(hostbin, &argv[2], envp); } } -skip: -#endif new_argv = (char **)malloc((argc + 2) * sizeof(*new_argv)); if (argc > 3) { |