Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Apr 2014 19:06:16 +0000 (UTC)
From:      Juergen Lock <nox@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r350150 - in head/emulators/qemu-devel: . files
Message-ID:  <201404041906.s34J6G9o043735@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nox
Date: Fri Apr  4 19:06:16 2014
New Revision: 350150
URL: http://svnweb.freebsd.org/changeset/ports/350150
QAT: https://qat.redports.org/buildarchive/r350150/

Log:
  - Add two bvd-user fixes:
    - Lower 32bit mips TARGET_USRSTACK to fix an assert starting mips
      processes on 64bit hosts. (like amd64) [1]
    - Pass down interp_prefix (-L arg) to target subprocesses so running
      shared target binaries as subprocesses works.
  - Bump PORTREVISION.
  
  Reported by:	sbruno [1]

Added:
  head/emulators/qemu-devel/files/extra-patch-bsd-user-mips-target_arch_vmparam.h   (contents, props changed)
  head/emulators/qemu-devel/files/extra-patch-inherit-interp_prefix   (contents, props changed)
Modified:
  head/emulators/qemu-devel/Makefile

Modified: head/emulators/qemu-devel/Makefile
==============================================================================
--- head/emulators/qemu-devel/Makefile	Fri Apr  4 18:54:44 2014	(r350149)
+++ head/emulators/qemu-devel/Makefile	Fri Apr  4 19:06:16 2014	(r350150)
@@ -3,6 +3,7 @@
 
 PORTNAME=	qemu
 PORTVERSION=	1.7.1
+PORTREVISION=	1
 CATEGORIES=	emulators
 MASTER_SITES=	http://wiki.qemu.org/download/:release \
 		LOCAL/nox:snapshot
@@ -67,6 +68,8 @@ PATCHFILES= \
 PATCH_DIST_STRIP=	-p1
 EXTRA_PATCHES+=	${FILESDIR}/extra-patch-bsd-user-freebsd-os-proc.c
 EXTRA_PATCHES+=	${FILESDIR}/extra-patch-05ee8495804599b52a88eb36b13ea9c06b3207cd
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-bsd-user-mips-target_arch_vmparam.h
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-inherit-interp_prefix
 .endif
 
 CONFIGURE_ARGS+=	--extra-ldflags=-L${LOCALBASE}/lib

Added: head/emulators/qemu-devel/files/extra-patch-bsd-user-mips-target_arch_vmparam.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/qemu-devel/files/extra-patch-bsd-user-mips-target_arch_vmparam.h	Fri Apr  4 19:06:16 2014	(r350150)
@@ -0,0 +1,12 @@
+--- a/bsd-user/mips/target_arch_vmparam.h
++++ b/bsd-user/mips/target_arch_vmparam.h
+@@ -35,7 +35,8 @@
+ #define TARGET_VM_MINUSER_ADDRESS   (0x00000000)
+ #define TARGET_VM_MAXUSER_ADDRESS   (0x80000000)
+ 
+-#define TARGET_USRSTACK (TARGET_VM_MAXUSER_ADDRESS - TARGET_PAGE_SIZE)
++// #define TARGET_USRSTACK (TARGET_VM_MAXUSER_ADDRESS - TARGET_PAGE_SIZE)
++#define TARGET_USRSTACK (TARGET_RESERVED_VA - TARGET_PAGE_SIZE * 0x10)
+ 
+ static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state)
+ {

Added: head/emulators/qemu-devel/files/extra-patch-inherit-interp_prefix
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/qemu-devel/files/extra-patch-inherit-interp_prefix	Fri Apr  4 19:06:16 2014	(r350150)
@@ -0,0 +1,84 @@
+--- a/bsd-user/main.c
++++ b/bsd-user/main.c
+@@ -58,7 +58,7 @@ unsigned long reserved_va;
+ #endif
+ #endif /* CONFIG_USE_GUEST_BASE */
+ 
+-static const char *interp_prefix = CONFIG_QEMU_INTERP_PREFIX;
++const char *interp_prefix = CONFIG_QEMU_INTERP_PREFIX;
+ const char *qemu_uname_release = CONFIG_UNAME_RELEASE;
+ extern char **environ;
+ enum BSDType bsd_type;
+--- a/bsd-user/qemu.h
++++ b/bsd-user/qemu.h
+@@ -110,6 +110,7 @@ typedef struct TaskState {
+ 
+ void init_task_state(TaskState *ts);
+ void stop_all_tasks(void);
++extern const char *interp_prefix;
+ extern const char *qemu_uname_release;
+ #if defined(CONFIG_USE_GUEST_BASE)
+ extern unsigned long mmap_min_addr;
+--- a/bsd-user/freebsd/os-proc.c
++++ b/bsd-user/freebsd/os-proc.c
+@@ -180,7 +180,7 @@ abi_long freebsd_exec_common(abi_ulong p
+         envc++;
+     }
+ 
+-    qarg0 = argp =  alloca((argc + 5) * sizeof(void *));
++    qarg0 = argp =  alloca((argc + 7) * sizeof(void *));
+     /* save the first agrument for the emulator */
+     *argp++ = (char *)getprogname();
+     qargp = argp;
+@@ -246,6 +246,11 @@ abi_long freebsd_exec_common(abi_ulong p
+             if (get_filename_from_fd(getpid(), (int)path_or_fd, execpath,
+                         sizeof(execpath)) != NULL) {
+                 *qarg1 = execpath;
++#ifndef DONT_INHERIT_INTERP_PREFIX
++                memmove(qarg1 + 2, qarg1, (qargend-qarg1) * sizeof(*qarg1));
++                *qarg1++ = (char *)"-L";
++                *qarg1++ = (char *)interp_prefix;
++#endif
+                 ret = get_errno(execve(qemu_proc_pathname, qargp, envp));
+             } else {
+                 /* Getting the filename path failed. */
+@@ -261,6 +266,13 @@ abi_long freebsd_exec_common(abi_ulong p
+                         sizeof(scriptpath)) != NULL) {
+                 *qargp = execpath;
+                 *qarg1 = scriptpath;
++#ifndef DONT_INHERIT_INTERP_PREFIX
++                memmove(qargp + 2, qargp, (qargend-qargp) * sizeof(*qargp));
++                qargp[0] = (char *)"-L";
++                qargp[1] = (char *)interp_prefix;
++                qarg1 += 2;
++                qargend += 2;
++#endif
+                 if (scriptargs) {
+                     memmove(qarg1 + 1, qarg1, (qargend-qarg1) * sizeof(*qarg1));
+                     *qarg1 = scriptargs;
+@@ -292,6 +304,11 @@ abi_long freebsd_exec_common(abi_ulong p
+             close(fd);
+             /* execve() as a target binary using emulator. */
+             *qarg1 = (char *)p;
++#ifndef DONT_INHERIT_INTERP_PREFIX
++            memmove(qarg1 + 2, qarg1, (qargend-qarg1) * sizeof(*qarg1));
++            *qarg1++ = (char *)"-L";
++            *qarg1++ = (char *)interp_prefix;
++#endif
+             ret = get_errno(execve(qemu_proc_pathname, qargp, envp));
+         } else if (is_target_shell_script(fd, execpath,
+                     sizeof(execpath), &scriptargs) != 0) {
+@@ -299,6 +316,13 @@ abi_long freebsd_exec_common(abi_ulong p
+             /* execve() as a target script using emulator. */
+             *qargp = execpath;
+             *qarg1 = (char *)p;
++#ifndef DONT_INHERIT_INTERP_PREFIX
++            memmove(qargp + 2, qargp, (qargend-qargp) * sizeof(*qargp));
++            qargp[0] = (char *)"-L";
++            qargp[1] = (char *)interp_prefix;
++            qarg1 += 2;
++            qargend += 2;
++#endif
+             if (scriptargs) {
+                 memmove(qarg1 + 1, qarg1, (qargend-qarg1) * sizeof(*qarg1));
+                 *qarg1 = scriptargs;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201404041906.s34J6G9o043735>