Closed
Bug 1504271
Opened 7 years ago
Closed 7 years ago
Firefox 64.0 compilation error with clang on Linux
Categories
(Firefox Build System :: General, defect)
Tracking
(Not tracked)
RESOLVED
INVALID
People
(Reporter: a1984993, Unassigned)
Details
Attachments
(1 file, 1 obsolete file)
66.58 KB,
application/gzip
|
Details |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Steps to reproduce:
I was trying to build firefox-64.0b4 with the following flags in mozconfig:
export CC="clang"
export CXX="clang++"
export CXXFLAGS="-stdlib=libc++"
Slackware Linux 14.1 64-bit
LLVM 7.0
Rust 1.29.1
Actual results:
Ran mach build and got several errors (see attached log for details):
obj-x86_64-pc-linux-gnu/dist/include/nsThreadUtils.h:1188:51: error: no template named 'index_sequence' in namespace 'std'
...
thread '<unnamed>' panicked at 'Failed to generate bindings, flags: ["/tmp/firefox-64.0b4/obj-x86_64-pc-linux-gnu/dist/include/mozilla/ServoBindings.h"
...
gmake[4]: *** [force-cargo-library-build] Error 101
gmake[3]: *** [toolkit/library/rust/target] Error 2
Expected results:
mach build runs without errors
Comment 1•7 years ago
|
||
Let's triage this issue in order to get somebody more knowledgeable on compilation errors than myself look into this report.
Component: Untriaged → General
Product: Firefox → Firefox Build System
Comment 2•7 years ago
|
||
I guess that means libc++ doesn't support std::index_sequence... Well then, you don't really have a choice: don't build with -stdlib=libc++. You may want to bring this up to libc++ upstream.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
I'm not sure that's the case, "libc++ is also a 100% complete C++14 implementation" according to libcxx.llvm.org.
It seems adding "-std=c++14" to CXXFLAGS has helped.
Another type of compilation errors was
error: use of undeclared identifier 'typeof'; did you mean 'typeid'
which seems to be solved by #define typeof __typeof__
I'm currently stuck with libfake.so linking errors.
When using ld (default):
cdm-test-decryptor.o: In function `FakeDecryptor::Message(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)':
/tmp/firefox-64.0b4/dom/media/fake-cdm/cdm-test-decryptor.cpp:90: undefined reference to `__cxa_guard_acquire'
When using lld:
ld.lld: error: undefined symbol: operator new(unsigned long)
>>> referenced by cdm-fake.cpp:61 (/tmp/firefox-64.0b4/dom/media/fake-cdm/cdm-fake.cpp:61)
(See attachment)
Do you know how these can be fixed? It seems like regression compared to Firefox 60 (ESR), which was able to compile and link using clang.
Attachment #9022205 -
Attachment is obsolete: true
![]() |
||
Comment 5•7 years ago
|
||
(In reply to a1984993 from comment #3)
> I'm not sure that's the case, "libc++ is also a 100% complete C++14
> implementation" according to libcxx.llvm.org.
> It seems adding "-std=c++14" to CXXFLAGS has helped.
Something must be broken in your setup, then, because we automatically add -std=gnu++14 to CXXFLAGS:
https://searchfox.org/mozilla-central/source/build/moz.configure/toolchain.configure#522-532
unless clang indicates that it already compiles as c++14 as the default. You shouldn't need to add -std=c++14.
Regarding the linker errors, it looks like clang can't find the C++ runtime libraries, which again suggests something is broken with your setup.
You need to log in
before you can comment on or make changes to this bug.
Description
•