cctools-port icon indicating copy to clipboard operation
cctools-port copied to clipboard

[bug] ld doesn't support ppc

Open ChrisNonyminus opened this issue 2 years ago • 4 comments

When cctools is configured to target powerpc-apple-darwin, as assembles powerpc assembly without issue, but ld will not link it.

chrisnonyminus@DESKTOP-JLMSNKL:~/test/helloworld$ powerpc-apple-darwin-ld a.out -o test -arch ppc
ld: unknown/unsupported architecture name for: -arch ppc
chrisnonyminus@DESKTOP-JLMSNKL:~/test/helloworld$ powerpc-apple-darwin-ld -v
@(#)PROGRAM:ld  PROJECT:ld64-609
BUILD 17:46:02 Mar  3 2022
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
LTO support using: LLVM version 10.0.0 (static support for 26, runtime is 26)```

ChrisNonyminus avatar Mar 04 '22 04:03 ChrisNonyminus

ld64-127 was the last version from Apple to support ppc

Gcenx avatar Mar 18 '22 13:03 Gcenx

Recently I attempted to review the difference between the current ld64 and the ld64-127.2, and I attempted to backport PowerPC-related parts but hadn't completed that yet. On another side, I want to get a shot to make the ld64-127 work here. How much the modded ld64 is different from the official ld64?

Wohlstand avatar Jan 17 '23 03:01 Wohlstand

P.S. I attempting to make a cross-compiler toolchain to run my experimental stuff on my Mac Mini G4, however, it's a pain to build the code on it because of a very weak processor, and therefore a cross-compiler for modern Linux should simplify this. I built everything except GCC: it fails to build the thing because of the ld64...

Wohlstand avatar Jan 17 '23 04:01 Wohlstand

I made the first attempt here: https://github.com/tpoechtrager/cctools-port/compare/master...Wohlstand:cctools-port:ppc-revive I had to compare two versions: 127.2 and 128.2 to see what parts of the code were changed in order to remove PowerPC support. So, I attempted to restore that code to the latest version (which appears in this repository here). Trying some to verify its work and make the thing work...

Wohlstand avatar Jan 17 '23 05:01 Wohlstand