Bug 251564 - modify build of devel/libffi for riscv64
Summary: modify build of devel/libffi for riscv64
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Niclas Zeising
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-03 16:00 UTC by Mark Linimon
Modified: 2021-01-04 16:42 UTC (History)
2 users (show)

See Also:
zeising: maintainer-feedback+


Attachments
new file devel/libffi/files/patch-src_riscv_ffi.c (324 bytes, text/plain)
2020-12-03 16:00 UTC, Mark Linimon
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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?