# Installing Firefox from /usr/ports/www/firefox



## Zack (Aug 10, 2015)

I have had this issue with compiling Firefox.
/usr/ports/www/firefox

```
../../build/unix/gold/ld: error: /usr/ports/www/firefox/work/mozilla-release/obj-x86_64-portbld-freebsd10.1/toolkit/library/../../js/src/Unified_cpp_js_src3.o: multiple definition of '__dtraceenabled_javascript___function-return'
../../build/unix/gold/ld: /usr/ports/www/firefox/work/mozilla-release/obj-x86_64-portbld-freebsd10.1/toolkit/library/../../js/src/Unified_cpp_js_src12.o: previous definition here
../../build/unix/gold/ld: error: /usr/ports/www/firefox/work/mozilla-release/obj-x86_64-portbld-freebsd10.1/toolkit/library/../../js/src/Unified_cpp_js_src4.o: multiple definition of '__dtraceenabled_javascript___function-return'
../../build/unix/gold/ld: /usr/ports/www/firefox/work/mozilla-release/obj-x86_64-portbld-freebsd10.1/toolkit/library/../../js/src/Unified_cpp_js_src12.o: previous definition here
../../build/unix/gold/ld: error: /usr/ports/www/firefox/work/mozilla-release/obj-x86_64-portbld-freebsd10.1/toolkit/library/../../js/src/Unified_cpp_js_src8.o: multiple definition of '__dtrace_javascript___object-create'
../../build/unix/gold/ld: /usr/ports/www/firefox/work/mozilla-release/obj-x86_64-portbld-freebsd10.1/toolkit/library/../../js/src/jsarray.o: previous definition here
../../build/unix/gold/ld: error: /usr/ports/www/firefox/work/mozilla-release/obj-x86_64-portbld-freebsd10.1/toolkit/library/../../js/src/Unified_cpp_js_src8.o: multiple definition of '__dtraceenabled_javascript___object-create'
../../build/unix/gold/ld: /usr/ports/www/firefox/work/mozilla-release/obj-x86_64-portbld-freebsd10.1/toolkit/library/../../js/src/jsarray.o: previous definition here
/usr/ports/www/firefox/work/mozilla-release/ipc/chromium/src/base/process_util_bsd.cc:117: warning: undefined reference to 'environ'
/usr/ports/www/firefox/work/mozilla-release/ipc/chromium/src/base/process_util_bsd.cc:117: warning: undefined reference to 'environ'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
/usr/ports/www/firefox/work/mozilla-release/config/rules.mk:815: recipe for target 'libxul.so' failed
gmake[7]: *** [libxul.so] Error 1
gmake[7]: Leaving directory '/usr/ports/www/firefox/work/mozilla-release/obj-x86_64-portbld-freebsd10.1/toolkit/library'
/usr/ports/www/firefox/work/mozilla-release/config/recurse.mk:70: recipe for target 'toolkit/library/target' failed
gmake[6]: *** [toolkit/library/target] Error 2
gmake[6]: Leaving directory '/usr/ports/www/firefox/work/mozilla-release/obj-x86_64-portbld-freebsd10.1'
/usr/ports/www/firefox/work/mozilla-release/config/recurse.mk:32: recipe for target 'compile' failed
gmake[5]: *** [compile] Error 2
gmake[5]: Leaving directory '/usr/ports/www/firefox/work/mozilla-release/obj-x86_64-portbld-freebsd10.1'
/usr/ports/www/firefox/work/mozilla-release/config/rules.mk:538: recipe for target 'default' failed
gmake[4]: *** [default] Error 2
gmake[4]: Leaving directory '/usr/ports/www/firefox/work/mozilla-release/obj-x86_64-portbld-freebsd10.1'
/usr/ports/www/firefox/work/mozilla-release/client.mk:400: recipe for target 'realbuild' failed
gmake[3]: *** [realbuild] Error 2
gmake[3]: Leaving directory '/usr/ports/www/firefox/work/mozilla-release'
/usr/ports/www/firefox/work/mozilla-release/client.mk:171: recipe for target 'build' failed
gmake[2]: *** [build] Error 2
gmake[2]: Leaving directory '/usr/ports/www/firefox/work/mozilla-release'
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/www/firefox
*** Error code 1

Stop.
make: stopped in /usr/ports/www/firefox

===>>> make build failed for www/firefox
===>>> Aborting update

===>>> Update for www/firefox failed
===>>> Aborting update
```
Here is /etc/make.conf

```
CC=clang CXX=clang++ CPP=clang-cpp WITH_PKGNG=YES MAKE_JOBS_UNSAFE=YES BUILD_OPTIMIZED=YES WITHOUT_DEBUG=YES OPTIONS_UNSET="OPTIMIZED_CFLAGS PGO"
```


----------



## talsamon (Aug 10, 2015)

Remove all from /etc/make.conf no need for all of these entries. (especially BUILD_OPTIMIZED e.g. causes errors with firefox).


----------



## Zack (Aug 11, 2015)

talsamon said:


> Remove all from /etc/make.conf no need for all of these entries. (especially BUILD_OPTIMIZED e.g. causes errors with firefox).


Removing those from /etc/make.conf gives the same results.


----------



## talsamon (Aug 11, 2015)

What shows `make showconfig` (in the port).


----------



## Zack (Aug 11, 2015)

`make showconfig`

```
===> The following configuration options are available for firefox-40.0_1,1:
  BUNDLED_CAIRO=off: Use bundled fork of cairo-1.9.5
  CANBERRA=off: Sound theme alerts
  DBUS=on: D-Bus IPC system support
  DEBUG=on: Build with debugging support
  DTRACE=on: Build with DTrace probes
  GCONF=off: GConf configuration backend support
  GIO=on: Use GIO for file I/O
  GNOMEUI=off: libgnomeui support module
  GSTREAMER=on: Multimedia support via GStreamer
  LIBPROXY=off: Proxy support via libproxy
  OPTIMIZED_CFLAGS=off: Use extra compiler optimizations
  PGO=off: Use Profile-Guided Optimization
  PROFILE=off: Build with profiling support
  TEST=off: Build and/or run tests
====> Options available for the multi AUDIO: you have to choose at least one of them
  ALSA=on: ALSA audio architecture support
  PULSEAUDIO=off: PulseAudio sound server support
====> Options available for the single TOOLKIT: you have to select exactly one of them
  GTK2=off: GTK+ 2 GUI toolkit support
  GTK3=on: GTK+ 3 GUI toolkit support
===> Use 'make config' to modify these settings
```


----------



## talsamon (Aug 11, 2015)

Set DEBUG=off and DTRACE=off.
(Do you run after each try `make clean` ?)


----------



## Zack (Aug 11, 2015)

talsamon said:


> Set DEBUG=off and DTRACE=off.
> (Do you run after each try `make clean` ?)


I will try this, yes I do run `make clean`


----------



## talsamon (Aug 11, 2015)

That's should it be. I try it on my machine with DEBUG=on and DTRACE=on. It causes "your" error.


----------



## Zack (Aug 11, 2015)

talsamon said:


> That's should it be. I try it on my machine with `DEBUG=on` and `DTRACE=on`. I causes "your" error.


We will have to see. Compiling on my laptop takes a bit of time


----------



## talsamon (Aug 11, 2015)

Few minutes ago on http://www.freshports.org/ :



> *thunderbird 38.1.0_1* mail Mozilla Thunderbird is standalone mail and news that stands above
> *openh264 1.4.0_4* multimedia Cisco implementation of H.264 codec
> *firefox 40.0_2,1* www  Web browser based on the browser portion of Mozilla
> *firefox-esr 38.2.0_1,1* www Web browser based on the browser portion of Mozilla
> ...



Now firefox compiles  with DEBUG=on (but not with DEBUG=on and DTRACE=on - causes an other error as above).
------

Don't know if I should add this to PR 202218.


----------



## talsamon (Aug 11, 2015)

Here the error with DEBUG=on and DTRACE=on:


```
c++: error: unable to execute command: Segmentation fault (core dumped)
c++: note: diagnostic msg: Error generating preprocessed source(s).
/usr/ports/www/firefox/work/mozilla-release/config/rules.mk:946: recipe for target 'Unified_cpp_dom_mobilemessage0.o' failed
gmake[7]: *** [Unified_cpp_dom_mobilemessage0.o] Error 254
gmake[7]: Leaving directory '/usr/ports/www/firefox/work/mozilla-release/obj-x86_64-portbld-freebsd10.1/dom/mobilemessage'
/usr/ports/www/firefox/work/mozilla-release/config/recurse.mk:70: recipe for target 'dom/mobilemessage/target' failed
gmake[6]: *** [dom/mobilemessage/target] Error 2
gmake[6]: *** Waiting for unfinished jobs....
libgfx_gl.a.desc
rm -f libgfx_gl.a
/usr/ports/www/firefox/work/mozilla-release/obj-x86_64-portbld-freebsd10.1/_virtualenv/bin/python /usr/ports/www/firefox/work/mozilla-release/config/expandlibs_gen.py -o libgfx_gl.a.desc GLContextProviderGLX.o Unified_cpp_gfx_gl0.o Unified_cpp_gfx_gl1.o
gmake[7]: Leaving directory '/usr/ports/www/firefox/work/mozilla-release/obj-x86_64-portbld-freebsd10.1/gfx/gl'
gmake[6]: Leaving directory '/usr/ports/www/firefox/work/mozilla-release/obj-x86_64-portbld-freebsd10.1'
gmake[5]: *** [compile] Error 2
/usr/ports/www/firefox/work/mozilla-release/config/recurse.mk:32: recipe for target 'compile' failed
gmake[5]: Leaving directory '/usr/ports/www/firefox/work/mozilla-release/obj-x86_64-portbld-freebsd10.1'
gmake[4]: *** [default] Error 2
/usr/ports/www/firefox/work/mozilla-release/config/rules.mk:538: recipe for target 'default' failed
gmake[4]: Leaving directory '/usr/ports/www/firefox/work/mozilla-release/obj-x86_64-portbld-freebsd10.1'
gmake[3]: *** [realbuild] Error 2
/usr/ports/www/firefox/work/mozilla-release/client.mk:400: recipe for target 'realbuild' failed
gmake[3]: Leaving directory '/usr/ports/www/firefox/work/mozilla-release'
gmake[2]: *** [build] Error 2
/usr/ports/www/firefox/work/mozilla-release/client.mk:171: recipe for target 'build' failed
gmake[2]: Leaving directory '/usr/ports/www/firefox/work/mozilla-release'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/www/firefox
*** Error code 1

Stop.
make: stopped in /usr/ports/www/firefox
```


----------



## tingo (Aug 13, 2015)

You should definitely add it to the PR. It doesn't hurt, and it might help.


----------



## talsamon (Aug 13, 2015)

Thanks, I have done it.


----------

