From owner-svn-src-all@FreeBSD.ORG Mon Mar 30 17:12:25 2015 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1ABB5793 for ; Mon, 30 Mar 2015 17:12:25 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB6E2258 for ; Mon, 30 Mar 2015 17:12:24 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id t2UHCOBA048724 for ; Mon, 30 Mar 2015 17:12:24 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id t2UHCOni048723 for svn-src-all@FreeBSD.org; Mon, 30 Mar 2015 17:12:24 GMT (envelope-from bdrewery) Received: (qmail 5189 invoked from network); 30 Mar 2015 12:12:20 -0500 Received: from unknown (HELO ?10.10.1.139?) (freebsd@shatow.net@10.10.1.139) by sweb.xzibition.com with ESMTPA; 30 Mar 2015 12:12:20 -0500 Message-ID: <55198400.1040300@FreeBSD.org> Date: Mon, 30 Mar 2015 12:12:32 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Greg Lewis Subject: Re: svn commit: r280327 - in head/sys: kern vm References: <5516EB31.7000309@rice.edu> <201503300625.t2U6PE3c093114@gw.catspoiler.org> <20150330091209.GC2379@kib.kiev.ua> In-Reply-To: <20150330091209.GC2379@kib.kiev.ua> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="14QWRO38hCII64m64PCAsdf7M83WdKwCG" X-Mailman-Approved-At: Mon, 30 Mar 2015 17:23:57 +0000 Cc: src-committers@FreeBSD.org, alc@rice.edu, alc@FreeBSD.org, Don Lewis , clusteradm@FreeBSD.org, svn-src-head@FreeBSD.org, portmgr@FreeBSD.org, Konstantin Belousov , svn-src-all@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2015 17:12:25 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --14QWRO38hCII64m64PCAsdf7M83WdKwCG Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 3/30/2015 4:12 AM, Konstantin Belousov wrote: > On Sun, Mar 29, 2015 at 11:25:14PM -0700, Don Lewis wrote: >> On amd64, with an amd64 jail, and kernel rev r280326, I observe the >> following: >> One gcc process calls mmap() with addr=3D0 and len=3D0x657a000, and >> the value 0x811400000 is returned. Subsequent gcc processes >> call mmap() with addr=3D0x811400000 and len=3D0x657a000, getti= ng >> 0x811400000 in return. >> >> With kernel rev r280327 I see: >> One gcc process calls mmap() with addr=3D0 and len=3D0x657a000, and >> the value 0x811400000 is returned. Subsequent gcc processes >> call mmap() with addr=3D0x811400000 and len=3D0x657a000, getting >> 0x8115f4000 in return. What I later noticed is that the subsequent >> calls are passing offset=3D0x1f4000. Not so coincidentally, >> 0x811400000 + 0x1f4000 =3D 0x8115F4000. >> >> My first attempt at a fix subtracted offset from address, but the mmap= () >> return value changed to 0x8113f4000 instead of the 0x811400000 I was >> expecting. It looked to me like the code must be doing superpage >> alignment on the start of the file and then adding the offset to get t= he >> start of the mapped region. > So the real fix is to make gcc pass MAP_FIXED. >=20 >> >> This somewhat hacking patch disables this alignment if a non-zero >> address is passed as a hint, and allows the code to make the start of >> the mapped region match the hint. With this patch, I've been able to >> build openjdk7 in a FreeBSD 9.3 amd64 jail. >> > This is for precompiled headers, right ? Could port disable pch ? >=20 That is my opinion as well but I don't think it is enough. This gcc issue is quite old. Here is a 2004 reference for a similar issue on Cygwin. https://gcc.gnu.org/ml/gcc-bugs/2004-05/msg00559.html I think it is not enough to disable PCH in openjdk7. I am finding the "had to relocate PCH" error referenced in many other ports. I have ran into it randomly before as well. I think what we need to do is: 1. Fix GCC on head to use MAP_FIXED 2. Fix GCC ports to all use MAP_FIXED 3. Force ports that use PCH builds to use the port GCC or clang and not the base GCC in all releases. This patch should fix openjdk7 for now. My test build is still running. ~/svn/ports/java/openjdk7 # svn diff Index: Makefile =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 --- Makefile (revision 382519) +++ Makefile (working copy) @@ -26,7 +26,7 @@ WRKSRC=3D ${WRKDIR}/${PORTNAME} -USES=3D dos2unix iconv gmake zip +USES=3D compiler:features dos2unix iconv gmake zip USE_XORG+=3D x11 xext xi xrender xt xtst MAKE_ARGS=3D CC=3D${CC:Q} CXX=3D${CXX:Q} HOST_CC=3D${CC:Q} @@ -125,6 +125,10 @@ .include +.if ${COMPILER_TYPE} !=3D clang +MAKE_ENV+=3D USE_PRECOMPILED_HEADER=3D0 +.endif + .if empty(ICONV_LIB) MAKE_ENV+=3D EXTRA_CFLAGS=3D-DLIBICONV_PLUG .endif Index: files/patch-bsd =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 --- files/patch-bsd (revision 382519) +++ files/patch-bsd (working copy) @@ -184,16 +184,12 @@ # version 4 and above support fvisibility=3Dhidden (matches jni_x86.h f= ile) # except 4.1.2 gives pointless warnings that can't be disabled (afaik) ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) =3D 4 \) \& \( $(CC_VER_MINOR) \>=3D 3 \) \))" "0" -@@ -215,7 +218,11 @@ +@@ -215,7 +218,7 @@ # Flags for generating make dependency flags. ifneq ("${CC_VER_MAJOR}", "2") -DEPFLAGS =3D -fpch-deps -MMD -MP -MF $(DEP_DIR)/$(@:%=3D%.d) -+DEPFLAGS =3D -+ifeq (,$(findstring clang,$(shell $(CC) -v 2>&1))) -+DEPFLAGS +=3D -fpch-deps -+endif -+DEPFLAGS +=3D -MMD -MP -MF $(DEP_DIR)/$(@:%=3D%.d) ++DEPFLAGS =3D -MMD -MP -MF $(DEP_DIR)/$(@:%=3D%.d) endif # -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp. --=20 Regards, Bryan Drewery --14QWRO38hCII64m64PCAsdf7M83WdKwCG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJVGYQAAAoJEDXXcbtuRpfPQ6YIAK+HCvHgzKHT1YLsHQ1YyNHa ZkLkftkIau6QsZMSqj5RvfiqqZbvESxCBd6snhWwpPaHjLJAg/Aw8Tz4nBuVADht iT8scJMrZw1JbyFmjYTulCCfsft3AQeYv23eYUAM9u+2zqytWASbOccQyrTYo+y0 OQc2RLWIANSfLdOvbPDJnig7hHZtER9GwBMlEBnwrsWOjJKZOPLk4g0vY3naCeFB daEn0LuseLGObfKmUy5JJu6ok7NgKFQWsLazsnMhTwrSSVIHsoedr57V+vUAqlkX 7LVJ066JyER6x0tBBa3jiO99poaFTmLQK35moX7NsKY+74epIj5uQf5uG0btcpA= =yvvi -----END PGP SIGNATURE----- --14QWRO38hCII64m64PCAsdf7M83WdKwCG--