Last Comment Bug 752280 - Thunderbird builds on Ubuntu fail with "undefined reference to `mozilla::Time*`
: Thunderbird builds on Ubuntu fail with "undefined reference to `mozilla::Time*`
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: Trunk
: x86 Linux
: -- major (vote)
: mozilla15
Assigned To: Mike Hommey [:glandium]
:
: Gregory Szorc [:gps]
Mentors:
Depends on:
Blocks: 751727
  Show dependency treegraph
 
Reported: 2012-05-05 21:32 PDT by Mike Conley (:mconley)
Modified: 2012-05-07 17:53 PDT (History)
10 users (show)
ryanvm: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Use LIBS instead of LDFLAGS when testing for clock_gettime in librt (1.60 KB, patch)
2012-05-06 23:57 PDT, Mike Hommey [:glandium]
ted: review+
Details | Diff | Splinter Review

Description Mike Conley (:mconley) 2012-05-05 21:32:29 PDT
Linking is failing on my Ubuntu box with the following:  http://pastebin.mozilla.org/1620136

I'm reasonably certain that this is fallout from bug 751727.  Shot in the dark - perhaps Thunderbird's build configuration does not define HAVE_CLOCK_MONOTONIC? (see mozilla/xpcom/ds/Makefile.in).
Comment 1 Mike Conley (:mconley) 2012-05-05 21:37:32 PDT
Even better - a direct link to the Makefile.in:  http://mxr.mozilla.org/comm-central/source/mozilla/xpcom/ds/Makefile.in#75
Comment 2 Ian 2012-05-06 06:18:48 PDT
I am getting exactly this trying to build firefox trunk on ubuntu
ian@tqft-l:/sourcetrees/programs/mozilla/mozilla$ uname -a
Linux tqft-l 3.2.0-24-generic #38-Ubuntu SMP Tue May 1 16:18:50 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) 

/sourcetrees/programs/mozilla/central/mozilla-central/gfx/layers/ipc/ShadowLayersParent.cpp:424: undefined reference to `mozilla::TimeStamp::Now()'
../../gfx/layers/ShadowLayersParent.o: In function `mozilla::TimeDuration::ToMilliseconds() const':
/sourcetrees/programs/mozilla/central/mozilla-central/obj-x86_64-unknown-linux-gnu/gfx/layers/../../dist/include/mozilla/TimeStamp.h:81: undefined reference to `mozilla::TimeDuration::ToSeconds() const'
/usr/bin/ld.bfd.real: libxul.so: hidden symbol `mozilla::TimeStamp::Startup()' isn't defined
Comment 3 Mike Conley (:mconley) 2012-05-06 12:39:39 PDT
I was able to get Thunderbird to build with Landry Breuil's patch that he mentions in comment 7 of bug 751727:

https://hg.mozilla.org/try/rev/341fbf4bc89e

He writes:

"After a quick look configure fails to find CLOCK_MONOTONIC #define because it's in sys/time.h and not time.h.

...

Hrm apparently POSIS says that it should be in time.h, so i'll see if i can get OpenBSD fixed instead."

So perhaps Ubuntu is in the same boat as OpenBSD, and have put the time.h file in an unexpected place.  Cc'ing Chris Coulson.

In the meantime, however, Landry's patch allows me to build.
Comment 4 Mike Hommey [:glandium] 2012-05-06 23:57:59 PDT
Created attachment 621513 [details] [diff] [review]
Use LIBS instead of LDFLAGS when testing for clock_gettime in librt

This is one part of the problem: ac_link puts LDFLAGS before the .c file name, and LIBS after. Putting -lrt before the .c file name makes the Ubuntu linker throws -lrt away and then fails to link, which makes the MONOTONIC test fail.
Comment 5 Ted Mielczarek [:ted.mielczarek] 2012-05-07 05:00:04 PDT
Comment on attachment 621513 [details] [diff] [review]
Use LIBS instead of LDFLAGS when testing for clock_gettime in librt

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

Hilarious.
Comment 6 Mike Hommey [:glandium] 2012-05-07 06:24:06 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/0321d95b860d

If the sys/time.h vs. time.h part is still necessary, please file a separate bug.
Comment 7 Ryan VanderMeulen [:RyanVM] 2012-05-07 17:53:03 PDT
http://hg.mozilla.org/mozilla-central/rev/0321d95b860d

Note You need to log in before you can comment on or make changes to this bug.