Opened 9 years ago

Closed 3 years ago

#47085 closed defect (fixed)

libffi is built for G4 when running on a G3

Reported by: tomemm Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: tiger powerpc Cc: RivetBenoit (Benoit Rivet), gerzsonj@…, tanzislam (Tanzinul Islam)
Port: libffi

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Powerbook PPC 750 (pismo) 500Mhz, 10.4.11, 1G ram, 11G disk available Xcode 2.5

wireshark build failed. macport-users discussion indicated libffi as the failing member, based on:

lipo -info /opt/local/lib/libffi.6.dylib /opt/local/lib/libgio-2.0.0.dylib
Non-fat file: /opt/local/lib/libffi.6.dylib is architecture: ppc7400
Non-fat file: /opt/local/lib/libgio-2.0.0.dylib is architecture: ppc

printouts from logs of the build are in the macport-users discussion about this failure.

Change History (12)

comment:1 Changed 9 years ago by mf2k (Frank Schima)

Keywords: tiger powerpc added; wireshark libffi removed
Owner: changed from macports-tickets@… to opendarwin.org@…

In the future, please Cc the port maintainers (port info --maintainers wireshark), if any.

Please attach the main.log to this ticket.

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

Cc: ryandesign@… added

Cc Me!

comment:3 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from opendarwin.org@… to macports-tickets@…
Port: libffi added; wireshark removed
Summary: port install wireshark failslibffi is built for G4 when running on a G3

This has been discussed on the mailing list. The problem is that libffi is built for G4, even though he has a G3. The log of the "successful" libffi build was provided on the mailing list.

comment:4 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)

comment:5 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: benoit.rivet@… added

Has duplicate #48842.

comment:6 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

I have reported this problem to the libffi-discuss mailing list. Hopefully they will suggest a solution.

comment:7 Changed 9 years ago by RivetBenoit (Benoit Rivet)

I’ve been able to build libffi successfully on a G3 Mac after downloading libffi-3.2.1.tar.gz, modifying line 34 in src/powerpc/darwin.S and line 37 in src/powerpc/darwin_closure.S from

#define machine_choice MODE_CHOICE(ppc7400,ppc64)

to :

#define machine_choice MODE_CHOICE(ppc,ppc64)

Of course, this may break libffi on G4 Mac (where ppc7400 or ppc7450 may be expected). However, since I wanted to build on a G3 Mac, I did not bother to check what happens on G4 Mac with that change. After that, ./configure, make then make install installed libffi.6.dylib and libffi.dylib in /usr/local/lib and

lipo -info /usr/local/lib/libffi.6.dylib

gives :

Non fat file: /usr/local/lib/libffi.6.dylib is architecture: ppc750

I was then able to install the gobject-introspection port through macports via :

sudo port install gobject-introspection

which failed previously due to libffi with the message :

Library not loaded: /opt/local/lib/libffi.6.dylib
 Referenced from: /opt/local/lib/libgio-2.0.0.dylib
 Reason: no suitable image found.  Did find:
	/opt/local/lib/libffi.6.dylib: incompatible cpu-subtype

PS: I reported this success to the libffi-discuss mailing list.

comment:8 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: gerzsonj@… added

Has duplicate #48837.

comment:9 in reply to:  7 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to benoit.rivet@…:

I’ve been able to build libffi successfully on a G3 Mac after downloading libffi-3.2.1.tar.gz, modifying line 34 in src/powerpc/darwin.S and line 37 in src/powerpc/darwin_closure.S

Since I don't know all the implications of making that change, I'll wait to modify the port until the developers of libffi confirm whether that is the correct fix.

comment:10 Changed 5 years ago by tanzislam (Tanzinul Islam)

Cc: tanzislam added

comment:11 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign removed
Owner: changed from macports-tickets@… to ryandesign
Status: newaccepted

There was no response to my mailing list post so I'm going ahead with the change.

Upstream switched to using ppc7400 as part of this megacommit:

https://github.com/libffi/libffi/commit/0e5843995f46900ef212531281e08b224464f413

But the comments in the ChangeLog show that the intention was to provide 64-bit support. There's no mention in the comments about also switching the 32-bit support to require G4, so the change may have been unintentional or upstream may simply not have considered that people using pre-G4 processors might still be interested in libffi.

On Mac OS X 10.5, if you compile for arch ppc, gcc silently substitutes arch ppc7400 since 10.5 requires a G4 or better, so this won't make a difference for Leopard systems, so I'm only increasing the revision of the port for Tiger.

Compiling for G3 should be fine for a G4, it just won't include any G4-specific optimizations. For PowerPC, MacPorts always compiles with arch ppc, not arch ppc7400, so this change makes libffi consistent with other ports.

comment:12 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In 92737d4939590f13b5cb7b9bcd6cc7a1814d39e9/macports-ports (master):

libffi: On Tiger, build for PowerPC G3 not G4

Closes: #47085

Note: See TracTickets for help on using tickets.