From owner-freebsd-current@freebsd.org Wed Dec 7 22:31:19 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFCBFC6C807; Wed, 7 Dec 2016 22:31:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 609191CC7; Wed, 7 Dec 2016 22:31:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::6179:ed89:b8e0:319b] (unknown [IPv6:2001:7b8:3a7:0:6179:ed89:b8e0:319b]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id E002336C00; Wed, 7 Dec 2016 23:31:09 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_3E8F0075-CBAE-4E4D-973E-9A148AA62495"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: emulators/qemu: qemu ports failing due to compiler error on 12-CURRENT From: Dimitry Andric In-Reply-To: <20161207104203.7c9524a3@thor.walstatt.dynvpn.de> Date: Wed, 7 Dec 2016 23:31:01 +0100 Cc: FreeBSD CURRENT , FreeBSD Ports , Ed Maste Message-Id: <782FAC01-9A7C-438F-912C-831628A08E63@FreeBSD.org> References: <20161207104203.7c9524a3@thor.walstatt.dynvpn.de> To: "O. Hartmann" X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 22:31:19 -0000 --Apple-Mail=_3E8F0075-CBAE-4E4D-973E-9A148AA62495 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 07 Dec 2016, at 10:42, O. Hartmann wrote: >=20 > I try my first steps in cross compiling ports with poudriere and = therefore I try to setup > an appropriate jail and QEMU environment. >=20 > Well, I'm failing at the jail setup due to the non-exitence of any = suitable QEMU > environment and for that I tried to figure out to find some proper = HOWTO. > Searching via google ave some hints, but in questions which QEMU from = ports should be > used, all leave me alone, so I tried >=20 > emulators/qemu > emulators/qemu-devel > emulators/qemu-static >=20 > emulators/qemu is known for me to fail since months and the days of = 11-CURRENT, there is a > compiler error spit out with clang 3.8 and now 3.9. The very same for = qemu-devel (both > ports used with standard options, no extras). See also Bug 214873 > (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D214873) and Bug = 215100 > (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D215100). I couldn't reproduce the compilation errors, it builds fine for me until the link phase. > I tried also emulators/qemu-static, but it also fails compiling on = most recent 12-CURRENT > (as the others, too, also my poudriere environment, which has also = CURRENT jails) with >=20 > [...] > /usr/bin/ld:../config-host.ld:14: syntax error > c++: error: linker command failed with exit code 1 (use -v to see = invocation) > [...] But this I *can* reproduce. It appears qemu wants to set the text segment start address, using the -Ttext-segment=3D0x60000000 option to = ld. However, our base ld does not yet support this option, and then the configure script tries to patch the default linker script using the following construct: $ld --verbose | sed \ -e '1,/=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/d' \ -e '/=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/,$d' \ -e "s/[.] =3D [0-9a-fx]* [+] SIZEOF_HEADERS/. =3D $textseg_addr = + SIZEOF_HEADERS/" \ -e "s/__executable_start =3D [0-9a-fx]*/__executable_start =3D = $textseg_addr/" > config-host.ld Unfortunately, it seems to run /usr/local/bin/ld in this case, and this results in the following busted linker script line, which cannot be parsed: PROVIDE (__executable_start =3D = 0x60000000SEGMENT_START("text-segment", 0x08048000)); . =3D = SEGMENT_START("text-segment", 0x08048000) + SIZEOF_HEADERS; If it would use /usr/bin/ld instead, the patching would succeed, and the line would become: PROVIDE (__executable_start =3D 0x60000000); . =3D 0x60000000 + = SIZEOF_HEADERS; which is probably what was intended. Probably, the configure script needs to be patched to run base ld, or use the same ld invocation for both checking the -Ttext-segment option support and patching the linker script. -Dimitry --Apple-Mail=_3E8F0075-CBAE-4E4D-973E-9A148AA62495 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAlhIja0ACgkQsF6jCi4glqMmngCgyM/Ausmn/Zsrl+ILpdtjesnT hxQAoIdwRF7FjLthxBQODKpI+R2p0UVL =Re2a -----END PGP SIGNATURE----- --Apple-Mail=_3E8F0075-CBAE-4E4D-973E-9A148AA62495--