为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Multiple definition error during Firefox build

  • 1 个回答
  • 1 人有此问题
  • 1 次查看
  • 最后回复者为 philipp

more options

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

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

由jys0710于修改

所有回复 (1)

more options

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 :-)