Closed Bug 854936 Opened 12 years ago Closed 7 years ago

firefox trunk does not link with clang on i686-pc-linux-gnu

Categories

(Core :: XPConnect, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: cmue81, Unassigned)

References

Details

Attachments

(4 files)

User Agent: Opera/9.80 (Android 2.3.7; Linux; Opera Mobi/ADR-1301080958) Presto/2.11.355 Version/12.10 Steps to reproduce: compiled FF Actual results: linking failed, because the functions enclosed in an "extern C" block are marked static and optimized away (even though __attribute__ ((__used__)) is present) for these two following files: xptcinvoke_gcc_x86_unix.cpp xptcstubs_gcc_x86_unix.cpp Removing the static keyword solves the problem, but I need someone to review, if this is a proper fix. If I don't remove it, xptcshell fails during client.mk install, complaining for undefined reference to these functions within libxul.so Greetings
stops at "/usr/bin/ld" --eh-frame-hdr -m elf_i386 -shared -o libxul.so /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../crti.o /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/crtbeginS.o -L../../dist/bin -L../../dist/lib -L/usr/lib -L/usr/lib -L../../dist/bin -L../../dist/lib -L/usr/lib -L/usr/lib/gcc/i686-pc-linux-gnu/4.7.2 -L/usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../i686-pc-linux-gnu/lib -L/usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../.. -L/lib -L/usr/lib -z defs --gc-sections -h libxul.so /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/tmp01qZqa.list -lpthread --as-needed -O1 --hash-style=gnu --sort-common -z noexecstack --icf=safe -rpath-link /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/dist/bin -rpath-link /usr/lib ../../dist/lib/libxpt.a -version-script symverscript ../../dist/lib/libjs_static.a -lffi -lssl3 -lsmime3 -lnss3 -lnssutil3 -lcrmf -lcairo -lcairo -lXext -lXrender -lX11 -lsqlite3 -ljpeg -lpng -lz -lhunspell-1.3 -levent -lvpx -lpixman-1 -lasound -lplds4 -lplc4 -lnspr4 -lpthread -ldl ../../dist/lib/libmozalloc.so -ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0 -lX11 -lXext -lpangoft2-1.0 -lfreetype -lfontconfig -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lcairo -lfontconfig -lgtk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lfreetype -lfontconfig -lgdk-x11-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lXt -lgthread-2.0 -lfreetype -lgstapp-0.10 -lgstbase-0.10 -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lxml2 -lgstvideo-0.10 -ldl -lrt -lstdc++ -lm -lgcc_s -lpthread -lc -lgcc_s /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/crtendS.o /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../crtn.o /usr/bin/ld: warning: hidden symbol 'hb_buffer_set_unicode_funcs' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-buffer.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_buffer_create' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-buffer.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_buffer_destroy' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-buffer.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_buffer_reset' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-buffer.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_buffer_add' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-buffer.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_buffer_set_direction' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-buffer.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_buffer_get_length' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-buffer.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_buffer_get_glyph_infos' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-buffer.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_buffer_reverse' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-buffer.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_buffer_get_direction' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-buffer.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_buffer_get_glyph_positions' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-buffer.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_face_destroy' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-font.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_ot_layout_table_find_script' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-ot-layout.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_ot_layout_language_get_required_feature_index' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-ot-layout.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_ot_layout_script_find_language' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-ot-layout.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_ot_layout_language_find_feature' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-ot-layout.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_ot_layout_table_get_script_tags' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-ot-layout.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_ot_layout_script_get_language_tags' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-ot-layout.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_ot_layout_language_get_feature_tags' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-ot-layout.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_ot_tags_from_script' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-ot-tag.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_ot_tag_to_script' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-ot-tag.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_ot_tag_from_language' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-ot-tag.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_language_from_string' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-common.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_language_to_string' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-common.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /usr/bin/ld: warning: hidden symbol 'hb_ot_tag_to_language' in /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../gfx/harfbuzz/src/hb-ot-tag.o is referenced by DSO /usr/lib/libpangoft2-1.0.so /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.o:/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp:function NS_InvokeByIndex_P: error: undefined reference to 'invoke_copy_to_stack' /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../xpcom/reflect/xptcall/src/md/unix/xptcstubs_gcc_x86_unix.o:/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/xpcom/reflect/xptcall/src/md/unix/xptcstubs_gcc_x86_unix.cpp:function SharedStub: error: undefined reference to 'PrepareAndDispatch' clang: error: linker command failed with exit code 1 (use -v to see invocation) make[5]: *** [libxul.so] Error 1 make[5]: Leaving directory `/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library' make[4]: *** [libs_tier_platform] Error 2 make[4]: Leaving directory `/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu' make[3]: *** [tier_platform] Error 2 make[3]: Leaving directory `/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu' make[2]: *** [default] Error 2 make[2]: Leaving directory `/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu' make[1]: *** [realbuild] Error 2 make[1]: Leaving directory `/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release' make: *** [build] Error 2 /usr/libexec/paludis/utils/emake: emake returned error 2 Note: I'm using -v to clang to see linking commands.
stops during install with [...] adding: hyphenation/hyph_pt.dic (deflated 55%) adding: hyphenation/hyph_et.dic (deflated 52%) adding: hyphenation/hyph_gl.dic (deflated 69%) adding: hyphenation/hyph_en_US.dic (deflated 59%) adding: hyphenation/hyph_la.dic (deflated 59%) adding: hyphenation/hyph_mn.dic (deflated 77%) adding: hyphenation/hyph_cy.dic (deflated 53%) adding: hyphenation/hyph_ia.dic (deflated 51%) adding: hyphenation/hyph_hr.dic (deflated 56%) adding: hyphenation/hyph_af.dic (deflated 55%) adding: hyphenation/hyph_uk.dic (deflated 70%) adding: hyphenation/hyph_sh.dic (deflated 69%) adding: hyphenation/hyph_hsb.dic (deflated 63%) adding: hyphenation/hyph_fr.dic (deflated 60%) adding: hyphenation/hyph_eo.dic (deflated 63%) /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/dist/bin/xpcshell: symbol lookup error: /var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/dist/bin/libxul.so: undefined symbol: invoke_copy_to_stack make[1]: *** [prepare-package] Error 127 make[1]: Leaving directory `/var/tmp/paludis/www-client-firefox-19.0.2/work/mozilla-release/obj-i686-pc-linux-gnu/browser/installer' make: *** [install] Error 2 /usr/libexec/paludis/utils/emake: emake returned error 2
-O2 was used for the test build, as the test machine only has 1GB RAM. The build passes dromeao.com tests, methodjit and tracejit were enabled with .mozconfig. It built and works fine with this patch applied. The clang version to test was: clang version 3.3 (trunk) The patch fixes - elfhack issues - invoke_copy_on_stack undefined symbol error - PrepareAndDispatch undefinded symbol error - minor things that had "-g" always enabled, even though "--disable-debug" was used in .mozconfig Greetings
Blocks: clang-macosx
Here are the dromaeo.com results, for reference: http://dromaeo.com/?id=192620 I tried an -O4 lto-enabled build also, but it fails linking libxul.so, complaing about ".previous" without section or similar. Might have to do with memory (1G RAM + 8G swap)??
Hi, Unfortunately Firefox 19 is already released, so this isn't the kind of patch we'd take. Newer versions of Firefox should compile out-of-the-box with clang, since we're actively doing address sanitizer builds there.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Component: Untriaged → XPConnect
Product: Firefox → Core
Resolution: --- → WONTFIX
Hardware: Other → x86
Did you recognize that the build fails regardless of wheter llvm-hacks or adress-sanitizer is used? I bet this isn't fixed in a later version, but I'll give it a try. May I reopen, if I encounter this with 20.x or trunk? Greetings
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #5) > Hi, > > Unfortunately Firefox 19 is already released, so this isn't the kind of > patch we'd take. I was under the impression that you still do maintenance releases (like 19.0.2, 19.0.3, etc.) - and since this isn't exactly a new feature, why not fix it for the next minor in this branch? Just curious..
If this is broken on a non-release version, then yes, please reopen. I suspect trunk builds fine. My address sanitizer comment was only to let you know that we have active linux clang builds on trunk. Our nightly and release builds are still done with GCC.
(In reply to cmuelle8 from comment #7) > (In reply to Ted Mielczarek [:ted.mielczarek] from comment #5) > I was under the impression that you still do maintenance releases (like > 19.0.2, 19.0.3, etc.) - and since this isn't exactly a new feature, why not > fix it for the next minor in this branch? Just curious.. Releases like that are limited in scope to urgent security or stability fixes. We try to minimize risk by not taking any changes that aren't absolutely essential to security or stability.
I tried with tip of trunk (mozilla-central-279078670022), but have lots of problems building: a) jsapi.h (and basically all other js includes were) was inaccessible for the build components from xpcom on through chromium and forward, I fixed this temporarily by doing cd mozilla-release/obj-i686-pc-linux-gnu/dist/include for i in ../../js/src/*h ../../js ../../../js/src/*msg ; do ln -vs "$i" ; done b) after "advancing" a lot by doing the quickfix from a, the build stops at clang++ -o JARSignatureVerification.o -c -I../../../../dist/stl_wrappers -I../../../../dist/system_wrappers -include /var/tmp/paludis/www-client-firefox-279078670022/work/mozilla-central-279078670022/config/gcc_hidden.h -DNSS_ENABLE_ECC -DDLL_PREFIX=\"lib\" -DDLL_SUFFIX=\".so\" -DMOZ_GLUE_IN_PROGRAM -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1 -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES -DSTATIC_EXPORTABLE_JS_API -DNO_NSPR_10_SUPPORT -I/var/tmp/paludis/www-client-firefox-279078670022/work/mozilla-central-279078670022/security/manager/ssl/src -I. -I../../../../dist/include -I/usr/include/nspr -I/usr/include/nss -fPIC -Qunused-arguments -Qunused-arguments -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Wsign-compare -Wno-invalid-offsetof -Wno-c++0x-extensions -Wno-extended-offsetof -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-mismatched-tags -march=native -pipe -fomit-frame-pointer -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -std=gnu++0x -I/var/tmp/paludis/www-client-firefox-279078670022/work/mozilla-central-279078670022/build/unix/headers -pthread -pipe -DNDEBUG -DTRIMMED -O2 -fomit-frame-pointer -Qunused-arguments -DMOZILLA_CLIENT -include ../../../../mozilla-config.h -MD -MF .deps/JARSignatureVerification.o.pp /var/tmp/paludis/www-client-firefox-279078670022/work/mozilla-central-279078670022/security/manager/ssl/src/JARSignatureVerification.cpp /var/tmp/paludis/www-client-firefox-279078670022/work/mozilla-central-279078670022/security/manager/ssl/src/JARSignatureVerification.cpp:589:8: error: use of undeclared identifier 'SEC_PKCS7VerifyDetachedSignatureAtTime' if (!SEC_PKCS7VerifyDetachedSignatureAtTime(p7_info, certUsageObjectSigner, ^ 1 error generated. make[7]: *** [JARSignatureVerification.o] Error 1 I understand that not every tip of trunk is ok, so I'll give it another try. If you do nightly builds with clang though, does your log show a successful build for the ID in question? Do you recommend a certain recent id to get a snapshot of for testing? Thanks
Our tip of trunk should always be buildable, we have CI builds for every checkin. You should probably post to the mozilla.dev.builds mailing list/group, that's a better forum for questions like this: https://lists.mozilla.org/listinfo/dev-builds
(In reply to cmuelle8 from comment #10) > I tried with tip of trunk (mozilla-central-279078670022) > > a) jsapi.h (and basically all other js includes were) were inaccessible > > b) the build stops at > error: use of undeclared identifier 'SEC_PKCS7VerifyDetachedSignatureAtTime' > if (!SEC_PKCS7VerifyDetachedSignatureAtTime(p7_info, certUsageObjectSigner, > ^ > 1 error generated. > make[7]: *** [JARSignatureVerification.o] Error 1 Meanwhile I looked further into this and tip of trunk was not at fault - as for a) an obsoleted but cleanly applied 'patch' caused js/src not to build -> solution: carefully reverse applied patch.. b) my system-nss was not recent enough (--with-system-nss being a default configure option) -> solution: creation of an nss-9999.ebuild, which uses the same source archive as the FF ebuild Resolving a) and b) the build did ok, and a new issue regarding the address sanitzier feature, which I had enabled, surfaced: =============================================================== Executing: clang++ -o js -Qunused-arguments -Qunused-arguments -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Werror=conversion-null -Wsign-compare -Wno-invalid-offsetof -Wno-c++0x-extensions -Wno-extended-offsetof -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-mismatched-tags -march=native -pipe -fomit-frame-pointer -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -pthread -pipe -DNDEBUG -DTRIMMED -O2 -fomit-frame-pointer /var/tmp/paludis/www-client-firefox-9999/work/mozilla-central-8aeabe064932/obj-i686-pc-linux-gnu/js/src/shell/tmpvB60xr.list -lpthread -march=native -pipe -fomit-frame-pointer -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -Wl,-z,norelro -Wl,--build-id -Wl,--icf=safe -Wl,-rpath-link,../../../dist/bin -Wl,-rpath-link,/var/tmp/paludis/www-client-firefox-9999/work/mozilla-central-8aeabe064932/obj-i686-pc-linux-gnu/dist/lib -L../../../dist/bin -L../../../dist/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl ../libjs_static.a -lz -Wl,--whole-archive ../../../dist/lib/libmozglue.a ../../../dist/lib/libmemory.a -Wl,--no-whole-archive -rdynamic -ldl -lffi /var/tmp/paludis/www-client-firefox-9999/work/mozilla-central-8aeabe064932/obj-i686-pc-linux-gnu/js/src/shell/tmpvB60xr.list: INPUT("js.o") INPUT("jsoptparse.o") INPUT("jsheaptools.o") INPUT("../editline/editline.o") INPUT("../editline/sysunix.o") ../libjs_static.a(jsarray.o):/var/tmp/paludis/www-client-firefox-9999/work/mozilla-central-8aeabe064932/js/src/jsarray.cpp:function js::types::TypeObjectKey** js::LifoAlloc::newArray<js::types::TypeObjectKey*>(unsigned int): error: undefined reference to '__asan_unpoison_memory_region' ../libjs_static.a(jsarray.o):/var/tmp/paludis/www-client-firefox-9999/work/mozilla-central-8aeabe064932/js/src/jsarray.cpp:function js::types::TypeObjectKey** js::LifoAlloc::newArray<js::types::TypeObjectKey*>(unsigned int): error: undefined reference to '__asan_unpoison_memory_region' ../libjs_static.a(jsdbgapi.o):/var/tmp/paludis/www-client-firefox-9999/work/mozilla-central-8aeabe064932/js/src/jsdbgapi.cpp:function js::LifoAlloc::release(void*): error: undefined reference to '__asan_poison_memory_region' ../libjs_static.a(jsdbgapi.o):/var/tmp/paludis/www-client-firefox-9999/work/mozilla-central-8aeabe064932/js/src/jsdbgapi.cpp:function js::LifoAlloc::release(void*): error: undefined reference to '__asan_unpoison_memory_region' ../libjs_static.a(jsfun.o):/var/tmp/paludis/www-client-firefox-9999/work/mozilla-central-8aeabe064932/js/src/jsfun.cpp:function unsigned short* js::LifoAlloc::newArray<unsigned short>(unsigned int): error: undefined reference to '__asan_unpoison_memory_region' ../libjs_static.a(LifoAlloc.o):/var/tmp/paludis/www-client-firefox-9999/work/mozilla-central-8aeabe064932/js/src/ds/LifoAlloc.cpp:function js::LifoAlloc::getOrCreateChunk(unsigned int): error: undefined reference to '__asan_poison_memory_region' ../libjs_static.a(AsmJS.o):/var/tmp/paludis/www-client-firefox-9999/work/mozilla-central-8aeabe064932/js/src/ion/AsmJS.cpp:function GenerateCodeForFinishedJob(ModuleCompiler&, ParallelGroupState&, js::AsmJSParallelTask**): error: undefined reference to '__asan_poison_memory_region' clang: error: linker command failed with exit code 1 (use -v to see invocation) =============================================================== I searched the web for address sanitizer issues in combination with clang and FF and found a superb guide at: https://developer.mozilla.org/en-US/docs/Building_Firefox_with_Address_Sanitizer#Adjusting_the_build_configuration -> clang adds/links -lasan automatically IF "-fsanitize=address" is part of CFLAGS, respective {CXX,LD}FLAGS The guide above also pinpointed me to preset mozconfigs, present in the FF source tree cp browser/config/mozconfigs/linux32/nightly-asan browser/config/mozconfigs/linux32/nightly A potential gentoo live ebuild should use them, if a clang toolchain and address sanitation is used. According to the guide, enabling both, elfhack and the sanitizer simultaneously, will not work, so it's either: CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" --disable-address-sanitizer --enable-elf-hack or CFLAGS="${CFLAGS} -fsanitize=address" LDFLAGS="${LDFLAGS} -fsanitize=address" --enable-address-sanitizer --disable-elf-hack In the latter case, at least "-g" debugging symbols are necessary, according to browser/config/mozconfigs/linux32/nightly-asan If you like a small and fast build, you'd choose the former setup, leave the mozconfig untouched and not add -fsanitize=address to any of the compiler flags. Contrary, if you're looking for a more secure browser you'd choose a configuration including the address sanitation facilities. Originally I wanted to know if tip of trunk compilation still omits the symbols contained in xptcinvoke_gcc_x86_unix.cpp xptcstubs_gcc_x86_unix.cpp when linking libxul.so As the machine currently recompiles, I'll report back later. Posting now to maybe save someone from going through the same hazzle. Greetings
Ok, I can reaffirm the assumption made - it's not fixed in trunk, the problem exists from 19.0.2 on up to now. xpcshell won't run during make install phase, since symbols invoke_copy_to_stack PrepareAndDispatch are optimized out by clang and not contained in linked libxul.so reopening..
Status: RESOLVED → UNCONFIRMED
Resolution: WONTFIX → ---
Version: 19 Branch → Trunk
tested without address-sanitizer configure option the build log shows the reproduction of the problem originally reported on 19.0.2 release, having used a tip of trunk from last week
Summary: firefox-19.0.2 does not link with clang on i686-pc-linux-gnu → firefox trunk does not link with clang on i686-pc-linux-gnu
Attachment #730105 - Attachment is patch: true
Comment on attachment 730105 [details] [diff] [review] fix clang issues on a x86 atom platform (xptcstubs, xptcinvoke) Review of attachment 730105 [details] [diff] [review]: ----------------------------------------------------------------- ::: mozilla-release/build/unix/elfhack/Makefile.in @@ +9,4 @@ > #include "xptc_gcc_x86_unix.h" > > extern "C" { > +void ATTRIBUTE_USED __attribute__ ((regparm(3))) I wonder if we can drop extern "C", otherwise it's a bug http://llvm.org/bugs/show_bug.cgi?id=15744
(In reply to Jan Beich from comment #15) > I wonder if we can drop extern "C", otherwise it's a bug > http://llvm.org/bugs/show_bug.cgi?id=15744 Closing, since issue has been fixed in the compiler http://llvm.org/viewvc/llvm-project?view=revision&revision=178950
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → WORKSFORME
It seems that the error is not fixed. Rebuilding llvm and clang rev179729 (greater than 178950) and thereafter firefox-20.0.1 the error persists: /var/tmp/paludis/www-client-firefox-20.0.1/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.o:/var/tmp/paludis/www-client-firefox-20.0.1/work/mozilla-release/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp:function NS_InvokeByIndex_P: error: undefined reference to 'invoke_copy_to_stack' /var/tmp/paludis/www-client-firefox-20.0.1/work/mozilla-release/obj-i686-pc-linux-gnu/toolkit/library/../../xpcom/reflect/xptcall/src/md/unix/xptcstubs_gcc_x86_unix.o:/var/tmp/paludis/www-client-firefox-20.0.1/work/mozilla-release/xpcom/reflect/xptcall/src/md/unix/xptcstubs_gcc_x86_unix.cpp:function SharedStub: error: undefined reference to 'PrepareAndDispatch' clang: error: linker command failed with exit code 1 (use -v to see invocation) make[5]: *** [libxul.so] Error 1 @Jan: could you please leave note at http://llvm.org/bugs/show_bug.cgi?id=15744 the commit in rev178950 seems to target the problem here, but is does not seem to fix it Thanks
Status: RESOLVED → UNCONFIRMED
Resolution: WORKSFORME → ---
This is now fixed.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: