Closed Bug 900965 Opened 6 years ago Closed 6 years ago

compile failures with gcc 4.6.3 after std::atomic enum support added in bug 888548

Categories

(Core :: MFBT, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: bkelly, Assigned: froydnj)

References

Details

Attachments

(1 file)

After bug 888548 landed I now get many errors like the following with gcc 4.6.3 on ubuntu 12.04:

 0:31.48 TestAtomics.o: In function `Atomic':
 0:31.48 /srv/mozilla-central/obj-x86_64-unknown-linux-gnu/mfbt/tests/../../dist/include/mozilla/Atomics.h:233: undefined reference to `std::atomic<EnumType>::store(EnumType, std::memory_order)'
 0:31.48 TestAtomics.o: In function `mozilla::detail::IntrinsicMemoryOps<EnumType, (mozilla::MemoryOrdering)1>::load(std::atomic<EnumType> const&)'
It looks like the unspecialized std::atomic template doesn't actually have inline definitions for all the functions declared in it in the 4.6 headers.  *boggle*
The added comment says it all, I think.
Attachment #785069 - Flags: review?(jwalden+bmo)
Ben, can you confirm that this patch works for you?
Flags: needinfo?(bkelly)
I think that fixes the issue.  The mfbt compile passes now, although I did not run a full build.
Flags: needinfo?(bkelly)
Comment on attachment 785069 [details] [diff] [review]
don't use <atomic> on GCC versions before 4.7

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

Fine by me if it works.
Attachment #785069 - Flags: review?(jwalden+bmo) → review+
https://hg.mozilla.org/mozilla-central/rev/ada4c3b62233
Assignee: nobody → nfroyd
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in before you can comment on or make changes to this bug.