tpoechtrager / osxcross

Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android (Termux)
GNU General Public License v2.0
2.85k stars 320 forks source link

Is it still possible to build osxcross to target powerpc? #281

Open WinterMute opened 3 years ago

WinterMute commented 3 years ago

As per title.

I've attempted to build using 10.5 SDK using master which told me to build using the 'osxcross-1.1' branch instead. That branch built fine but only produces binaries to target i386 & x86_64.

Building from ppc-test branch is failing for me with this error building cctools

libtool: link: clang -I../include -I../include/foreign -I../libstuff -I../libobjc2 -Wall -Wno-long-long -Wno-import -Wno-format -Wno-deprecated -Wno-unused-variable -Wno-unused-private-field -Wno-unused-function -Wno-invalid-offsetof -Wno-int-conversion -Wno-char-subscripts -Wno-shift-negative-value -D_DARWIN_C_SOURCE -D__DARWIN_UNIX03 -D__LITTLE_ENDIAN__=1 -DOTOOL -DEFI_SUPPORT -O2 -pipe -isystem /usr/local/include -isystem /usr/pkg/include -DDISABLE_CLANG_AS -o otool otool-main.o ../libstuff/otool-ofile.o otool-ofile_print.o otool-m68k_disasm.o otool-i860_disasm.o otool-m88k_disasm.o otool-i386_disasm.o otool-ppc_disasm.o otool-hppa_disasm.o otool-sparc_disasm.o otool-arm_disasm.o otool-print_objc.o otool-print_objc2_32bit.o otool-print_objc2_64bit.o otool-print_bitcode.o otool-coff_print.o otool-arm64_disasm.o otool-dyld_bind_info.o -pthread  -L/usr/local/lib -L/usr/pkg/lib ../libstuff/.libs/libstuff.a ../libobjc2/.libs/libobjc.a -lsupc++ -ldl -pthread
/usr/bin/ld: otool-arm_disasm.o:(.bss+0x8): multiple definition of `dis_info'; otool-i386_disasm.o:(.bss+0x0): first defined here
/usr/bin/ld: otool-arm64_disasm.o:(.bss+0x0): multiple definition of `dis_info'; otool-i386_disasm.o:(.bss+0x0): first defined here
/usr/bin/ld: otool-print_bitcode.o: in function `print_bitcode_section':
print_bitcode.c:(.text+0x243): warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Is it possible to target powerpc now?

tpoechtrager commented 3 years ago

I have added patches to make the ppc-test branch build. However it's totally broken and abandoned.

$ target/bin/i386-apple-darwin8-clang oclang/test.c -arch ppc
ld: in section __TEXT,__text reloc 1: sectionForNum(4) section number not for any section file '[...]/MacOSX10.4u.sdk/usr/lib/crt1.o' for architecture ppc
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)

Is it possible to target powerpc now?

Therefore, no, it's not possible. Sorry.

nehalem501 commented 3 years ago

I guess this failing is normal as clang targeting powerpc OS X was never implemented (you can google about this, LLVM darwin-ppc support was never complete and was completely removed a few years ago).

Supporting powerpc should be theoretically possible using gcc though.

Wohlstand commented 1 year ago

I also have the same question. Recently I bought the Mac Mini G4 to make my experiments on it, however, it's a very slow build process on it, and I really feel better to have a cross-compiler on my main machine which has enough power to build the same program quickly.

Wohlstand commented 1 year ago

10.5 SDK

Such old SDKs are designed to use the GCC as was told above. At my end, there is an SDK for 10.4 and I run Mac OS 10.4 Tiger. And, here GCC 4.0.1 is being used. However, I am fully able to obtain GCC 7 using Tigerbrew (a fork of Homebrew with a goal to get it to work on Tiger).