Bug 251564

Summary: modify build of devel/libffi for riscv64
Product: Ports & Packages Reporter: Mark Linimon <linimon>
Component: Individual Port(s)Assignee: Niclas Zeising <zeising>
Status: Closed FIXED    
Severity: Affects Only Me CC: kp, mhorne
Priority: --- Flags: zeising: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250968
Attachments:
Description Flags
new file devel/libffi/files/patch-src_riscv_ffi.c none

Description Mark Linimon freebsd_committer freebsd_triage 2020-12-03 16:00:09 UTC
Created attachment 220221 [details]
new file devel/libffi/files/patch-src_riscv_ffi.c

Adding this patch to devel/libffi/files fixes the build of dependent port devel/py-setuptools on riscv64, which itself blocks more than 5868 ports.

This is similar to the patch used on mips* .
Comment 1 Mitchell Horne freebsd_committer freebsd_triage 2020-12-03 17:52:30 UTC
This papers over the real issue, which is that we lack a proper definition of __builtin___clear_cache on FreeBSD/RISC-V. This is something I'm investigating that doesn't have a clear long-term solution yet.

Given the number of ports that depend on python to build, I think this patch has value, even as a temporary stopgap.
Comment 2 Niclas Zeising freebsd_committer freebsd_triage 2020-12-03 19:01:35 UTC
I have no problems with this, approved!
Comment 3 commit-hook freebsd_committer freebsd_triage 2020-12-08 16:05:15 UTC
A commit references this bug:

Author: kp
Date: Tue Dec  8 16:04:37 UTC 2020
New revision: 557291
URL: https://svnweb.freebsd.org/changeset/ports/557291

Log:
  devel/libffi: Fix abort() on FreeBSD riscv related to __clear_case()

  Like on mips, disable the __builtin___clear_cache() call because it triggers
  aborts.

  PR:		251564
  Approved by:	zeising

Changes:
  head/devel/libffi/files/patch-src_riscv_ffi.c
Comment 4 Mitchell Horne freebsd_committer freebsd_triage 2021-01-04 16:20:27 UTC
Seems like this can be closed now, yes?