Opened 4 years ago
Closed 22 months ago
#62449 closed defect (fixed)
libffi @3.3_1: not building universal on arm64
Reported by: | kencu (Ken) | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | universal arm64 | Cc: | NateCrawford (Nathan Crawford), nortcele |
Port: | libffi |
Description
seems to be building the x86_64 parts as arm64 in some places, no doubt due to lack of arch flags where they need to be:
make[3]: *** [libffi_convenience.la] Error 1 make[3]: *** Waiting for unfinished jobs.... libtool: link: /usr/bin/clang -dynamiclib -o .libs/libffi.7.dylib src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi64.o src/x86/.libs/unix64.o src/x86/.libs/ffiw64.o src/x86/.libs/win64.o -L/opt/kencuuniversal/lib -O3 -Wl,-headerpad_max_install_names -arch x86_64 -Wl,-syslibroot -Wl,/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -Wl,-headerpad_max_install_names -arch x86_64 -Wl,-syslibroot -Wl,/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -install_name /opt/kencuuniversal/lib/libffi.7.dylib -compatibility_version 9 -current_version 9.0 -Wl,-single_module ld: warning: ignoring file src/.libs/prep_cif.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file src/.libs/types.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file src/.libs/raw_api.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file src/.libs/java_raw_api.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file src/.libs/closures.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file src/x86/.libs/ffiw64.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 ld: warning: ignoring file src/x86/.libs/ffi64.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64 Undefined symbols for architecture x86_64: "_ffi_closure_unix64_inner", referenced from: _ffi_closure_unix64 in unix64.o "_ffi_closure_win64_inner", referenced from: _ffi_closure_win64 in win64.o
% file ./x86_64-apple-darwin20.3.0/src/raw_api.o ./x86_64-apple-darwin20.3.0/src/raw_api.o: Mach-O 64-bit object arm64
Attachments (1)
Change History (9)
Changed 4 years ago by kencu (Ken)
Attachment: | libffi-fail-universal-arm64.log added |
---|
comment:1 Changed 4 years ago by NateCrawford (Nathan Crawford)
Cc: | NateCrawford added |
---|
comment:2 Changed 4 years ago by jrjsmrtn
comment:3 Changed 4 years ago by jrjsmrtn
I was thinking of adding a libffi-devel subport to ease testing
Ok, not a good idea as ports depending on libffi
will not have a dependency on libffi-devel
...
comment:4 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)
Keywords: | arm64 added |
---|
To clarify, it's that building x86_64/arm64 universal on an Apple Silicon machine fails. Building x86_64/arm64 universal on an Intel machine presumably succeeds because we have the binary on our packages server.
comment:5 Changed 3 years ago by DDeanBrown (Dean)
Also fails on Intel machine when building from source. I got it to fail by doing
port install libffi +universal
using non-standard install prefix, and also got it to fail by doing
port install -s libffi +universal
with default install prefix of /opt/local
comment:6 Changed 3 years ago by DDeanBrown (Dean)
Forgot to add this to my comment - the failures are on a Intel Mac running 11.3, could be that it's OK on Intel Mac running 10.x
comment:7 Changed 3 years ago by nortcele
Cc: | nortcele added |
---|
comment:8 Changed 22 months ago by kencu (Ken)
Resolution: | → fixed |
---|---|
Status: | new → closed |
this can be built and installed as universal on an M1 Mac now:
% port -v installed libffi | grep univ libffi @3.4.4_0+universal requested_variants='+universal' platform='darwin 22' archs='arm64 x86_64' date='2022-12-28T23:00:31-0800'
I was following https://github.com/libffi/libffi/issues/571 so I quickly patched the
libffi
portfile to build and test the git master with +universal:AFAICT, all tests are successful except for
testsuite/libffi.go/go.exp
:As, according to https://github.com/libffi/libffi/issues/571, there is still work to do with
libffi
on M1, I was thinking of adding alibffi-devel
subport to ease testing, at least untillibffi
3.4 is released. What do you think ?