Opened 9 months ago

Last modified 8 months ago

#69353 new defect

Macports base configure sets universal archs to arm64 x86_64 on powerpc-*-openbsd (i.e. both cpu and OS are 32-bit)

Reported by: barracuda156 Owned by:
Priority: Normal Milestone:
Component: base Version: 2.9.1
Keywords: Cc: catap (Kirill A. Korinsky)
Port:

Description

I am not sure universal archs have any meaning outside of macOS at all, but it will be reasonable to set them conditional on the triple and not randomly picked or hardcoded. Why would someone on a PowerPC want to build for arm64 by default?

Choice is also wrong on macOS 10.6, where universal archs are set to i386 x86_64, even when the triple is powerpc-apple-darwin. (I guess this is why dtrace never worked for me – I accidentally noticed wrong archflags during the build recently.)

  1. S. I know they could be overridden by a configure arg, but fixing defaults will still be nice.

Change History (4)

comment:1 Changed 9 months ago by ryandesign (Ryan Carsten Schmidt)

As far as I know, universal builds are only possible on macOS so any attempt to use the universal variant on non-Mac operating systems would fail and what value universal_archs is set to would thus be irrelevant.

comment:2 in reply to:  1 Changed 8 months ago by barracuda156

Replying to ryandesign:

As far as I know, universal builds are only possible on macOS so any attempt to use the universal variant on non-Mac operating systems would fail and what value universal_archs is set to would thus be irrelevant.

Fair enough. I still think the code needs a fix here though:

# Check whether --with-universal-archs was given.
if test ${with_universal_archs+y}
then :
  withval=$with_universal_archs; UNIVERSAL_ARCHS=${withval}
fi


	if test "x$UNIVERSAL_ARCHS" = "x"; then
		case "$MACOSX_VERSION" in
			10.1[0-3]*)
				UNIVERSAL_ARCHS="x86_64 i386"
			;;
			10.1[4-9]*)
				UNIVERSAL_ARCHS="x86_64"
			;;
			10.[0-5]*)
				UNIVERSAL_ARCHS="i386 ppc"
			;;
			10.[6-9]*)
				UNIVERSAL_ARCHS="x86_64 i386"
			;;
			*)
				UNIVERSAL_ARCHS="arm64 x86_64"
			;;
		esac
	fi

On < 10.6 it should rather be i386 ppc ppc64, and on 10.6 i386 ppc x86_64, or otherwise check os.arch and make it conditional. Why would someone on a PowerPC on Leopard prefer skipping ppc64? Or on Rosetta skippin ppc?

comment:3 Changed 8 months ago by kencu (Ken)

please please please do not convince anyone to put "ppc" into the default universal archs on 10.6

It is already plenty hard enough to maintain 10.6 Intel x86_64 and it is hanging on the by barest of threads as it is. It survives because Jeremy sorted out a libc++ installation for it and in so doing, it looks enough like 10.7 - 10.13 to be handled similarly to those.

Throwing a ppc headache into every decision making tree for 10.6 would just be beyond the limits of reasonableness to expect folks to do. I am already leaning very hard towards tossing the 32bit-only i386 out of 10.6 support, as that is another PITA to support for the 0.000000000001% of people who have such a machine.

ppc64 is also no good on Tiger, so it is only of any use at all on 10.5 PPC. And on 10.5 PPC, virtually no software is ever tested as a ppc64 build, so it is a road full of headaches and heartburn. Anyone on 10.4 or 10.5 PPC should just use ppc (32 bit) and be thankful that they can use that.

IMHO.

Last edited 8 months ago by kencu (Ken) (previous) (diff)

comment:4 in reply to:  3 Changed 8 months ago by barracuda156

Replying to kencu:

please please please do not convince anyone to put "ppc" into the default universal archs on 10.6

I will not insist on this, let it be. While the fix would be trivial and generally correct: detect os.arch (or parse the triple) and set archs accordingly, given the effort needed to convince everyone and likelihood of a failure to arrive to a consensus, I rather just shut up :)

Let us have the right archs for Leopard at least? Yes, universal builds are largely broken with gcc, but then they should be disabled on 10.4–10.5 by default. However, it is just wrong to have i386 but no ppc64 on Leopard PowerPC, IMO.

Last edited 8 months ago by barracuda156 (previous) (diff)
Note: See TracTickets for help on using tickets.