Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Aug 2015 17:15:44 +0200
From:      Jan Beich <jbeich@FreeBSD.org>
To:        John Marino <freebsd.contact@marino.st>
Cc:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org, marino@freebsd.org
Subject:   Re: svn commit: r394871 - in head: Mk mail/thunderbird mail/thunderbird/files www/firefox www/firefox-esr www/firefox-esr/files www/firefox/files www/libxul www/libxul/files www/seamonkey www/seamonkey...
Message-ID:  <y4h6-t2hr-wny@FreeBSD.org>
In-Reply-To: <55D5D3FC.9060001@marino.st> (John Marino's message of "Thu, 20 Aug 2015 15:19:56 %2B0200")
References:  <201508201316.t7KDGDPs042842@repo.freebsd.org> <55D5D3FC.9060001@marino.st>

next in thread | previous in thread | raw e-mail | index | archive | help
--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

John Marino <freebsd.contact@marino.st> writes:

F> On 8/20/2015 3:16 PM, Jan Beich wrote:
>
>> Author: jbeich
>> Date: Thu Aug 20 13:16:12 2015
>> New Revision: 394871
>> URL: https://svnweb.freebsd.org/changeset/ports/394871
>>=20
>> Log:
>>   gecko: use system jemalloc on 11.0-CURRENT again
>>=20=20=20
>>   Requested by:	mi
>>=20
>>=20
>> Modified: head/Mk/bsd.gecko.mk
>> =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=3D=3D
>> --- head/Mk/bsd.gecko.mk	Thu Aug 20 13:15:18 2015	(r394870)
>> +++ head/Mk/bsd.gecko.mk	Thu Aug 20 13:16:12 2015	(r394871)
>> @@ -130,7 +130,12 @@ LDFLAGS+=3D		-L${LOCALBASE}/lib -Wl,-rpath
>>=20=20
>>  # use jemalloc 3.0.0 API for stats/tuning
>>  MOZ_EXPORT+=3D	MOZ_JEMALLOC3=3D1
>> -.if ${OSVERSION} < 1000012 || ${MOZILLA_VER:R:R} >=3D 37
>> +.if ${OSVERSION} >=3D 1100079
>> +. if ${MOZILLA_VER:R:R} < 43
>> +# system jemalloc 4.0.0 vs. bundled jemalloc 3.6.0-204-gb4acf73
>> +EXTRA_PATCHES+=3D	${FILESDIR}/extra-patch-bug1125514
>> +. endif
>> +.elif ${OSVERSION} < 1000012 || ${MOZILLA_VER:R:R} >=3D 37
>>  MOZ_OPTIONS+=3D	--enable-jemalloc
>>  .endif
>>=20=20
>
>
> By switching the comparison from < to >=3D, I think this just broke
> DragonFly which does not support jemalloc on any version.

Ahem, OSVERSION=3D9999999 in DPorts' bsd.port.mk isn't sane either.
Either emulate it (along with OSREL) via USES=3Dalias, derive from
__DragonFly_version or force breakage by not defining it.

=2D-enable-jemalloc is a toggle for bundled jemalloc. Without it the build
defaults to system malloc. configure also checks if system malloc
supports jemalloc non-standard API. The API is mainly used for
about:memory. However, lack of malloc_usable_size() may impact
performance but it is usually available elsewhere (musl, glibc, etc).

files/extra-patch-bug1125514 should be a nop for DragonFly, FreeBSD 9.x
and FreeBSD 10.x. It can cause garbage in memory stats for bundled jemalloc
but otherwise explicitly separated by make(1) conditional.

My intent is to make DragonFly use bundled jemalloc like older releases
of FreeBSD. Try applying below commit under ${WRKSRC}/memory/jemalloc.

https://github.com/jemalloc/jemalloc/commit/1aa25a3

> I would guess the fix would be to check OPSYS before using OSVERSION.

To avoid undefined behavior OPSYS check has to be added twice for (large
and small) OSVERSION. Or maybe inverse it like

  # use jemalloc 3.0.0 API for stats/tuning
  MOZ_EXPORT+=3D	MOZ_JEMALLOC3=3D1
  .if ${OPSYS} !=3D FreeBSD || (${OSVERSION} < 1000012 || \
          (${MOZILLA_VER:R:R} >=3D 37 && ${OSVERSION} < 1100079))
  MOZ_OPTIONS+=3D	--enable-jemalloc
  .else
  . if ${MOZILLA_VER:R:R} < 43
  # system jemalloc 4.0.0 vs. bundled jemalloc 3.6.0-204-gb4acf73
  EXTRA_PATCHES+=3D	${FILESDIR}/extra-patch-bug1125514
  . endif
  .endif

>
> Thanks,
> John

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQF8BAEBCgBmBQJV1e8hXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF
NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3beOoH/3WmkWxOdun55ylacjb9Ohld
+sEavl55gNle2PmIBvfiRvlFs6lMU3kwcHxZ17oGuFGxRIB712ic2blueYFUA2vG
3YIlIuObUANChJIvFgpeULoQhAA5qmjvPaE20bKQLQ7Hl9zG0g3cc2cLLfcJhYJ5
ojnV3voX2ME2HVyZCkXBit7rT4GM0xVZ3lrX9phwlQX95ILjQTGtAxajiK5jFKAC
HZmq+DM3PqxV0kyr1sHgNOXOBplcGW9zQB1BPjF5H+aVJU26UVk+F9QpEcQqLSY2
OsNmBv3sEBToSCqX1O1mHGluWP2KBXm47X2DMeI4mO+2Lp+g6uToIeI+OAJjW2Y=
=FLl+
-----END PGP SIGNATURE-----
--=-=-=--



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