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...

Jan Beich jbeich at FreeBSD.org
Thu Aug 20 15:16:25 UTC 2015


John Marino <freebsd.contact at 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
>> 
>> Log:
>>   gecko: use system jemalloc on 11.0-CURRENT again
>>   
>>   Requested by:	mi
>> 
>> 
>> Modified: head/Mk/bsd.gecko.mk
>> ==============================================================================
>> --- 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+=		-L${LOCALBASE}/lib -Wl,-rpath
>>  
>>  # use jemalloc 3.0.0 API for stats/tuning
>>  MOZ_EXPORT+=	MOZ_JEMALLOC3=1
>> -.if ${OSVERSION} < 1000012 || ${MOZILLA_VER:R:R} >= 37
>> +.if ${OSVERSION} >= 1100079
>> +. if ${MOZILLA_VER:R:R} < 43
>> +# system jemalloc 4.0.0 vs. bundled jemalloc 3.6.0-204-gb4acf73
>> +EXTRA_PATCHES+=	${FILESDIR}/extra-patch-bug1125514
>> +. endif
>> +.elif ${OSVERSION} < 1000012 || ${MOZILLA_VER:R:R} >= 37
>>  MOZ_OPTIONS+=	--enable-jemalloc
>>  .endif
>>  
>
>
> By switching the comparison from < to >=, I think this just broke
> DragonFly which does not support jemalloc on any version.

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

--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+=	MOZ_JEMALLOC3=1
  .if ${OPSYS} != FreeBSD || (${OSVERSION} < 1000012 || \
          (${MOZILLA_VER:R:R} >= 37 && ${OSVERSION} < 1100079))
  MOZ_OPTIONS+=	--enable-jemalloc
  .else
  . if ${MOZILLA_VER:R:R} < 43
  # system jemalloc 4.0.0 vs. bundled jemalloc 3.6.0-204-gb4acf73
  EXTRA_PATCHES+=	${FILESDIR}/extra-patch-bug1125514
  . endif
  .endif

>
> Thanks,
> John
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 602 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-ports-head/attachments/20150820/86ed7bdb/attachment.bin>


More information about the svn-ports-head mailing list