# firefox build problem



## YuryG (Oct 29, 2017)

Recently www/firefox (56.0.2_4,1 and 56.0.2_5,1) stopped building with this error (rust-1.21.0 is in use):


```
Compiling simd v0.2.0
error[E0432]: unresolved import `x86::sse2`
  --> /usr/ports/www/firefox/work/firefox-56.0.2/third_party/rust/simd/src/common.rs:17:10
   |
17 | use x86::sse2::common;
   |          ^^^^ Could not find `sse2` in `x86`

error: aborting due to previous error

/usr/local/bin/clang++40 -std=gnu++11 -o pkixocsp.o -c -I/usr/ports/www/firefox/work/firefox-56.0.2/obj-x86_64-unknown-freebsd10.4/dist/stl_wrappers -I/usr/ports/www/firefox/work/firefox-56.0.2/obj-x86_64-unknown-freebsd10.4/dist/system_wrappers -include /usr/ports/www/firefox/work/firefox-56.0.2/config/gcc_hidden.h -DNDEBUG=1 -DTRIMMED=1 -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/usr/ports/www/firefox/work/firefox-56.0.2/security/pkix -I/usr/ports/www/firefox/work/firefox-56.0.2/obj-x86_64-unknown-freebsd10.4/security/pkix -I/usr/ports/www/firefox/work/firefox-56.0.2/security/pkix/include -I/usr/ports/www/firefox/work/firefox-56.0.2/obj-x86_64-unknown-freebsd10.4/dist/include  -I/usr/local/include/nspr -I/usr/local/include/nss -I/usr/local/include/nss/nss -I/usr/local/include -I/usr/local/include  -I/usr/local/include/pixman-1   -fPIC  -DMOZILLA_CLIENT -include /usr/ports/www/firefox/work/firefox-56.0.2/obj-x86_64-unknown-freebsd10.4/mozilla-config.h -MD -MP -MF .deps/pkixocsp.o.pp -Qunused-arguments -D_GLIBCXX_USE_C99 -D_GLIBCXX_USE_C99_MATH_TR1  -D_DECLARE_C99_LDBL_MATH -DLIBICONV_PLUG -isystem /usr/local/include   -Qunused-arguments -Wall -Wc++11-compat -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wclass-varargs -Wloop-analysis -Wc++11-compat-pedantic -Wc++14-compat -Wc++14-compat-pedantic -Wc++1z-compat -Wcomma -Wimplicit-fallthrough -Wstring-conversion -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wformat -Wno-gnu-zero-variadic-macro-arguments -Wformat-security -Wno-unknown-warning-option -Wno-return-type-c-linkage -O2 -pipe -march=bdver2 -O3 -DLIBICONV_PLUG -fstack-protector -isystem /usr/local/include -fno-strict-aliasing -DLIBICONV_PLUG -isystem /usr/local/include -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pipe -I/usr/local/include  -O2 -O3 -fomit-frame-pointer  -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-missing-prototypes -Wno-missing-variable-declarations -Wno-padded -Wno-reserved-id-macro -Wno-shadow -Wno-weak-vtables -Wno-error=shadow  /usr/ports/www/firefox/work/firefox-56.0.2/security/pkix/lib/pkixocsp.cpp
error: Could not compile `simd`.
```

 FreeBSD 10.4-STABLE #0 r324759M amd64


----------



## sidetone (Oct 29, 2017)

Rust, Firefox and Thunderbird have had problems recently around c++ and llvm. Rust looks for the wrong filename equivalent of c++.


----------



## tobiam (Oct 29, 2017)

I can confirm this. Maybe makes sense to open a bug report.


----------



## sidetone (Oct 29, 2017)

It's reported. Make two links:
In the directory /usr/local/bin/, 
	
	



```
ln -s clang++40 c++
```
In the directory /usr/local/llvm40/bin/, or /usr/local/llvm50/bin/

```
ln -s clang c++
```
This builds lang/rust to completion. and I suspect for Firefox and Thunderbird too.

** Edit:* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223009 at the end, I think it's the same bug causing so many problems, but not limited to one architecture.


----------



## YuryG (Oct 29, 2017)

sidetone said:


> It's reported...


I couldn't find it, can you point me to that report?


----------



## YuryG (Oct 29, 2017)

sidetone said:


> …This builds lang/rust much farther, perhaps to completion, and I suspect for Firefox and Thunderbird too.
> 
> ** Edit:* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223009 at the end, I think it's the same bug causing so many problems, but not limited to one architecture.


I'm not sure if this is the relevant bug. I have amd64, not arch64, I have successfully built rust-1.21.0 (cannot say if it's fully functional, though). More than that, I have thunderbird-52.4.0_2 built and working.
But thank you, shall see.


----------



## sidetone (Oct 29, 2017)

YuryG said:


> I'm not sure if this is the relevant bug. I have amd64, not arch64, I have successfully built rust-1.21.0 (cannot say if it's fully functional, though). More than that, I have thunderbird-52.4.0_2 built and working.
> But thank you, shall see.


Thunderbird compiled on Rust or on just Clang?


----------



## YuryG (Oct 29, 2017)

I have RUST option ON for thunderbrd. Just tried to rebuild thunderbird to 52.4.0_3 revision and with luck.


----------



## YuryG (Oct 29, 2017)

Added PR 223302.
UPD. Occurred to be late for 18 minutes )) The actual PR is PR 223300 now.


----------



## cvnmjs (Oct 29, 2017)

I am facing this problem when building Firefox from up-to-date ports tree. FreeBSD 11.1 amd64
This occurred after updating to rust 1.21 I believe. Did not have any issues updating rust tho.
No CPUTYPE set in make.conf, just OPTIMIZED_CFLAGS toggled on.


----------



## cvnmjs (Oct 30, 2017)

so it seems from the linked bug report that the problem lies in toggling on the option in lang/rust to build against devel/llvm40 instead of the bundled llvm. Here goes.


----------



## ykla (Dec 19, 2018)

I met this issue today also. FreeBSD 12.0 firefox-esr


----------



## SirDice (Dec 19, 2018)

ykla said:


> I met this issue today also. FreeBSD 12.0 firefox-esr


Use the packages.


----------

