Opened 2 years ago

Closed 2 years ago

#64836 closed defect (fixed)

ghc build error on arm: 'ffitarget_arm64.h' file not found

Reported by: essandess (Steve Smith) Owned by: essandess (Steve Smith)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: ghc

Description

sudo port install ghc

:info:build /opt/local/var/macports/build/_opt_local_ports_lang_ghc/ghc/work/bootstrap/lib/ghc-9.2.1/lib/../lib/aarch64-osx-ghc-9.2.1/rts-1.0.2/include/ffitarget.h:6:10: error:
:info:build      fatal error: 'ffitarget_arm64.h' file not found
:info:build   |
:info:build 6 | #include "ffitarget_arm64.h"
:info:build   |          ^
:info:build #include "ffitarget_arm64.h"
:info:build          ^~~~~~~~~~~~~~~~~~~
:info:build 1 error generated.
:info:build `clang' failed in phase `C Compiler'. (Exit code: 1)

The file ffitarget_arm64.h exists in both Xcode and CLT:

$ locate ffitarget_arm64.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi/ffitarget_arm64.h
/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/ffi/ffitarget_arm64.h
/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/ffi/ffitarget_arm64.h
/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/ffi/ffitarget_arm64.h

Does anyone know how to tell MacPorts to find this file on arm? (Log attached.)

Attachments (1)

main.log.gz (15.4 KB) - added by essandess (Steve Smith) 2 years ago.
ghc main.log.gz

Download all attachments as: .zip

Change History (6)

Changed 2 years ago by essandess (Steve Smith)

Attachment: main.log.gz added

ghc main.log.gz

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

Add -I${configure.sdkroot}/usr/include/ffi to CPPFLAGS?

comment:2 Changed 2 years ago by essandess (Steve Smith)

Thanks, I tried both of these without success:

configure.cppflags-append \
                    -I${configure.sdkroot}/usr/include/ffi
build.env-append    "C_INCLUDE_PATH=${configure.sdkroot}/usr/include/ffi"

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

It looks like ghc includes its own copy of libffi, which doesn't include the right files to work on arm64. Either that needs to be fixed, or an external libffi needs to be used. Mixing and matching files from different versions won't end well.

comment:5 Changed 2 years ago by essandess (Steve Smith)

Owner: set to essandess
Resolution: fixed
Status: newclosed

In 2ed595298ab3e8321a5647446c00e366e939d837/macports-ports (master):

ghc: Fix build on arm

Fixes: #64836

  • known_fail on non-arm and non-i386 platforms
Note: See TracTickets for help on using tickets.