Opened 2 years ago

Last modified 2 years ago

#60961 accepted defect

povray @3.7.0.8 build failure, Xcode 11.6 clang++ internal error

Reported by: jonas-bjork (Jonas Björk) Owned by: ryandesign (Ryan Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.6.3
Keywords: Cc: jeanlucmargot (Jean-Luc Margot)
Port: povray

Description (last modified by mf2k (Frank Schima))

I get the following message when trying to install povray:

--->  Building povray
Error: Failed to build povray: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_povray/povray/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port povray failed

I've tried the $port clean povray and installing again, but it doesn't help. When installing the first time I've got the message:

--->  Some of the ports you installed have notes:
  lzma has the following notes:
    The LZMA SDK program is installed as "lzma_alone", to avoid conflict with LZMA Utils

I'm not sure if this has something to do with anything.

Attachments (4)

main.log (176.9 KB) - added by jonas-bjork (Jonas Björk) 2 years ago.
Log file
main.log-clang-9.0 (264.6 KB) - added by jeanlucmargot (Jean-Luc Margot) 2 years ago.
main.log with sudo port install povray configure.compiler=macports-clang-9.0
main.log-clang-1103 (185.2 KB) - added by jeanlucmargot (Jean-Luc Margot) 2 years ago.
main.log with sudo port install povray
main_2020-12-03_murraye.log (411.2 KB) - added by murrayE 2 years ago.
main.log

Download all attachments as: .zip

Change History (16)

Changed 2 years ago by jonas-bjork (Jonas Björk)

Attachment: main.log added

Log file

comment:1 Changed 2 years ago by mf2k (Frank Schima)

Description: modified (diff)

comment:2 Changed 2 years ago by jmroot (Joshua Root)

Summary: povray 3.7.0.8 failed installingpovray @3.7.0.8 build failure, Xcode 11.6 clang++ internal error

I believe this is the relevant info from the log:

:info:build fatal error: error in backend: Cannot emit physreg copy instruction
:info:build clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
:info:build Apple clang version 11.0.3 (clang-1103.0.32.62)
:info:build Target: x86_64-apple-darwin19.6.0
:info:build Thread model: posix
:info:build InstalledDir: /Library/Developer/CommandLineTools/usr/bin
:info:build clang: note: diagnostic msg: PLEASE submit a bug report to http://developer.apple.com/bugreporter/ and include the crash backtrace, preprocessed source, and associated run script.
:info:build clang: note: diagnostic msg: 
:info:build ********************
:info:build PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
:info:build Preprocessed source(s) and associated run script(s) are located at:
:info:build clang: note: diagnostic msg: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_povray/povray/work/.tmp/imageutil-7ed71c.cpp
:info:build clang: note: diagnostic msg: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_povray/povray/work/.tmp/imageutil-7ed71c.sh
:info:build clang: note: diagnostic msg: Crash backtrace is located in
:info:build clang: note: diagnostic msg: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_povray/povray/work/.home/Library/Logs/DiagnosticReports/clang_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
:info:build clang: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
:info:build clang: note: diagnostic msg: 
:info:build ********************

This needs to be reported to Apple, as the message says, so they can fix it in a future Xcode release. In the meantime, maybe we need to blacklist this specific clang version in povray.

comment:3 Changed 2 years ago by murrayE

So is there some workaround that allows building the povray port?

comment:4 Changed 2 years ago by kencu (Ken)

You might try:

sudo port -v install clang-9.0
sudo port -v install povray configure.compiler=macports-clang-9.0

or clang-10.

Changed 2 years ago by jeanlucmargot (Jean-Luc Margot)

Attachment: main.log-clang-9.0 added

main.log with sudo port install povray configure.compiler=macports-clang-9.0

Changed 2 years ago by jeanlucmargot (Jean-Luc Margot)

Attachment: main.log-clang-1103 added

main.log with sudo port install povray

comment:5 Changed 2 years ago by jeanlucmargot (Jean-Luc Margot)

I experienced similar problems. main.log attached for default clang and clang-9.0.

comment:6 Changed 2 years ago by murrayE

I already have current clang-0.9 installed and used

sudo port -v install povray configure.compiler=macports-clang-9.0

but still get build error with povray. Log attached. Bunch of errors during build, including:

:info:build ../version:1:1: error: expected unqualified-id
:info:build 3.7.0.8
:info:build ^
:info:build fatal error: too many errors emitted, stopping now [-ferror-limit=]

and

:info:build _Tp* __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp*> volatile* __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
:info:build                                                                         ^
:info:build /opt/local/libexec/llvm-9.0/bin/../include/c++/v1/atomic:1024:65: error: unknown type name 'ptrdiff_t'
:info:build _Tp* __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp*> * __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
:info:build                                                                 ^
:info:build /opt/local/libexec/llvm-9.0/bin/../include/c++/v1/atomic:1040:73: error: unknown type name 'ptrdiff_t'
:info:build _Tp* __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp*> volatile* __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
:info:build                                                                         ^
:info:build /opt/local/libexec/llvm-9.0/bin/../include/c++/v1/atomic:1045:65: error: unknown type name 'ptrdiff_t'
:info:build _Tp* __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp*> * __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
:info:build                                                                 ^
:info:build /opt/local/libexec/llvm-9.0/bin/../include/c++/v1/atomic:1679:20: error: unknown type name 'ptrdiff_t'
:info:build     _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst)
:info:build                    ^
:info:build fatal error: too many errors emitted, stopping now [-ferror-limit=]
:info:build 20 errors generated.
:info:build 20 errors generated.
:info:build 20 errors generated.
:info:build 20 errors generated.
:info:build 20 errors generated.
:info:build 20 errors generated.

I'm using Xcode CLT 12.2.

Last edited 2 years ago by ryandesign (Ryan Schmidt) (previous) (diff)

Changed 2 years ago by murrayE

Attachment: main_2020-12-03_murraye.log added

main.log

comment:7 in reply to:  6 Changed 2 years ago by ryandesign (Ryan Schmidt)

Replying to murrayE:

:info:build ../version:1:1: error: expected unqualified-id

This is the well-known problem with newer compilers where this project includes a file called VERSION but there is a C++ header called version and on a case-insensitive filesystem the former is found instead of the latter. The workaround is to rename the VERSION file to anything else (and fix up any references to that file that might exist in other files). This issue has also been mentioned here: https://github.com/POV-Ray/povray/issues/403

There, they also mention a possible incompatibility with new versions of boost.

comment:8 Changed 2 years ago by ryandesign (Ryan Schmidt)

In 208f642b8c940221368a6e77b43f88e56e8dcd7b/macports-ports (master):

povray: Fix build by removing VERSION files

VERSION files conflict with the C++ version header.

See: #60961

comment:9 Changed 2 years ago by ryandesign (Ryan Schmidt)

Owner: set to ryandesign
Status: newaccepted

That takes care of the ../version:1:1: error: expected unqualified-id problem with new compilers. But it doesn't make any attempt to fix the originally reported fatal error: error in backend: Cannot emit physreg copy instruction problem because I don't know which compiler versions are affected. According to the log, clang 1103.0.32.62 from Xcode 11.6 is affected but the same version of clang is in Xcode 11.5 and 11.7 and I don't know if they are also affected or how many earlier or later versions are too. We were able to compile this on our Catalina buildbot worker on 29-Dec-2019 at which time the latest version of Xcode was 11.3 (clang 1100.0.33.16) so that's probably what we were using then. We were able to build it on Big Sur today with Xcode 12.2 (clang 1200.0.32.27). I guess we should just blacklist the exact version that failed for now, and if additional reports come in about other affected versions we can add them to the list. I'll try to confirm the build failure on Catalina with Xcode 11.7 first.

comment:10 in reply to:  9 Changed 2 years ago by ryandesign (Ryan Schmidt)

Cc: jeanlucmargot added

Replying to ryandesign:

fatal error: error in backend: Cannot emit physreg copy instruction

Testing on Catalina, I cannot reproduce this issue with:

  • Xcode 11.3.1 CLT (clang 1100.0.33.17)
  • Xcode 11.4 CLT (clang 1103.0.32.29)
  • Xcode 11.4.1 CLT (clang 1103.0.32.59)
  • Xcode 11.5 CLT (clang 1103.0.32.62)

(There was no CLT release for 11.6 or 11.7, presumably because the clang version didn't change.)

I had used xcode-select to select the CLT since I didn't want to deal with installing huge Xcode apps. Maybe using a full Xcode is the only way to reproduce the issue but that would surprise me.

Or maybe it only affects certain Mac models. I notice the build system is compiling with -march=native, which it should not do and which we should prevent, but that would cause it to optimize differently for different Intel CPUs; maybe on one particular CPU it doesn't work in this case. I was testing on a 2012 MacBook Pro with Retina Display (MacBookPro10,1). What machines were you testing on, Jonas and Jean-Luc? (I think Murray's issue was just the VERSION file issue, not the cannot emit physreg copy instruction problem.)

comment:11 Changed 2 years ago by ryandesign (Ryan Schmidt)

In f45de6fc98e7182e6beab83a0f2bc63adeedecc9/macports-ports (master):

povray: Don't build with -march=native

We want a portable binary that can be used with any processor, not just
the processor that's in the build machine.

See: #60961

comment:12 Changed 2 years ago by ryandesign (Ryan Schmidt)

Let me know if you still see the problem with povray @3.7.0.8_1, and if you do, let me know your Mac model and CPU.

Note: See TracTickets for help on using tickets.