Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#66129 closed defect (worksforme)

Pythons +universal build failure on 10.8

Reported by: barracuda156 Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.8.0
Keywords: mountainlion Cc:
Port: python310, python39, python38

Description

I have been long saying that Pythons are broken for +universal on PPC, and that been ignored, because no one cares. Well, it is also broken on Intel:

clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: i386-apple-darwin12.6.0
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to http://developer.apple.com/bugreporter/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg: Error generating preprocessed source(s) - cannot generate preprocessed source with multiple -arch options.
make: *** [Modules/signalmodule.o] Error 70
make: *** Waiting for unfinished jobs....

I actually have fixed all Pythons locally to build as universal. Tested for ppc+ppc64 on Leopard, but presumably gonna work on any system for Intel.

I wanna avoid a situation when my PR is just closed (instead of advising me a better way to do it, where needed), like last time with a fix for Python LTO on PPC. If there is an interest in having this fixed, I can open a PR – and request for help to check it (it is not the case where I am sure everything works correctly and optimally – but at least it does work, unlike existing universal).

Attachments (1)

python310_10.8.5.log (146.1 KB) - added by barracuda156 2 years ago.

Download all attachments as: .zip

Change History (11)

Changed 2 years ago by barracuda156

Attachment: python310_10.8.5.log added

comment:1 Changed 2 years ago by kencu (Ken)

the trivial fix to build python as universal ppc/ppc64 has never been PR’d, I believe. Feel free to do that… start with python27, work it through with Josh. I’ll support you, I used it myself. 2-line patch, first invented 10 years ago, easy, works. Once that goes in, he may also agree to maintain for newer pythons too. Upstream declined that fix as ancient unsupported darwin system combo, though.

the fix you proposed for LTO was pointless as there is no LTO support on PPC. So forcing everyone to build every python port with a newer gcc was both a lot of potential trouble, and needless. So that rightfully was declined.

All the pythons have always built universal on all Intel systems, so let’s see what you’ve run into here…

comment:2 Changed 2 years ago by kencu (Ken)

looks like an ICE with this old clang, involving atomics perhaps?

1473	 :fatal error: error in backend: Cannot select: 0x10268f210: i8,ch = AtomicLoad 0x1028e77e8, 0x10268f510<Volatile LD1[@is_tripped.0]> [ID=11]
1474	:info:build   0x10268f510: i64 = X86ISD::WrapperRIP 0x10268c210 [ID=10]
1475	:info:build     0x10268c210: i64 = TargetGlobalAddress<i1* @is_tripped.0> 0 [ID=8]
1476	:info:build In function: _PyErr_CheckSignalsTstate
1477	:info:build clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)

I don’t see this is likely fixable, so probably have to blacklist this clang version if someone else can reproduce this error.

Noted it builds fine non-universal 64-bit with this compiler:

https://build.macports.org/builders/ports-10.8_x86_64-builder/builds/104825

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

Keywords: mountainlion added
Summary: Pythons are broken for +universal, even on Intel with ClangPythons +universal build failure on 10.8
:debug:sysinfo Xcode 5.1.1, CLT 5.0.1.0.1.1377666378

Can you update the CLTs to match Xcode?

comment:4 Changed 2 years ago by kencu (Ken)

Resolution: worksforme
Status: assignedclosed

python310 +universal installs fine on mountainlion, without any problem and without touching a thing in the portfiles.

$ uname -a
Darwin os-x-10.8-mountain-lion.shared 12.6.0 Darwin Kernel Version 12.6.0: Wed Mar 18 16:23:48 PDT 2015; root:xnu-2050.48.19~1/RELEASE_X86_64 x86_64

$ port -v installed python310
The following ports are currently installed:
  python310 @3.10.8_0+universal (active) requested_variants='+universal' platform='darwin 12' archs='i386 x86_64' date='2022-11-01T09:46:03-0700'

so it must be something on your system, and most likely it is what Josh noted, your CLTs are out of date.

Mine are:

DEBUG: Xcode 5.1.1, CLT 5.1.0.0.1.1396320587

and I believe they are the last CLTs for 10.8, but it's a long while since I checked developer.apple.com for 10.8 software.

If you update your CLTs and still get a build error, please reopen with new information.

Last edited 2 years ago by kencu (Ken) (previous) (diff)

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

Now that we have $xcodecltversion, it would be good if base could warn about known problematic CLT versions like it does for Xcode.

comment:6 Changed 2 years ago by barracuda156

Ken, Joshua: Thank you, and sorry if it is something wrong with my 10.8.5. While I did not tweak anything there (Macports uses default settings and compilers), it may be the case that something is not set properly which I am not aware of (I do not use 10.8.5 normally, it is just for occasional testing prior to PRs). Xcode did not show any available updates though last time I checked in the settings.

How do I ensure correct CLT are installed? On 10.5–10.6 they just ship with Xcode.

comment:7 in reply to:  3 Changed 2 years ago by barracuda156

Replying to jmroot:

:debug:sysinfo Xcode 5.1.1, CLT 5.0.1.0.1.1377666378

Can you update the CLTs to match Xcode?

Looks like this is indeed the issue. Thanks for pointing. Wonder why Xcode and OS were silent re available updates.

comment:8 Changed 2 years ago by kencu (Ken)

"port diagnose" should point out this issue, if it doesn't already. And probably point out if the Xcode and CLTs on a given system, especially one of the older systems that aren't being updated any longer, are not the latest (supported) version.

@catap just went down this rabbit hole on 10.7 a short while ago, opening upstream issues, generating patches, all because his system was out-of-whack, so you have lots of company.

We've seen this many times over the years.

comment:9 in reply to:  6 ; Changed 2 years ago by jmroot (Joshua Root)

Replying to barracuda156:

How do I ensure correct CLT are installed? On 10.5–10.6 they just ship with Xcode.

IIRC they are downloaded from within the Xcode preferences on 10.8? If that is no longer working, they're in the Apple Developer web site downloads section. The package you want is "Command Line Tools (OS X Mountain Lion) for Xcode - April 2014".

comment:10 in reply to:  9 Changed 2 years ago by barracuda156

Replying to jmroot:

Replying to barracuda156:

How do I ensure correct CLT are installed? On 10.5–10.6 they just ship with Xcode.

IIRC they are downloaded from within the Xcode preferences on 10.8? If that is no longer working, they're in the Apple Developer web site downloads section. The package you want is "Command Line Tools (OS X Mountain Lion) for Xcode - April 2014".

Thank you! From within Xcode it does not work (for me, at least, but I did try before and now again to make sure). Installing now from Apple Developer the version which you referred.

Note: See TracTickets for help on using tickets.