Bug 213865

Summary: print/ghostscript9-agpl-base fails to build on arm64
Product: Ports & Packages Reporter: Glen Barber <gjb>
Component: Individual Port(s)Assignee: Dimitry Andric <dim>
Status: Closed FIXED    
Severity: Affects Only Me CC: Andrew, dim, emaste
Priority: --- Flags: bugzilla: maintainer-feedback? (doceng)
Version: Latest   
Hardware: arm64   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241747
Bug Depends on:    
Bug Blocks: 201763    
Attachments:
Description Flags
gzip of original gdevcd8-e7b8ed.c
none
Minimised test case
none
build script none

Description Glen Barber freebsd_committer freebsd_triage 2016-10-28 18:42:29 UTC
Assertion failed: (isSimple() && "Expected a SimpleValueType!"), function getSimpleVT, file /usr/src/lib/clang/libllvmaarch64codegen/../../../contrib/llvm/include/llvm/CodeGen/ValueTypes.h, line 222.
cc: error: unable to execute command: Abort trap (core dumped)
cc: error: clang frontend command failed due to signal (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-freebsd12.0
Thread model: posix
InstalledDir: /usr/bin
cc: note: diagnostic msg: PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the crash backtrace, preprocessed source, and associated run script.
cc: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
cc: note: diagnostic msg: /tmp/gdevcd8-751c5c.c
cc: note: diagnostic msg: /tmp/gdevcd8-751c5c.sh
cc: note: diagnostic msg:

********************
gmake[3]: *** [contrib/contrib.mak:205: soobj/gdevcd8.o] Error 254
gmake[3]: Leaving directory '/wrkdirs/usr/ports/print/ghostscript9-agpl-base/work/ghostscript-9.16'
gmake[2]: *** [base/unix-dll.mak:134: so-subtarget] Error 2
gmake[2]: Leaving directory '/wrkdirs/usr/ports/print/ghostscript9-agpl-base/work/ghostscript-9.16'
gmake[1]: *** [base/unix-dll.mak:120: so] Error 2
gmake[1]: Leaving directory '/wrkdirs/usr/ports/print/ghostscript9-agpl-base/work/ghostscript-9.16'
*** Error code 1

Stop.
make: stopped in /usr/ports/print/ghostscript9-agpl-base
Comment 1 Andrew Turner freebsd_committer freebsd_triage 2016-11-10 19:18:29 UTC
I can build this with clang 3.9 and llvm r279852 [1]. For llvm 3.8 there seem to be further patches needed.

[1] http://llvm.org/viewvc/llvm-project?view=revision&revision=279852
Comment 2 Dimitry Andric freebsd_committer freebsd_triage 2016-11-10 21:55:18 UTC
If anybody still has the gdevcd8-751c5c.c and gdevcd8-751c5c.sh files, please attach them to this bug.
Comment 3 Andrew Turner freebsd_committer freebsd_triage 2016-11-11 12:40:56 UTC
Created attachment 176895 [details]
gzip of original gdevcd8-e7b8ed.c
Comment 4 Andrew Turner freebsd_committer freebsd_triage 2016-11-11 12:41:32 UTC
Created attachment 176896 [details]
Minimised test case
Comment 5 Andrew Turner freebsd_committer freebsd_triage 2016-11-11 12:41:55 UTC
Created attachment 176897 [details]
build script
Comment 6 commit-hook freebsd_committer freebsd_triage 2016-11-11 21:02:46 UTC
A commit references this bug:

Author: dim
Date: Fri Nov 11 21:01:46 UTC 2016
New revision: 308559
URL: https://svnweb.freebsd.org/changeset/base/308559

Log:
  Pull in r263169 from upstream llvm trunk (by Tim Northover):

    AArch64: only try to use scaled fcvt ops on legal vector types.

    Before we ended up calling getSimpleVectorType on a <3 x float>, which
    asserted.

  This fixes an assertion when building the print/ghostscript9-agpl-base
  port for AArch64.

  PR:		213865
  MFC after:	3 days

Changes:
  head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
Comment 7 Dimitry Andric freebsd_committer freebsd_triage 2016-11-12 22:03:58 UTC
Since I don't have any AArch64 setup, can one of you please confirm that after r308559 this port builds to completion successfully?
Comment 8 commit-hook freebsd_committer freebsd_triage 2016-11-14 18:57:28 UTC
A commit references this bug:

Author: dim
Date: Mon Nov 14 18:57:22 UTC 2016
New revision: 308648
URL: https://svnweb.freebsd.org/changeset/base/308648

Log:
  MFC r308559:

  Pull in r263169 from upstream llvm trunk (by Tim Northover):

    AArch64: only try to use scaled fcvt ops on legal vector types.

    Before we ended up calling getSimpleVectorType on a <3 x float>, which
    asserted.

  This fixes an assertion when building the print/ghostscript9-agpl-base
  port for AArch64.

  PR:		213865

Changes:
_U  stable/11/
  stable/11/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp