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*`
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: Trunk
: x86 Linux
-- major (vote)
: mozilla15
Assigned To: Mike Hommey [:glandium]
: Gregory Szorc [:gps] (away until 2017-03-20)
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:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

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 User image Mike Conley (:mconley) 2012-05-05 21:32:29 PDT
Linking is failing on my Ubuntu box with the following:

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/
Comment 1 User image Mike Conley (:mconley) 2012-05-05 21:37:32 PDT
Even better - a direct link to the
Comment 2 User image 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: hidden symbol `mozilla::TimeStamp::Startup()' isn't defined
Comment 3 User image 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:

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 User image 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 User image 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]:

Comment 6 User image Mike Hommey [:glandium] 2012-05-07 06:24:06 PDT

If the sys/time.h vs. time.h part is still necessary, please file a separate bug.
Comment 7 User image Ryan VanderMeulen [:RyanVM] 2012-05-07 17:53:03 PDT

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