[MacPorts] #58712: clang-7.0 and clang-8.0 are missing atomic builtins on i386

MacPorts noreply at macports.org
Thu Jul 11 04:00:14 UTC 2019


#58712: clang-7.0 and clang-8.0 are missing atomic builtins on i386
----------------------+---------------------------------
 Reporter:  devernay  |      Owner:  (none)
     Type:  defect    |     Status:  new
 Priority:  Normal    |  Milestone:
Component:  ports     |    Version:
 Keywords:            |       Port:  clang-7.0,clang-8.0
----------------------+---------------------------------
 the default value of COMPILER_RT_EXCLUDE_ATOMIC_BUILTIN in compiler-
 rt/lib/builtins/CMakeLists.txt changed from "off" in clang-6.0 to "on" in
 clang-7.0 and clang-8.0:
 https://github.com/llvm-mirror/compiler-
 rt/blob/release_60/lib/builtins/CMakeLists.txt#L177
 https://github.com/llvm-mirror/compiler-
 rt/blob/release_70/lib/builtins/CMakeLists.txt#L177
 https://github.com/llvm-mirror/compiler-
 rt/blob/release_80/lib/builtins/CMakeLists.txt#L177

 The reason is probably that the x86_64 compiler now has assembly
 instructions for these builtins.

 However, i386 does not seem to have these, and this causes undefined
 symbols when compiling for i386 (or universal):
 {{{
 Undefined symbols for architecture i386:
   "___atomic_load", referenced from:
       _.omp_outlined..468 in CImgExpression.o
       _.omp_outlined..608 in CImgExpression.o
 ld: symbol(s) not found for architecture i386
 }}}

 When compiling universal, I only get errors from the i386 side.

 When checking the lib contents:
 {{{
 nm -arch i386  /Volumes/opt/local-
 libc++/libexec/llvm-8.0/lib/clang/8.0.0/lib/darwin/libclang_rt.osx.a|fgrep
 atomic_load
 <nothing>
 nm -arch i386  /Volumes/opt/local-
 libc++/libexec/llvm-6.0/lib/clang/6.0.1/lib/darwin/libclang_rt.osx.a
 |fgrep atomic_load
 00000000 T ___atomic_load
 000004f0 T ___atomic_load_1
 00000510 T ___atomic_load_2
 00000530 T ___atomic_load_4
 00000550 T ___atomic_load_8
 }}}


 This should be signaled upstream, of course, but it's become complicated
 to submit llvm bugs.

 I'll check if re-enabling this fixes it. After all, it's just one more
 file (atomic.o) in a static lib, it should not hurt and it just makes the
 lib a few Kb more fat.

-- 
Ticket URL: <https://trac.macports.org/ticket/58712>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list