Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 375194 Details for
Bug 507990
app-emulation/qemu-user-9999 - add aarch64 support and binfmt patch
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
binfmt helper patch
binfmt-wrapper.patch (text/plain), 2.25 KB, created by
Andrew Aladjev
on 2014-04-18 11:15:52 UTC
(
hide
)
Description:
binfmt helper patch
Filename:
MIME Type:
Creator:
Andrew Aladjev
Created:
2014-04-18 11:15:52 UTC
Size:
2.25 KB
patch
obsolete
>diff --git a/Makefile.target b/Makefile.target >index 9a49852..53867c7 100644 >--- a/Makefile.target >+++ b/Makefile.target >@@ -31,6 +31,10 @@ PROGS+=$(QEMU_PROGW) > endif > STPFILES= > >+ifdef CONFIG_LINUX_USER >+PROGS+=$(QEMU_PROG)-binfmt >+endif >+ > config-target.h: config-target.h-timestamp > config-target.h-timestamp: config-target.mak > >@@ -96,6 +100,8 @@ QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user > obj-y += linux-user/ > obj-y += gdbstub.o thunk.o user-exec.o > >+obj-binfmt-y += linux-user/binfmt.o >+ > endif #CONFIG_LINUX_USER > > ######################################################### >@@ -166,6 +172,9 @@ $(QEMU_PROG): $(all-obj-y) ../libqemuutil.a ../libqemustub.a > $(call LINK,$^) > endif > >+$(QEMU_PROG)-binfmt: $(obj-binfmt-y) >+ $(call LINK,$^) >+ > gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh > $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES)," GEN $(TARGET_DIR)$@") > >diff --git a/linux-user/binfmt.c b/linux-user/binfmt.c >new file mode 100644 >index 0000000..ce3c1bd >--- /dev/null >+++ b/linux-user/binfmt.c >@@ -0,0 +1,38 @@ >+#include <stdio.h> >+#include <stdarg.h> >+#include <unistd.h> >+#include <libgen.h> >+#include <string.h> >+#include <stdlib.h> >+ >+int main ( int argc, char ** argv, char ** envp ) >+{ >+ char * binfmt; >+ char ** new_argv; >+ >+ // Check if our file name ends with -binfmt >+ binfmt = argv[0] + strlen( argv[0] ) - strlen ( "-binfmt" ); >+ if ( strcmp ( binfmt, "-binfmt" ) ) { >+ fprintf ( stderr, "%s: Invalid executable name\n", argv[0] ); >+ return 1; >+ } >+ if ( argc < 3 ) { >+ fprintf ( stderr, "%s: Please use me through binfmt with P flag\n", argv[0] ); >+ return 2; >+ } >+ >+ binfmt[0] = '\0'; >+ // Now argv[0] is the real qemu binary name >+ >+ new_argv = ( char ** ) malloc ( ( argc + 2 ) * sizeof ( * new_argv ) ); >+ if ( argc > 3 ) { >+ memcpy ( &new_argv[4], &argv[3], ( argc - 3 ) * sizeof ( * new_argv ) ); >+ } >+ new_argv[0] = argv[0]; >+ new_argv[1] = ( char * ) "-0"; >+ new_argv[2] = argv[2]; >+ new_argv[3] = argv[1]; >+ new_argv[argc + 1] = NULL; >+ >+ return execve ( new_argv[0], new_argv, envp ); >+} >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 507990
:
375192
| 375194