Closed Bug 1574388 Opened 4 years ago Closed 4 years ago

Implement PHC on Mac


(Core :: Memory Allocator, enhancement)

Not set



Tracking Status
firefox70 --- fixed


(Reporter: n.nethercote, Assigned: n.nethercote)




(1 file)

The number of Mac Nightly users is just over 5,000, very similar to the number of Linux users. (Windows is about 38,000.)

It won't make a huge difference, but we need all the coverage we can get, and (in theory) it's not hard to port to Mac.

With the attached patch I get some link errors involving recordreplay:

 0:08.91 Undefined symbols for architecture x86_64:
 0:08.91   "__ZN7mozilla12recordreplay30InternalEndOrderedAtomicAccessEv", referenced from:
 0:08.91       __ZN7mozilla12recordreplayL22EndOrderedAtomicAccessEv in Unified_cpp_memory_replace_phc0.o
 0:08.91   "__ZN7mozilla12recordreplay23gIsRecordingOrReplayingE", referenced from:
 0:08.91       __ZN7mozilla12recordreplayL22IsRecordingOrReplayingEv in Unified_cpp_memory_replace_phc0.o
 0:08.91   "__ZN7mozilla12recordreplay32InternalBeginOrderedAtomicAccessEPKv", referenced from:
 0:08.91       __ZN7mozilla12recordreplayL24BeginOrderedAtomicAccessEPKv in Unified_cpp_memory_replace_phc0.o
 0:08.92 ld: symbol(s) not found for architecture x86_64
 0:08.92 clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
 0:08.92 make[2]: *** [../../../../dist/bin/logalloc-replay] Error 1
 0:08.92 make[1]: *** [memory/replace/logalloc/replay/target] Error 2
 0:08.92 make[1]: *** Waiting for unfinished jobs....

bhackett, glandium: any ideas what is the matter?


  • PHC is somewhat special, being in memory/replace/, which means it's not part of libxul.
  • PHC doesn't contain any recordreplay code, AFAICT, though it's possible it pulls some in via header inclusion.
  • PHC is already implemented for Linux and Windows, and I haven't seen any problems like this on those platforms.
  • The error is in memory/replace/logalloc/replay/, and the file in that directory does have some PHC-specific stuff in it involving some .cpp files in mozglue and MFBT. So that might be relevant.
Flags: needinfo?(mh+mozilla)
Flags: needinfo?(bhackett1024)

Try changing the Atomics in PHC to add a mozilla::recordreplay::Behavior::DontPreserve template argument.

Flags: needinfo?(mh+mozilla)
Flags: needinfo?(bhackett1024)

It works, thank you.

Attachment #9085970 - Attachment description: Bug 1574388 - [DRAFT] Implement PHC on Mac. → Bug 1574388 - Implement PHC on Mac. r=glandium,gsvelto
Blocks: 1576515
No longer blocks: PHC
Pushed by
Implement PHC on Mac. r=gsvelto,glandium
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.