Closed Bug 1287991 Opened 8 years ago Closed 6 years ago

"Multiple definition of" errors when compiling Firefox with Clang and -flto

Categories

(Firefox Build System :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: egoktas, Unassigned, NeedInfo)

Details

Attachments

(4 files)

'multiple definition of' errors are thrown when compiling Firefox with Clang. The {C,CXX,LD}FLAGS include the options -flto and either -O1 or -O2(see attached mozconfig files). Clang build must include LLVMgold.so. Also the gold linker (ld.gold) has to be set as the linker.

When compiling with -O1, a multiple definition error is thrown when libbrowsercomps.so is being built. Conflict happens between libxpcomglue_s.a and fallible.o. 
When compiling with -O2, multiple definition errors are thrown when libxul.so is being built. In this case the conflict happens between libjs_static.a and the following list of object files:
- modules/zlib/src/adler32.o
- modules/zlib/src/compress.o
- modules/zlib/src/crc32.o
- modules/zlib/src/deflate.o
- modules/zlib/src/gzclose.o
- modules/zlib/src/gzlib.o
- modules/zlib/src/gzread.o
- modules/zlib/src/gzwrite.o
- modules/zlib/src/inffast.o
- modules/zlib/src/inflate.o
- modules/zlib/src/inftrees.o
- modules/modules/zlib/src/trees.o
- modules/zlib/src/uncompr.o
- modules/zlib/src/zutil.o

Please see the attached error files for more details.

Versions used:
Firefox: git log -1, commit sha1: cab4a5aa0a76064577e964f55651d904da8c1091
OS: Ubuntu 14.04.4 LTS
LLVM/Clang: 3.8.1
ld.gold: binutils version 2.24
Attached file mozconfig_with_O1
Attached file mozconfig_with_O2
Is this still an issue?  There has been a lot of progress on using Clang in Linux builds recently.

See
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Compiling_Firefox_With_Clang_On_Linux

and bug 1480631
Flags: needinfo?(enes.goktas)
closing, please reopen if it is still an issue
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
Component: Build Config → General
Product: Firefox → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: