Multiple definition error during Firefox build
Hi,
I'm working on building firefox using my modified LLVM.
I used below ".mozconfig" file (to build) and if I try to build it, I got multiple definition errors.
Could you let me know what was wrong ?
- I thought it will be "-lstdc++" option.
- But I need "-lstdc++" options.
[".mozconfig" file]
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/testfirefox
mk_add_options MOZ_MAKE_FLAGS=-j8
export LLVM_HOME="/home/jeon41/hextype/HexType"
export CC="$LLVM_HOME/build/bin/clang"
export CXX="$LLVM_HOME/build/bin/clang++"
export CFLAGS="-fsanitize=testfirefox -lunwind -lstdc++ -lm"
export CXXFLAGS="-fsanitize=testfirefox -lunwind"
ac_add_options --disable-crashreporter
ac_add_options --disable-elf-hack
ac_add_options --enable-application=browser
ac_add_options --disable-jemalloc
ac_add_options --enable-llvm-hacks
ac_add_options --enable-optimize="-O2 -gline-tables-only"
ac_add_options --disable-install-strip
ac_add_options --disable-tree-freetype
ac_add_options --disable-debug
ac_add_options --disable-tests
[Error Message]
/usr/bin/ld: error: ../../modules/zlib/src/trees.o: multiple definition of 'MOZ_Z__length_code'
/usr/bin/ld: ../../js/src/libjs_static.a(trees.o): previous definition here
/usr/bin/ld: error: ../../modules/zlib/src/trees.o: multiple definition of 'MOZ_Z__tr_align'
/usr/bin/ld: ../../js/src/libjs_static.a(trees.o): previous definition here
/usr/bin/ld: error: ../../modules/zlib/src/trees.o: multiple definition of 'MOZ_Z__tr_flush_bits'
/usr/bin/ld: ../../js/src/libjs_static.a(trees.o): previous definition here
/usr/bin/ld: error: ../../modules/zlib/src/trees.o: multiple definition of 'MOZ_Z__tr_flush_block'
/usr/bin/ld: ../../js/src/libjs_static.a(trees.o): previous definition here
/usr/bin/ld: error: ../../modules/zlib/src/trees.o: multiple definition of 'MOZ_Z__tr_init'
/usr/bin/ld: ../../js/src/libjs_static.a(trees.o): previous definition here
/usr/bin/ld: error: ../../modules/zlib/src/trees.o: multiple definition of 'MOZ_Z__tr_stored_block'
/usr/bin/ld: ../../js/src/libjs_static.a(trees.o): previous definition here
/usr/bin/ld: error: ../../modules/zlib/src/trees.o: multiple definition of 'MOZ_Z__tr_tally'
/usr/bin/ld: ../../js/src/libjs_static.a(trees.o): previous definition here
/usr/bin/ld: error: ../../modules/zlib/src/uncompr.o: multiple definition of 'MOZ_Z_uncompress'
/usr/bin/ld: ../../js/src/libjs_static.a(uncompr.o): previous definition here
/usr/bin/ld: error: ../../modules/zlib/src/zutil.o: multiple definition of 'MOZ_Z_zError'
/usr/bin/ld: ../../js/src/libjs_static.a(zutil.o): previous definition here
/usr/bin/ld: error: ../../modules/zlib/src/zutil.o: multiple definition of 'MOZ_Z_z_errmsg'
/usr/bin/ld: ../../js/src/libjs_static.a(zutil.o): previous definition here
/usr/bin/ld: error: ../../modules/zlib/src/zutil.o: multiple definition of 'MOZ_Z_zcalloc'
/usr/bin/ld: ../../js/src/libjs_static.a(zutil.o): previous definition here
/usr/bin/ld: error: ../../modules/zlib/src/zutil.o: multiple definition of 'MOZ_Z_zcfree'
/usr/bin/ld: ../../js/src/libjs_static.a(zutil.o): previous definition here
/usr/bin/ld: error: ../../modules/zlib/src/zutil.o: multiple definition of 'MOZ_Z_zlibCompileFlags'
/usr/bin/ld: ../../js/src/libjs_static.a(zutil.o): previous definition here
/usr/bin/ld: error: ../../modules/zlib/src/zutil.o: multiple definition of 'MOZ_Z_zlibVersion'
/usr/bin/ld: ../../js/src/libjs_static.a(zutil.o): previous definition here
.........................
clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation)
/home/jeon41/hextype/firefox/polyable/mozilla-central/config/rules.mk:800: recipe for target 'libxul.so' failed
make[5]: *** [libxul.so] Error 1
make[5]: Leaving directory '/home/jeon41/hextype/firefox/polyable/mozilla-central/hextype/toolkit/library'
/home/jeon41/hextype/firefox/polyable/mozilla-central/config/recurse.mk:71: recipe for target 'toolkit/library/target' failed
make[4]: *** [toolkit/library/target] Error 2
make[4]: *** Waiting for unfinished jobs....
tlibunicharutil_external_s.a
rm -f libunicharutil_external_s.a libunicharutil_external_s.a.desc
/home/jeon41/hextype/firefox/polyable/mozilla-central/hextype/_virtualenv/bin/python
/home/jeon41/hextype/firefox/polyable/mozilla-central/config/expandlibs_exec.py --extract -- ar crs libunicharutil_external_s.a
Unified_cpp_unicharutil_util0.o ../../../config/external/icu/libicu.a
libunicharutil_external_s.a.desc
/home/jeon41/hextype/firefox/polyable/mozilla-central/hextype/_virtualenv/bin/python
/home/jeon41/hextype/firefox/polyable/mozilla-central/config/expandlibs_gen.py -o libunicharutil_external_s.a.desc
Unified_cpp_unicharutil_util0.o ../../../config/external/icu/libicu.a
../../../config/nsinstall -R -m 644 'libunicharutil_external_s.a' '../../../dist/sdk/lib'
make[5]: Leaving directory '/home/jeon41/hextype/firefox/polyable/mozilla-central/hextype/intl/unicharutil/util'
make[4]: Leaving directory '/home/jeon41/hextype/firefox/polyable/mozilla-central/hextype'
/home/jeon41/hextype/firefox/polyable/mozilla-central/config/recurse.mk:32: recipe for target 'compile' failed
make[3]: *** [compile] Error 2
make[3]: Leaving directory '/home/jeon41/hextype/firefox/polyable/mozilla-central/hextype'
/home/jeon41/hextype/firefox/polyable/mozilla-central/config/rules.mk:523: recipe for target 'default' failed
make[2]: *** [default] Error 2
make[2]: Leaving directory '/home/jeon41/hextype/firefox/polyable/mozilla-central/hextype'
/home/jeon41/hextype/firefox/polyable/mozilla-central/client.mk:413: recipe for target 'realbuild' failed
Okulungisiwe
All Replies (1)
hi, support.mozilla.org is intended for end user support and we probably won't have the expertise to help you with development/build issues - please refer to https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Mozilla_build_FAQ#Getting_Help if you need help :-)