Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CPRMq-0005Cx-UZ for qemu-devel@nongnu.org; Wed, 03 Nov 2004 15:04:29 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CPRMq-0005Cl-IL for qemu-devel@nongnu.org; Wed, 03 Nov 2004 15:04:28 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CPRMq-0005Ci-GT for qemu-devel@nongnu.org; Wed, 03 Nov 2004 15:04:28 -0500 Received: from [213.95.27.120] (helo=ganesha.gnumonks.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CPREL-000862-Ii for qemu-devel@nongnu.org; Wed, 03 Nov 2004 14:55:42 -0500 Received: from dsl-082-083-225-146.arcor-ip.net ([82.83.225.146] helo=sunbeam.gnumonks.org) by ganesha.gnumonks.org with asmtp (TLSv1:RC4-SHA:128) (Exim 4.30) id 1CPREJ-0008CN-Nn for qemu-devel@nongnu.org; Wed, 03 Nov 2004 20:55:39 +0100 Received: from laforge by sunbeam.gnumonks.org with local (Exim 4.34) id 1CPREI-0001NJ-GF for qemu-devel@nongnu.org; Wed, 03 Nov 2004 20:55:38 +0100 Date: Wed, 3 Nov 2004 20:55:38 +0100 From: Harald Welte Message-ID: <20041103195538.GZ1950@sunbeam.de.gnumonks.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="a6YTfLRor63AaheO" Content-Disposition: inline Subject: [Qemu-devel] [PATCH] LD_LIBRARY_PATH for linux-user client application Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --a6YTfLRor63AaheO Content-Type: multipart/mixed; boundary="ZQ93ZA/51YEIDw4/" Content-Disposition: inline --ZQ93ZA/51YEIDw4/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! I've successfully managed to get IDA Pro 4.7 Linux/x86 running on my Linux/PPC Powerbook wit qemu-i386. It's running stable, I am amazed :) Unfortunately I had to make a small modification to qemu (see attached patch) in order to allow specification of a x86-specific LD_LIBRARY_PATH. If I set the real LD_LIBRARY_PATH on the host system, qemu won't work anymore, since it already respects this path. I think either this patch, or a more generic mechanism for passing a user-defined enviroment to the client program inside the emulation is a generally useful thing and should be considered for inclusion into qemu. Cheers, Harald --=20 - Harald Welte http://www.gnumonks.org/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D Programming is like sex: One mistake and you have to support it your lifeti= me --ZQ93ZA/51YEIDw4/ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="qemu-linux_user-ldpath.patch" Content-Transfer-Encoding: quoted-printable --- qemu/linux-user/main.c 2004-10-09 20:08:01.000000000 +0200 +++ qemu-ldpath/linux-user/main.c 2004-11-02 22:15:49.000000000 +0100 @@ -1015,6 +1015,21 @@ qemu_host_page_size */ env =3D cpu_init(); =20 + { +#define QLDP "QEMU_LD_LIBRARY_PATH" +#define LDP "LD_LIBRARY_PATH" + char *qldp =3D getenv(QLDP); + if (qldp && strlen(qldp) >=3D strlen(QLDP)+1) { + int size =3D strlen(qldp) + strlen(LDP); + char *ldp =3D malloc(size); + if (ldp) { + sprintf(ldp, "%s=3D%s", LDP, qldp); + fprintf(stderr, "LDP=3D`%s'\n", ldp); + putenv(ldp); + } + } + } + if (elf_exec(filename, argv+optind, environ, regs, info) !=3D 0) { printf("Error loading %s\n", filename); _exit(1); --ZQ93ZA/51YEIDw4/-- --a6YTfLRor63AaheO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFBiTe6XaXGVTD0i/8RAjT3AJ4/w50lzpYa1lrRwX2Rs/wcOx6n0ACfYwM1 IiJvtYGqHMHdegco5gIpFSU= =nyIh -----END PGP SIGNATURE----- --a6YTfLRor63AaheO--