mirror of
https://github.com/Wack0/peppc.git
synced 2025-06-18 10:35:37 -04:00
GCC 9 (Retro68) fork - compiler targeting PowerPC Windows NT (with PASM.EXE assembler and VC4.x linker)
config | ||
contrib | ||
fixincludes | ||
gcc | ||
gnattools | ||
gotools | ||
include | ||
INSTALL | ||
intl | ||
libada | ||
libatomic | ||
libbacktrace | ||
libcc1 | ||
libcpp | ||
libdecnumber | ||
libffi | ||
libgcc | ||
libgfortran | ||
libgo | ||
libgomp | ||
libhsail-rt | ||
libiberty | ||
libitm | ||
libobjc | ||
liboffloadmic | ||
libphobos | ||
libquadmath | ||
libsanitizer | ||
libssp | ||
libstdc++-v3 | ||
libvtv | ||
lto-plugin | ||
maintainer-scripts | ||
newlib | ||
zlib | ||
.dir-locals.el | ||
.gitattributes | ||
.gitignore | ||
ABOUT-NLS | ||
ar-lib | ||
ChangeLog | ||
ChangeLog.jit | ||
ChangeLog.tree-ssa | ||
compile | ||
config-ml.in | ||
config.guess | ||
config.rpath | ||
config.sub | ||
configure | ||
configure.ac | ||
COPYING | ||
COPYING3 | ||
COPYING3.LIB | ||
COPYING.LIB | ||
COPYING.RUNTIME | ||
depcomp | ||
install-sh | ||
libtool-ldflags | ||
libtool.m4 | ||
lt~obsolete.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.m4 | ||
MAINTAINERS | ||
Makefile.def | ||
Makefile.in | ||
Makefile.tpl | ||
MD5SUMS | ||
missing | ||
mkdep | ||
mkinstalldirs | ||
move-if-change | ||
multilib.am | ||
NEWS | ||
README_gcc | ||
README.md | ||
symlink-tree | ||
test-driver | ||
ylwrap |
Compiler for Windows NT PowerPC
This is a fork of Retro68's GCC 9.1, heavily modified to emit asm that the official NTPPC assembler PAS.EXE
(aka cross-assembler PASM.EXE
as included in old VC6-era Windows CE 2.x for PowerPC toolchain) can build. Combine with VC++4.x's linker (any later will not work) to make a full toolchain.
Known bugs
-O2
and higher is broken, without disabling problematic optimisations: at least-fno-align-functions -fno-align-labels -fno-align-jumps -fno-align-loops
- No SEH support
- Function prologues + epilogues / stack frames are technically not correct for PPC NT, this only really causes issues with some exceptions in kernel mode leading to
PANIC_STACK_SWITCH
bugcheck (instead of the correct one) due to exception handling related code in NT itself raising an exception - C++ support is completely untested.
- No libgcc, if you need math related functions from there use arith64.c (or manually use
Rtl*
functions from ntdll/etc)
There may be other issues.
Building
git clone https://github.com/Wack0/peppc
mkdir peppc-build
mkdir peppc-build/gcc-build
mkdir peppc-build/toolchain
cd peppc-build/gcc-build
../../peppc/configure --target=powerpcle-pe-winnt --prefix=$PWD/../toolchain --enable-languages=c,c++ --disable-libssp --disable-lto --src=../../peppc MAKEINFO=missing
make # add -j as appropriate
# libgcc build will fail, this is expected.
cd gcc
make install
Usage
Compile, assemble, link like so:
powerpcle-pe-winnt-gcc -S -O1 -o - file.c | powerpcle-pe-winnt-cpp - -P -w -o file.asm # add compiler switches as appropriate
pasm.exe -o file.obj file.asm # ran through wine if needed
link.exe /OUT:file.exe file.obj libs... # ran through wine if needed