Bug 220484

Summary: math/py-numpy: fails to build 11.0 aarch64 due to clang crash (196 ports skipped)
Product: Ports & Packages Reporter: Jan Beich <jbeich>
Component: Individual Port(s)Assignee: freebsd-python (Nobody) <python>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: Andrew, dim, emaste, linimon
Priority: --- Keywords: needs-patch, needs-qa
Version: Latest   
Hardware: arm64   
OS: Any   
URL: https://reviews.llvm.org/rL263301
See Also: https://bugs.llvm.org/show_bug.cgi?id=26803
Bug Depends on:    
Bug Blocks: 201763    
Description Flags
numpy/core/src/multiarray/arraytypes.c.src (preprocessed, compressed)
command line args (for clang 3.8) none

Description Jan Beich freebsd_committer 2017-07-05 14:47:20 UTC
cc: build/src.freebsd-11.0-RELEASE-p1-arm64-2.7/numpy/core/src/multiarray/arraytypes.c
fatal error: error in backend: Cannot select: 0x44ab3e40: i32 = AArch64ISD::FCCMP 0x44d04980, 0x44d04980, Constant:i32<1>, Constant:i32<6>, 0x44eec850
  0x44d04980: f128,ch = CopyFromReg 0x431fa8b0, Register:f128 %vreg1
    0x44bd2850: f128 = Register %vreg1
  0x44d04980: f128,ch = CopyFromReg 0x431fa8b0, Register:f128 %vreg1
    0x44bd2850: f128 = Register %vreg1
  0x44efc000: i32 = Constant<1>
  0x44efd980: i32 = Constant<6>
  0x44eec850: f128 = AArch64ISD::FCMP 0x44c42e40, 0x44c42e40
    0x44c42e40: f128,ch = CopyFromReg 0x431fa8b0, Register:f128 %vreg3
      0x44efc720: f128 = Register %vreg3
    0x44c42e40: f128,ch = CopyFromReg 0x431fa8b0, Register:f128 %vreg3
      0x44efc720: f128 = Register %vreg3
In function: CLONGDOUBLE_compare
cc: error: clang frontend command failed with exit code 70 (use -v to see invocation)
FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM 3.8.0)
Target: aarch64-unknown-freebsd11.0
Thread model: posix
InstalledDir: /usr/bin

Comment 1 Jan Beich freebsd_committer 2017-07-05 14:55:44 UTC
Maybe fixed in FreeBSD 11.1 (clang 4.0) but aarch64 switched to lld which complicates testing due to bug 217189 and bug 214864.
Comment 2 Dimitry Andric freebsd_committer 2017-07-05 16:08:04 UTC
Can you please attach the two files dropped in /tmp? E.g.

cc: note: diagnostic msg: /tmp/arraytypes-b98a93.c
cc: note: diagnostic msg: /tmp/arraytypes-b98a93.sh
Comment 3 Andrew Turner freebsd_committer 2017-07-05 20:58:00 UTC
This builds for me on head with clang 4.0
Comment 4 Jan Beich freebsd_committer 2017-08-01 13:39:02 UTC
Created attachment 184912 [details]
numpy/core/src/multiarray/arraytypes.c.src (preprocessed, compressed)
Comment 5 Jan Beich freebsd_committer 2017-08-01 13:39:43 UTC
Created attachment 184913 [details]
command line args (for clang 3.8)
Comment 6 Dimitry Andric freebsd_committer 2017-08-02 17:51:47 UTC
So this was known upstream as https://bugs.llvm.org/show_bug.cgi?id=26803, and has been fixed in https://reviews.llvm.org/rL263301.

Since 11-STABLE now has clang 4.0.0, and head has 5.0.0, which both include this fix, I don't think there is much that can be done at this point?
Comment 7 Kubilay Kocak freebsd_committer freebsd_triage 2017-08-03 01:13:02 UTC
Can/should the port build with an affected version of clang from ports until all supported releases contain the fix?
Comment 8 Ed Maste freebsd_committer 2017-08-15 11:30:28 UTC
(In reply to Kubilay Kocak from comment #7)
IMO it's fine if someone wants to add to the port's Makefile to have it use a Clang port/package if the system clang is too old, but it's not necessary. It is reasonable to expect users will at least track more recent release for a newly-developing architecture like this.
Comment 9 Andrew Turner freebsd_committer 2017-08-15 14:47:59 UTC
(In reply to Ed Maste from comment #8)
The main reason to support 11.0 with arm64 is that's what portmgr targets when building packages.
Comment 10 Ed Maste freebsd_committer 2017-08-15 15:12:08 UTC
(In reply to Andrew Turner from comment #9)
Ah yes, good point. Perhaps setting USES=compiler:c++14-lang for arm64 could be a suitable workaround?
Comment 11 Ed Maste freebsd_committer 2017-11-14 18:37:18 UTC
11.0's EOL is in a couple of weeks. If nobody wants to apply the c++14-lang workaround we can just close this as OBE soon.
Comment 12 Jan Beich freebsd_committer 2018-01-20 18:08:17 UTC
11.0 EOL'd, builds fine on other releases.