--- js/src/build/moz.build.orig
+++ js/src/build/moz.build
@@ -47,6 +47,9 @@
     'zlib',
 ]
 
+if CONFIG['MOZ_NEEDS_LIBATOMIC']:
+    OS_LIBS += ['atomic']
+
 if CONFIG['OS_ARCH'] not in ('WINNT', 'HP-UX'):
     OS_LIBS += [
         'm',
