Closed Bug 813746 Opened 12 years ago Closed 12 years ago

WebRTC unit tests break the build with --enable-shared-js

Categories

(Core :: WebRTC, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla20
Tracking Status
firefox19 --- unaffected

People

(Reporter: bzbarsky, Assigned: ehugg)

References

Details

(Whiteboard: [blocking-webrtc+] [blocking-gum+] [qa-])

Attachments

(2 files, 1 obsolete file)

Building inbound from rev d8e020333f08 works fine.

Building inbound from rev 31d01eb0baf3 fails while building the webrtc unit tests on OS X 10.8 like so:

Undefined symbols for architecture x86_64:
  "_MOZ_Z_crc32", referenced from:
      _MOZ_PNG_reset_crc in png.o
      _MOZ_PNG_calc_crc in png.o
  "_MOZ_Z_deflate", referenced from:
      _MOZ_PNG_write_flush in pngwrite.o
      _MOZ_PNG_write_finish_row in pngwutil.o
      _MOZ_PNG_write_filtered_row in pngwutil.o
  "_MOZ_Z_deflateEnd", referenced from:
      _MOZ_PNG_write_destroy in pngwrite.o
      _MOZ_PNG_zlib_claim in pngwutil.o
  "_MOZ_Z_deflateInit2_", referenced from:
      _MOZ_PNG_zlib_claim in pngwutil.o
  "_MOZ_Z_deflateReset", referenced from:
      _MOZ_PNG_zlib_release in pngwutil.o
  "_MOZ_Z_inflate", referenced from:
      _MOZ_PNG_proc_IDAT_data in pngpread.o
      _MOZ_PNG_inflate in pngrutil.o
  "_MOZ_Z_inflateEnd", referenced from:
      _MOZ_PNG_read_dest in pngread.o
  "_MOZ_Z_inflateInit_", referenced from:
      _MOZ_PNG_cr_read_str in pngread.o
  "_MOZ_Z_inflateReset", referenced from:
      _MOZ_PNG_reset_zs in png.o
      _MOZ_PNG_inflate in pngrutil.o
      _MOZ_APNG_prog_read_reset in pngrutil.o
  "_MOZ_Z_uncompress", referenced from:
      (anonymous namespace)::ProcessGeneric(ots::OpenTypeFile*, unsigned int, ots::OTSStream*, unsigned char const*, unsigned long, std::vector<(anonymous namespace)::OpenTypeTable, std::allocator<(anonymous namespace)::OpenTypeTable> > const&, ots::Buffer&) in ots.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Undefined symbols for architecture x86_64:
  "_MOZ_Z_crc32", referenced from:
      _MOZ_PNG_reset_crc in png.o
      _MOZ_PNG_calc_crc in png.o

make[5]: *** [mediaconduit_unittests] Error 1

and various similar stuff for other things in that dir.

Clearly this works on tbpl...  No idea what the difference is, but this is being a complete development blocker for me.  :(
Haven't been able to repro this yet.  I have a couple macs here and jesup, ekr and crypt have built this as well.  Could you post your .mozconfig and the output of "clang --version"?  Let me try to replicate what you have.  Thanks.
mozilla% clang --version
clang version 3.2 (trunk 163716)
Target: x86_64-apple-darwin12.2.0
Thread model: posix

(this is a build from clang svn, from that revision).

mozconfig is (after sorting through all the includes and removing the commented-out bits):

mk_add_options MOZ_CO_PROJECT=suite,browser,mail,xulrunner,calendar
mk_add_options MOZ_CO_MODULE="mozilla/other-licenses/libart_lgpl mozilla/tools"
mk_add_options MOZ_MAKE_FLAGS="-s -j6"
export MOZ_MAKE_FLAGS="-s -j6"
mk_add_options CC="clang"
export CC="clang"
mk_add_options CXX="clang++"
export CXX="clang++"
ac_add_options --disable-javaxpcom
ac_add_options --enable-tests
ac_add_options --enable-debugger-info-modules
ac_add_options --enable-debug-symbols
ac_add_options --enable-accessibility
ac_add_options --enable-codesighs
ac_add_options --disable-install-strip
ac_add_options --enable-shared-js
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj-firefox
ac_add_options --enable-application=browser
ac_add_options --enable-debug=-gdwarf-2
ac_add_options --disable-optimize
Note that this may be affected by what libs are in the link path too, in theory, and in particular on macports stuff.. or something.  I'm not sure what all these tests are linking to.
Hmm.  I suspect either a side-effect of some option, or maybe some different libs as you say - but more likely a buildsystem/option issue.  C++ unit tests are a mess to link currently, so a fair bit of trial-and-error was needed to get things linking correctly - in particular the gkmedia/xul break.

Adding Ted and some build peers while I investigate more
bz: can you get us the build line that fails?  (Better yet, the output of doing a build.)  Those are supposed to be the exported symbols from zlib, so I want to see what zlib the link line is trying to include, and how it was built.

Thanks
Flags: needinfo?(bzbarsky)
I suspect it's --enable-shared-js:

In rules.mk: LIBS += .... $(if $(JS_SHARED_LIBRARY),,$(MOZ_ZLIB_LIBS))

Can you try without that?  Though the build output would be the most useful.
I've confirmed it's something about the mozconfig.  I can dupe the problem with the mozconfig above on my Mac.  I will do some more builds and confirm which line it is that causes it.
Let me know if you want me to try without -j too...
Flags: needinfo?(bzbarsky)
> I suspect it's --enable-shared-js:

Looks like you're right.  I turned that off for now, but that will significantly complicate profiling, so it would be nice to turn it back on...  Furthermore, I believe that's the default configuration on at least Windows (though it's possible WebRTC does not have the same linking issues there).
Summary: WebRTC unit tests break the build → WebRTC unit tests break the build with --enable-shared-js
Verified: it's --enable-shared-js (sorry; I said this earlier and didn't notice I mid-air-collided with Ethan).

We should be able to add the zlib library to the link for the mediaconduit_unittest for the shared-js case.
Attached patch This fixes the problem for me (obsolete) — Splinter Review
Attachment #683897 - Flags: review?(ethanhugg)
OS: Mac OS X → All
Priority: -- → P1
Hardware: x86 → All
Whiteboard: [blocking-webrtc+] [blocking-gum+]
Comment on attachment 683897 [details] [diff] [review]
This fixes the problem for me

Review of attachment 683897 [details] [diff] [review]:
-----------------------------------------------------------------

Fails if you *don't* have --enable-shared-js
Attachment #683897 - Flags: review?(ethanhugg) → review-
Attachment #683897 - Attachment is obsolete: true
Comment on attachment 683981 [details] [diff] [review]
Link the webrtc unit tests to ZLIB as needed.

Tested on Linux with and without --enable-shared-js - works
(it was failing for me there as well)
Attachment #683981 - Flags: review?(bzbarsky)
Comment on attachment 683981 [details] [diff] [review]
Link the webrtc unit tests to ZLIB as needed.

r=me, but how did the other fail if I might ask?  I wouldn't have expected it to...
Attachment #683981 - Flags: review?(bzbarsky) → review+
Multiple definitions (since ZLIB is in some other make var if it's not shared-js)
Hmm.  So you can't use -Lfoo twice with the same "foo" safely?  That's unfortunate.  :(
https://hg.mozilla.org/mozilla-central/rev/cf68f801ea57
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [blocking-webrtc+] [blocking-gum+] → [blocking-webrtc+] [blocking-gum+] [qa-]
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: