pkgsrc-Bugs archive


pkg/40760: www/firefox3: fails to build with mozilla-jemalloc

>Number:         40760
>Category:       pkg
>Synopsis:       www/firefox3 fails to build when enabling mozilla-jemalloc
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 26 15:00:01 +0000 2009
>Originator:     Thomas E. Spanjaard
>Release:        NetBSD 5.99.7
        Thomas E. Spanjaard
System: NetBSD hydra 5.99.7 NetBSD 5.99.7 (HYDRA) #0: Tue Feb 24 12:18:43 UTC 
2009 tgen@hydra:/home/obj/tgen-netbsd-current/sys/arch/amd64/compile/HYDRA amd64
Architecture: x86_64
Machine: amd64
When enabling the Mozilla-provided jemalloc memory allocator for www/firefox3,
it fails to build, or more precisely link, as the object
contains a call(s) to __tls_get_addr. NetBSD doesn't currently support TLS,
and the compiler shouldn't ever generate such calls, but it does. The compiler
used is the one in NetBSD base, gcc 4.1.3 built from monday's sources
(userland is in sync with the 5.99.7 kernel). Tracing the presence of the
__tls_get_addr symbol in the cc1 (and cc1obj, cc1plus) binaries reveals it
ultimately comes from the i386.o object file, which is compiled from

This is the first time I've seen this gcc generate that call; for all the
other binaries I built with it (a full pkg_rolling-replace), no __tls_get_addr
call(s) were generated. As to why it was generated in this case I can only
guess, as it only turned up at linking time, when any libjemalloc compile
warnings or errors had long been kicked out of the console's scrollback buffer.

As the Mozilla build system appears as a bit of a mess to me, I couldn't find
any obvious reasons for this behaviour either. However, it should be
1. Add 'mozilla-jemalloc' to PKG_OPTIONS.gecko.
2. Make www/firefox3.
A temporary stopgap would be to disable the mozilla-jemalloc option (which
would have the side effect of other Mozilla applications like Thunderbird
stop complaining about unsupported options). Depending on what the origin of
this issue is, it would either require gcc4 in base to be fixed so it doesn't
emit __tls_get_addr calls, or fix any particular flags used when compiling
memory/jemalloc/jemalloc.c from Mozilla that trigger this behaviour.


Home | Main Index | Thread Index | Old Index